10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

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.

plied), but only the corresponding data structures used for PVF file name administration.This gives rise to the following strategies:> Minimize memory usage: it is recommended to call PDF_delete_pvf( ) immediately afterthe API call which accepted the virtual file name, and another time after PDF_close( ). The second call is required because PDFlib may still need access to the data sothat the first call refuses to unlock the virtual file. However, in some cases the firstcall will already free the data, and the second call doesn’t do any harm. The clientmay free the file contents only when PDF_delete_pvf( ) succeeded.> Optimize performance by reusing virtual files: some clients may wish to reuse somedata (e.g., font definitions) within various output documents, and avoid multiplecreate/delete cycles for the same file contents. In this case it is recommended not tocall PDF_delete_pvf( ) as long as more PDF output documents using the virtual filewill be generated.> Lazy programming: if memory usage is not a concern the client may elect not to callPDF_delete_pvf( ) at all. In this case PDFlib will internally delete all pending virtualfiles in PDF_delete( ).In all cases the client may free the corresponding data only when PDF_delete_pvf( ) returnedsuccessfully, or after PDF_delete( ).3.1.3 Resource Configuration and File SearchingIn most advanced applications PDFlib needs access to resources such as font file, encodingdefinition, ICC color profiles, etc. In order to make PDFlib’s resource handling platform-independentand customizable, a configuration file can be supplied for describingthe available resources along with the names of their corresponding disk files. In additionto a static configuration file, dynamic configuration can be accomplished at runtimeby adding resources with PDF_set_parameter( ). For the configuration file we dugout a simple text format called Unix PostScript Resource (UPR) which came to life in theera of Display PostScript, and is still in use on several systems. However, we extendedthe original UPR format for our purposes. The UPR file format as used by PDFlib will bedescribed below. There is a utility called makepsres (often distributed as part of the XWindow System) which can be used to automatically generate UPR files from PostScriptfont outline and metrics files.Resource categories. The resource categories supported by PDFlib are listed in Table3.1. Other resource categories will be ignored. The values are treated as name strings;they can be encoded in ASCII or UTF-8 (with BOM). Unicode values may be useful for localizedfont names with the HostFont resource.Table 3.1 Resource categories supported in PDFlibcategory format explanationSearchPath value Relative or absolute path name of directories containing data filesCMap key=value CMap file for CJK encodingFontAFM key=value PostScript font metrics file in AFM formatFontPFM key=value PostScript font metrics file in PFM formatFontOutline key=value PostScript, TrueType or OpenType font outline file48 Chapter 3: PDFlib Programming

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

Saved successfully!

Ooh no, something went wrong!