10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Searching for the UPR resource file. If only the built-in resources (e.g., PDF core font,built-in encodings, sRGB ICC profile) or system resources (host fonts) are to be used, aUPR configuration file is not required, since PDFlib will find all necessary resourceswithout any additional configuration.If other resources are to be used you can specify such resources via calls to PDF_set_parameter( ) (see below) or in a UPR resource file. PDFlib reads this file automaticallywhen the first resource is requested. The detailed process is as follows:> If the environment variable PDFLIBRESOURCE is defined PDFlib takes its value as thename of the UPR file to be read. If this file cannot be read an exception will bethrown.> If the environment variable PDFLIBRESOURCE is not defined PDFlib tries to open a filewith the following name:upr (on MVS; a dataset is expected)pdflib//fonts/pdflib.upr (on IBM eServer iSeries)pdflib.upr (Windows, Unix, and all other systems)If this file cannot be read no exception will be thrown.> On Windows PDFlib will additionally try to read the registry entryHKLM\SOFTWARE\PDFlib\PDFlib\7.0.5\resourcefileThe value of this entry (which will be created by the PDFlib installer, but can also becreated by other means) will be taken as the name of the resource file to be used. Ifthis file cannot be read an exception will be thrown.> The client can force PDFlib to read a resource file at runtime by explicitly setting theresourcefile parameter:p.set_parameter("resourcefile", "/path/to/pdflib.upr");This call can be repeated arbitrarily often; the resource entries will be accumulated.Configuring resources at runtime. In addition to using a UPR file for the configuration,it is also possible to directly configure individual resources within the source code viathe PDF_set_parameter( ) function. This function takes a category name and a correspondingresource entry as it would appear in the respective section of this category ina UPR resource file, for example:p.set_parameter("FontAFM", "Foobar-Bold=foobb___.afm");p.set_parameter("FontOutline", "Foobar-Bold=foobb___.pfa");Note Font configuration is discussed in more detail in Section 5.3.1, »Searching for Fonts«, page 101.Querying resource values. In addition to setting resource entries you can query valuesusing PDF_get_parameter( ). Specify the category name as key and the index in the list asmodifier. For example, the following call:s = p.get_parameter("SearchPath", n);will retrieve the n-th entry in the SearchPath list If n is larger than the number of availableentries for the requested category an empty string will be returned. The returnedstring is valid until the next call to any API function.3.1 General Programming 51

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

Saved successfully!

Ooh no, something went wrong!