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.

The cloneboxes option instructs <strong>PDFlib</strong>+PDI to copy all page boxes of the imported page<br />

to the generated output page, effectively cloning all page size aspects.<br />

Alternatively, you can use the pdiusebox option to explicitly instruct PDI to use any<br />

of the MediaBox, CropBox, BleedBox, TrimBox or ArtBox entries of a page (if present) for<br />

determining the size of the imported page.<br />

Imported PDF pages with layers. Acrobat 6 (PDF 1.5) introduced the layer functionality<br />

(technically known as optional content). PDI will ignore any layer information which<br />

may be present in a file. All layers in the imported page, including invisible layers, will<br />

be visible in the generated output.<br />

Importing georeferenced PDF with PDI. When importing georeferenced PDF with PDI<br />

the geospatial information will be kept if it has been created with one of the following<br />

methods (image-based geospatial reference):<br />

> with <strong>PDFlib</strong> and the georeference option of load_image( )<br />

> by importing an image with geospatial information in Acrobat.<br />

The geospatial information will be lost after importing a page if it has been created with<br />

one of the following methods (page-based geospatial reference):<br />

> with <strong>PDFlib</strong> and the viewports option of begin/end_page_ext( )<br />

> by manually geo-registering a PDF page in Acrobat.<br />

Imported PDF with OPI information.<br />

retained in the output unmodified.<br />

OPI information present in the input PDF will be<br />

Optimization across multiple imported documents. While <strong>PDFlib</strong> itself creates highly<br />

optimized PDF output, imported PDF may contain redundant data structures which can<br />

be optimized. In addition, importing multiple PDFs may bloat the output file size if<br />

multiple files contain identical resources, e.g. fonts. In this situation you can use the<br />

optimize option of begin_document( ). It will detect redundant objects in imported files,<br />

and remove them without affecting the visual appearance or quality of the generated<br />

output.<br />

7.2.3 Acceptable PDF Documents<br />

Generally, PDI will happily process all kinds of PDF documents which can be opened<br />

with Acrobat, regardless of PDF version number or features used within the file. In order<br />

to import pages from encrypted documents (i.e., files with permission settings or password)<br />

the corresponding master password must be supplied.<br />

PDI implements a repair mode for damaged PDFs so that even certain kinds of damaged<br />

documents can be opened. However, in rare cases a PDF document or a particular<br />

page of a document may be rejected by PDI.<br />

If a PDF document or page can’t be imported successfully open_pdi_document( ) and<br />

open_pdi_page( ) return an error code. If you need to know more details about the failure<br />

you can query the reason with get_errmsg( ). Alternatively, you can set the errorpolicy option<br />

or parameter to true, which will result in an exception if the document cannot be<br />

opened.<br />

The following kinds of PDF documents will be rejected by default; however, they can<br />

be opened for querying information with pCOS (as opposed to importing pages) by setting<br />

the infomode option to true:<br />

190 Chapter 7: Importing Images and PDF Pages (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!