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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

myencoding=myencoding.enc<br />

.<br />

ICCProfile<br />

highspeedprinter=cmykhighspeed.icc<br />

.<br />

Searching for the UPR resource file. If only the built-in resources (e.g., PDF core font,<br />

built-in encodings, sRGB ICC profile) or system resources (host fonts) are to be used, a<br />

UPR configuration file is not required since <strong>PDFlib</strong> will find all necessary resources without<br />

any additional configuration.<br />

If other resources are to be used you can specify such resources via calls to set_<br />

parameter( ) (see below) or in a UPR resource file. <strong>PDFlib</strong> reads this file automatically<br />

when the first resource is requested. The detailed process is as follows:<br />

> If the environment variable PDFLIBRESOURCE is defined <strong>PDFlib</strong> takes its value as the<br />

name of the UPR file to be read. If this file cannot be read an exception will be<br />

thrown.<br />

> If the environment variable PDFLIBRESOURCE is not defined <strong>PDFlib</strong> tries to open a file<br />

with the following name:<br />

pdflib.upr<br />

If this file cannot be read no exception will be thrown.<br />

> On <strong>Windows</strong> <strong>PDFlib</strong> will additionally try to read the following registry entries which<br />

will be searched in the order provided below:<br />

HKLM\Software\<strong>PDFlib</strong>\<strong>PDFlib</strong>8\8.0.6\resourcefile<br />

HKLM\Software\<strong>PDFlib</strong>\<strong>PDFlib</strong>8\resourcefile<br />

HKLM\Software\<strong>PDFlib</strong>\resourcefile<br />

The values of these entries will be taken as the name of the resource file to be used. If<br />

this file cannot be read an exception will be thrown.<br />

Be careful when manually accessing the registry on 64-bit <strong>Windows</strong> systems: as usual,<br />

64-bit <strong>PDFlib</strong> binaries will work with the 64-bit view of the <strong>Windows</strong> registry,<br />

while 32-bit <strong>PDFlib</strong> binaries running on a 64-bit system will work with the 32-bit view<br />

of the registry. If you must add registry keys for a 32-bit product manually, make<br />

sure to use the 32-bit version of the regedit tool. It can be invoked as follows from the<br />

Start, Run... dialog:<br />

%systemroot%\syswow64\regedit<br />

> The client can force <strong>PDFlib</strong> to read a resource file at runtime by explicitly setting the<br />

resourcefile parameter:<br />

p.set_parameter("resourcefile", "/path/to/pdflib.upr");<br />

This call can be repeated arbitrarily often; the resource entries will be accumulated.<br />

Configuring resources at runtime. In addition to using a UPR file for the configuration,<br />

it is also possible to directly configure individual resources within the source code via<br />

the set_parameter( ) function. This function takes a category name and a corresponding<br />

resource entry as it would appear in the respective section of this category in a UPR resource<br />

file, for example:<br />

p.set_parameter("FontAFM", "Foobar-Bold=foobb___.afm");<br />

p.set_parameter("FontOutline", "Foobar-Bold=foobb___.pfa");<br />

3.1 General <strong>PDFlib</strong> Programming Aspects 65

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

Saved successfully!

Ooh no, something went wrong!