Справочник Пользователя для Adobe acrobat 7.0.5 sdk

Скачать
Страница из 122
Working with PDF Documents
Creating and Editing Page Content
5
52
Creating and Editing Page Content
Page content is a major component of a PDF file. It represents the visible marks on a page 
that are drawn by a set of PDF marking operators. The set of marking operators for a page is 
also referred to as a display list, since it is a list of marking operations that represent the 
displayed portion of a page. See the PDF Reference for an overview of page content streams 
and references to other chapters that describe the marking operators in detail. 
PDFEdit API
The PDFEdit API provides easy access to PDF page contents. With PDFEdit, your plug-in can 
treat a page’s contents as a list of objects rather than manipulating the content stream’s 
marking operators. 
PDFEdit is meant to be used in conjunction with the Acrobat PD layer and Cos layer 
methods for manipulating PDF documents. To use PDFEdit effectively, you should be 
familiar with PDF page marking operators and the PD layer of the core API, described in the 
Acrobat and PDF LIbrary API Overview.
Acrobat Distiller and PDFWriter create documents from PostScript or as output from a 
printer driver. Non-PDFEdit methods in the core API allow displaying and printing 
documents, and provide the ability to rearrange pages and to add annotations. However, 
most of these manipulations are creation-centered, or only deal with objects at the page 
level and above. PDFEdit methods, on the other hand, allow your plug-in to deal with 
objects at the level of a page’s contents.
There is no Acrobat JavaScript equivalent to the PDFEdit API to allow you to manipulate 
page content.
For more information, see the Acrobat and PDF Library API Overview.
PDFEdit Samples
There are several “snippets” available from the 
SnippetRunner
 sample plug-in that 
demonstrate how to add data to the contents of a page. Using the Acrobat core API greatly 
simplifies modifying and creating PDF page contents. In addition, Acrobat updates the byte 
offset table and page resources to ensure that the PDF file is still readable after 
modification. This would be significantly more complex if this were attempted by parsing 
and rewriting the page contents without using the core API, and could result in an 
unreadable PDF file.
For more information, see the SnippetRunner Cookbook.