Adobe Acrobat SDK
Developing Plug-ins and Applications
HelloWorldStr,
strlen(HelloWorldStr),// Length of text
pdeFont,
&gState,
sizeof(gState),
NULL,
0,
&textMatrix,
NULL);
//Insert text into page content
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement) pdeText);
Saving the PDF document
You can save the PDF document by invoking the
arguments:
A
PDDoc
●
A
PDSaveFlags
●
argument, which results in the entire document being saved. For more information about this
parameter, see the Acrobat and PDF Library API Reference.
An
ASPathName
●
An
ASFileSys
●
object" on page
A progress monitor value. Invoke the
●
default. You can pass
The address of a
●
each time it is called. Pass
The following code example saves the PDF document to the local directory as out.pdf.
Example 4.8
//Save the PDF document
#if !MAC_ENV
PDDocSave(pdDoc, PDSaveFull | PDSaveLinearized ,ASPathFromPlatformPath
("out.pdf"), NULL, NULL, NULL);
#else
ASPathName macPath = GetMacPath("out.pdf");
PDDocSave(pdDoc, PDSaveFull | PDSaveLinearized, macPath , NULL, NULL, NULL);
ASFileSysReleasePath(NULL,macPath);
Examining a PDF Library application source file
This section shows the entire source file that is responsible for importing text into a PDF document. All
concepts shown in this source file are explained earlier in this chapter. For information, see
inserting text into a PDF document" on page
object that represents the PDF document.
object that specifies save options. For example, you can pass
object that represents the path to which the file is saved.
object that represents the file system. For information, see
162.
, in which case no progress monitor is used.
NULL
progMonClientData
if the previous argument (progMon) is
NULL
Saving a PDF document
// Text to add
// Font to apply to text
//Address of PDEGraphicState object
//Size of graphic state to apply to text
//Transformation matrix for text
//Stroke matrix
PDDocSave
AVAppGetDocProgressMonitor
object that contains user-supplied data to pass to
62.
Inserting Text into PDF Documents
Saving the PDF document
method and passing the following
PDSaveFull
"Creating an ASFileSys
method to obtain the
.
NULL
67
to this
progMon
"About