Adobe ACROBAT SDK 8.1 Manual page 69

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications
#include "PagePDECntCalls.h"
#ifdef MAC_ENV
#include "macUtils.h"
#endif
void MainProc(void)
{
char buf[256];
ASInt32 i;
ASBool b;
PDDoc pdDoc;
PDPage pdPage;
PDEContent pdeContent;
ASFixedRect mediaBox;
PDSysFont sysFont;
PDEFont pdeFont;
PDEFontAttrs pdeFontAttrs; /* Font attributes
PDEText pdeText;
ASFixedMatrix textMatrix; /* Transformation matrix for text */
PDEColorSpace pdeColorSpace; /* ColorSpace */
PDEGraphicState gState;
char *HelloWorldStr = "Hello There"; // Text to write to the PDF
#ifdef MAC_ENV
ASPathName macPath;
#endif
/*==================================================================*\
\*==================================================================*/
DURING
pdDoc = PDDocCreate();
mediaBox.left
mediaBox.top
mediaBox.right = Int16ToFixed(5*72);
mediaBox.bottom = fixedZero;
//Create a page with those dimensions and insert it as the first page
pdPage = PDDocCreatePage(pdDoc, PDBeforeFirstPage, mediaBox);
//Acquire a PDEContent container for the page
pdeContent = PDPageAcquirePDEContent(pdPage, NULL);
/*==================================================================*\
Acquire a font, add text, and insert into page content container
\*==================================================================*/
//Set the size of the PDSysFont and set its attributes
memset(&pdeFontAttrs, 0, sizeof(pdeFontAttrs));
pdeFontAttrs.name = ASAtomFromString("CourierStd");
/* Reference to a PDF document */
/* Reference to a page in doc */
/* Container for page content */
/* Dimensions of page */
/* Used by PDEFont creation */
/* Reference to a font used on a page */
/* Container for text */
/* Graphic state to apply to operation */
Create the doc, page, and content container
= fixedZero;
= Int16ToFixed(4*72);
Inserting Text into PDF Documents
Examining a PDF Library application source file
*/
/* Create new document */
/* Dimensions of page
/* In this case 5" x 4" */
69
*/

Advertisement

Table of Contents
loading

Table of Contents