PDFlib 8 Windows COM/.NET Tutorial
PDFlib 8 Windows COM/.NET Tutorial
PDFlib 8 Windows COM/.NET Tutorial
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
7.2 Importing PDF Pages with PDI<br />
Note All functions described in this section require <strong>PDFlib</strong>+PDI. The PDF import library (PDI) is not<br />
contained in the <strong>PDFlib</strong> base product. Although PDI is integrated in all precompiled editions of<br />
<strong>PDFlib</strong>, a license key for PDI (or PPS, which includes PDI) is required to use it.<br />
7.2.1 PDI Features and Applications<br />
When the optional PDI (PDF import) library is attached to <strong>PDFlib</strong>, pages from existing<br />
PDF documents can be imported. PDI contains a parser for the PDF file format, and prepares<br />
pages from existing PDF documents for easy use with <strong>PDFlib</strong>. Conceptually, imported<br />
PDF pages are treated similarly to imported raster images such as TIFF or PNG:<br />
you open a PDF document, choose a page to import, and place it on an output page, applying<br />
any of <strong>PDFlib</strong>’s transformation functions for translating, scaling, rotating, or<br />
skewing the imported page. Imported pages can easily be combined with new content<br />
by using any of <strong>PDFlib</strong>’s text or graphics functions after placing the imported PDF page<br />
on the output page (think of the imported page as the background for new content). Using<br />
<strong>PDFlib</strong> and PDI you can easily accomplish the following tasks:<br />
> overlay two or more pages from multiple PDF documents (e.g., add stationary to existing<br />
documents in order to simulate preprinted paper stock);<br />
> place PDF ads in existing documents;<br />
> clip the visible area of a PDF page in order to get rid of unwanted elements (e.g., crop<br />
marks), or scale pages;<br />
> impose multiple pages on a single sheet for printing;<br />
> process multiple PDF/X or PDF/A documents to create a new PDF/X or PDF/A file;<br />
> copy the PDF/X or PDF/A output intent of a file;<br />
> add some text (e.g., headers, footers, stamps, page numbers) or images (e.g., company<br />
logo) to existing PDF pages;<br />
> copy all pages from an input document to the output document, and place barcodes<br />
on the pages;<br />
> use the pCOS interface to query arbitrary properties of a PDF document (see pCOS<br />
Path Reference for details).<br />
In order to place a PDF background page and populate it with dynamic data (e.g., mail<br />
merge, personalized PDF documents on the Web, form filling) we recommend using PDI<br />
along with <strong>PDFlib</strong> blocks (see Chapter 11, »PPS and the <strong>PDFlib</strong> Block Plugin«, page 277).<br />
7.2.2 Using PDI Functions with <strong>PDFlib</strong><br />
Cookbook Code samples regarding PDF import issues can be found in the pdf_import category of the<br />
<strong>PDFlib</strong> Cookbook.<br />
General considerations. It is important to understand that PDI will only import the actual<br />
page contents, but not any interactive features (such as sound, movies, embedded<br />
files, hypertext links, form fields, JavaScript, bookmarks, thumbnails, and notes) which<br />
may be present in the imported PDF document. These interactive features can be generated<br />
with the corresponding <strong>PDFlib</strong> functions. <strong>PDFlib</strong> blocks will also be ignored when<br />
importing a page. Document structure from Tagged PDF will also be lost when importing<br />
a document.<br />
188 Chapter 7: Importing Images and PDF Pages (Edition for <strong>COM</strong>, .<strong>NET</strong>, and REALbasic)