Adobe acrobat 7.0.5 sdk User Manual

Page of 122
45
Creating PDF Documents
Creating PDF Documents Using Plug-ins or Acrobat JavaScript
4
C re at i n g   P D F   D o c u m e n t s   Us i n g   P l u g - i n s   o r   Ac ro b at   J av a S c r i p t
You can use Acrobat and the Acrobat SDK to create a new, empty PDF file and to create a 
PDF file from supported file types.
Creating an Empty PDF File
Using either a plug-in or Acrobat JavaScript, you can dynamically create a new PDF file and 
modify its contents in an automated fashion. This can help make a document responsive to 
user input and enhance the workflow process.
Using Acrobat JavaScript
Acrobat JavaScript provides support for dynamic PDF file creation and content generation. 
This means that it is possible to dynamically create a new PDF file and modify its contents in 
an automated fashion. 
Using a Plug-in
Using a plug-in, you can use the PDDocCreate API to create a new, empty PDF file. You can 
then use the PDDocCreatePage or PDDocInsertPages to add content to the created file.
Creating PDF Files from Multiple Files
It is possible to use either a plug-in, IAC or JavaScript to dynamically add content from 
other sources into a new PDF file. The sources may include files whose types conform to 
Multipurpose Internet Mail Extensions (MIME) type definitions. 
Using Acrobat JavaScript
To import an external file into a PDF document, invoke the doc object’s 
importDataObject
 method. After doing this, it is possible to extract information from 
the data object for placement and presentation within the PDF document. 
You can automate the insertion of multiple PDF files into a single PDF document through a 
series of calls to the doc object’s insertPages and replacePages methods. 
Finally, to use a portion of the current document to create a new document, you can invoke 
the doc object’s extractPages method.
Using a Plug-in or IAC
You can use the 
AVConversionToPDFHandler
 API to extract data from other file types, 
and then bind the resulting PDF files into one PDF file using 
PDDocInsertPages
. These 
APIs can also be conveniently executed directly from an IAC application.