Source language: Translate to:

Another PDF plugin problem

Plug-ins and utilities of interest to NeoBook authors

Moderator: Neosoft Support

Another PDF plugin problem

Postby sunscreen202 » Tue Jun 15, 2004 3:39 am

Hopefully I'm going to overcome this problem as easily as the previous one.

It seems that when you compile a publication into one EXE, the compiler 'forgets' to include the PDFs called by the PDF plugin. When you run the compiled application, all the PDFs are missing (error message appears). No error message appears during compilation.

Is there any way of overcoming this? It's not a huge problem, but it would be nice to include everything in one EXE.
sunscreen202
 

Another PDF plugin problem

Postby Sam Cox » Tue Jun 15, 2004 3:45 am

The PDF plug-in just "plays" the PDF files; it does not automatically embed them in the EXE. You can, however, do that yourself with the ExtractFile command. See the help file for the syntax and example.

The ExtractFile command does these things:

1) when the PUB is complied, the source files named in each ExtractFile command are embedded inside the PUB.

2) when the compiled PUB is executed, the source files embedded in the PUB are extracted from the PUB to the destination directory.

From an earlier post:

The ExtractFile command serves two purposes:

1) It is a cleverly disguised compiler directive that tells the compiler to sweep up the named file and include it in the pub's EXE. If you have specified "Compress and Encrypt" as a compiler option, these files will also be compressed and encrypted in the pub's EXE. For this to work correctly, the name of the file to be included in the pub's EXE must be completely stated in the command. For example, do not use [PubDir] to replace "c:\samples\" in the following, even if "c:\samples\" is your [Pubdir]:

    ExtractFile "c:\samples\template.doc" "c:\my documents"

The target extraction directory, on the other hand, may be less specific and use variables such as [PubDir].

2) When you run your pub's EXE file (which now contains all those PDF files), the ExtractFile command pulls the possibly compressed and encrypted files from the EXE and puts them in the target directory specified in the command.

When your PUB terminates, the ExtractFile command does not erase the extracted files. If you don't want the files cluttering your user's HDD, it is your responsibility to erase them. A good place for the code to erase such files is in Book Properties :: Actions :: Shutdown.

(Edited by Sam Cox at 3:07 am on June 15, 2004)
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA


Return to NeoBook Plug-Ins and Utilities

Who is online

Users browsing this forum: No registered users and 1 guest

cron