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.

We recommend the following approach with respect to warnings:> Enable warning logging in the development phase, and carefully study any warningmessages in the log file. They may point to potential problems in your code or data,and you should try to understand or eliminate the reason for those warnings.> Disable warning logging in the production phase, and re-enable it only in case ofproblems.3.1.2 The PDFlib Virtual File System (PVF)Cookbook A full code sample can be found in the Cookbook topic general/starter_pvf.In addition to disk files a facility called PDFlib Virtual File System (PVF) allows clients to directlysupply data in memory without any disk files involved. This offers performancebenefits and can be used for data fetched from a database which does not even exist onan isolated disk file, as well as other situations where the client already has the requireddata available in memory as a result of some processing.PVF is based on the concept of named virtual read-only files which can be used justlike regular file names with any API function. They can even be used in UPR configurationfiles. Virtual file names can be generated in an arbitrary way by the client. Obviously,virtual file names must be chosen such that name clashes with regular disk files areavoided. For this reason a hierarchical naming convention for virtual file names is recommendedas follows (filename refers to a name chosen by the client which is unique inthe respective category). It is also recommended to keep standard file name suffixes:> Raster image files: /pvf/image/filename> font outline and metrics files (it is recommended to use the actual font name as thebase portion of the file name): /pvf/font/filename> ICC profiles: /pvf/iccprofile/filename> Encodings and codepages: /pvf/codepage/filename> PDF documents: /pvf/pdf/filenameWhen searching for a named file PDFlib will first check whether the supplied file namerefers to a known virtual file, and then try to open the named file on disk.Lifetime of virtual files. Some functions will immediately consume the data suppliedin a virtual file, while others will read only parts of the file, with other fragments beingused at a later point in time. For this reason close attention must be paid to the lifetimeof virtual files. PDFlib will place an internal lock on every virtual file, and remove thelock only when the contents are no longer needed. Unless the client requested PDFlib tomake an immediate copy of the data (using the copy option in PDF_create_pvf( )), the virtualfile’s contents must only be modified, deleted, or freed by the client when it is nolonger locked by PDFlib. PDFlib will automatically delete all virtual files in PDF_delete( ).However, the actual file contents (the data comprising a virtual file) must always befreed by the client.Different strategies. PVF supports different approaches with respect to managing thememory required for virtual files. These are governed by the fact that PDFlib may needaccess to a virtual file’s contents after the API call which accepted the virtual file name,but never needs access to the contents after PDF_close( ). Remember that calling PDF_delete_pvf( ) does not free the actual file contents (unless the copy option has been sup-3.1 General Programming 47

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

Saved successfully!

Ooh no, something went wrong!