17.05.2014 Views

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

File search and the SearchPath resource category. <strong>PDFlib</strong> reads a variety of data items,<br />

such as raster images, font outline and metrics information, encoding definitions, PDF<br />

documents, and ICC color profiles from disk files. In addition to relative or absolute<br />

path names you can also use file names without any path specification. The SearchPath<br />

resource category can be used to specify a list of path names for directories containing<br />

the required data files. When <strong>PDFlib</strong> must open a file it will first use the file name exactly<br />

as supplied and try to open the file. If this attempt fails, <strong>PDFlib</strong> will try to open the file<br />

in the directories specified in the SearchPath resource category one after another until it<br />

succeeds. SearchPath entries can be accumulated, and will be searched in reverse order<br />

(paths set at a later point in time will searched before earlier ones). This feature can be<br />

used to free <strong>PDFlib</strong> applications from platform-specific file system schemes. You can set<br />

search path entries as follows:<br />

p.set_parameter("SearchPath", "/path/to/dir1");<br />

p.set_parameter("SearchPath", "/path/to/dir2");<br />

In order to disable the search you can use a fully specified path name in the <strong>PDFlib</strong> functions.<br />

Note the following platform-specific features of the SearchPath resource category:<br />

> On <strong>Windows</strong> <strong>PDFlib</strong> will initialize the SearchPath with entries from the registry. The<br />

following registry entries may contain a list of path names separated by a semicolon<br />

’;’ character. They will be searched in the order provided below:<br />

HKLM\SOFTWARE\<strong>PDFlib</strong>\<strong>PDFlib</strong>8\8.0.6\SearchPath<br />

HKLM\SOFTWARE\<strong>PDFlib</strong>\<strong>PDFlib</strong>8\SearchPath<br />

HKLM\SOFTWARE\<strong>PDFlib</strong>\SearchPath<br />

> The <strong>COM</strong> and .<strong>NET</strong> installer will initialize the SearchPath registry entry with the following<br />

directory (or a similar one if you installed <strong>PDFlib</strong> elsewhere):<br />

C:\Program Files\<strong>PDFlib</strong>\<strong>PDFlib</strong> 8.0.6\resource<br />

Sample UPR file.<br />

The following listing gives an example of a UPR configuration file:<br />

PS-Resources-1.0<br />

.<br />

SearchPath<br />

/usr/local/lib/fonts<br />

C:/psfonts/pfm<br />

C:/psfonts<br />

/users/kurt/my_images<br />

.<br />

FontAFM<br />

Code-128=Code_128.afm<br />

.<br />

FontPFM<br />

Corporate-Bold=corpb___.pfm<br />

Mistral=c:/psfonts/pfm/mist____.pfm<br />

.<br />

FontOutline<br />

Code-128=Code_128.pfa<br />

ArialMT=Arial.ttf<br />

.<br />

HostFont<br />

Wingdings=Wingdings<br />

.<br />

Encoding<br />

64 Chapter 3: Creating PDF Documents (Edition for <strong>COM</strong>, .<strong>NET</strong>, and REALbasic)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!