DL Logo

PDPage Definitions

PDAllPages

Header: PDExpT.h:2159

Syntax

#define PDAllPages (( PDPageNumber ) - 3 )

PDBeforeFirstPage

Header: PDExpT.h:2157

Syntax

#define PDBeforeFirstPage (( PDPageNumber ) - 1 )

PDEvenPagesOnly

Header: PDExpT.h:2161

Syntax

#define PDEvenPagesOnly (( PDPageNumber ) - 5 )

PDLastPage

Header: PDExpT.h:2158

Syntax

#define PDLastPage (( PDPageNumber ) - 2 )

PDOddPagesOnly

Header: PDExpT.h:2160

Syntax

#define PDOddPagesOnly (( PDPageNumber ) - 4 )

kPDPageStmSkipComments

Header: PDExpT.h:3966

Syntax

#define kPDPageStmSkipComments 0x0001

kPDPageStmStringMax

Header: PDExpT.h:3963

Syntax

#define kPDPageStmStringMax 256

kPDPageStmTokenHexString

Header: PDExpT.h:3972

Syntax

#define kPDPageStmTokenHexString 0x0001

PDPage Enumerations

PDPageAreas

Header: PDExpT.h:6340

Description

Different logical areas on a page.

Value options for PDPageArea.

Enum Constants

kPDPageArea
kPDClipArea
kPDNumAreas

PDPageDrawFlagsPIs

Header: PDExpT.h:6739

Description

Value options for PDPageDrawFlagsPI.

Enum Constants

kPDPageDoLazyErasePI=0x00000001
Erase the page while rendering only as needed.
kPDPageIgnoreIsolatedAndKnockoutTransparencyGroupPI=0x00000010
Ignore Isolated and Knockout transparency at page boundary.
kPDPageUseAnnotFacesPI=0x00000040
Draw annotation appearances.
kPDPageIsPrintingPI=0x00000080
The page is being printed.
kPDPageDisplayOverPrintPreviewPI=0x00000100
Display overprint preview.
kPDPageUseTrapAnnotsPI=0x00002000
Use trap network annotations.
kPDPageDirectlyImposedPI=0x00004000
Directly imposed page.
kPDPageIsPSPrintingPI=0x00008000
PostScript printing.
kPDPageEmitPageGroupPI=0x00010000
Emit a page group.
kPDPageUsePrinterMarkAnnotsPI=0x00020000
User printer's mark annotations.
kPDPagePassOPItoAGMPortPI=0x00040000
Pass open prepress interface (OPI) to AGM port.
kPDPagePassMetadatatoAGMPortPI=0x00080000
Pass metadata to AGM port.
kPDPagePassOCtoAGMPortPI=0x00100000
Pass optional content to AGM port.
kPDPageDoNotSubstituteWorkingSpacesPI=0x00800000
Do not substitute working spaces.
kPDPageSwapComponentsPI=0x01000000
Render colors in BGR order rather than RGB. It is only valid for calls to PDPageDrawContentsToMemory() and only when outputing to an RGB colorspace.
kPDPageSuppressRasterAlphaPI=0x02000000
Suppress raster alpha.
kPDPageWorkingSpacesOnlyForChangePI=0x04000000
If this is set, only use a working space instead of a device space if the process color model of the target device is different than that of the source
kPDPageUseStampAnnotsOnlyPI=0x08000000
If set, only consider Stamp annotations. This overrides kPDPageUseAnnotFaces.

PDPageModes

Header: PDExpT.h:1975

Description

An enumerated data type that specifies whether thumbnail images or bookmarks are shown.

Value options for PDPageMode.

Enum Constants

PDDontCare
Leaves the view mode as is.
PDUseNone
Displays the document, but displays neither thumbnails nor bookmarks.
PDUseThumbs
Displays the document plus thumbnails.
PDUseBookmarks
Displays the document plus bookmarks.
PDFullScreen
Displays the document in full-screen viewing mode. This is equivalent to AVAppBeginFullScreen().
PDContents
PDUseOC
Displays the document plus layers.
PDUseAttachments
Displays the document plus attachments.

PDPageRotation

Header: PDExpT.h:2456

Description

Specifies page rotation, in degrees. It is used for routines that set or get the value of a page's Rotate key.

Value options for PDRotate.

Enum Constants

pdRotate0=0
pdRotate90=90
pdRotate180=180
pdRotate270=270

PDPage Typedefs

PDPage

Header: PDBasicExpT.h:88

Description

A single page in the PDF representation of a document. Just as PDF files are partially composed of their pages, PDDoc objects are composed of PDPage objects. A page contains a series of objects representing the objects drawn on the page (PDGraphic), a list of resources used in drawing the page, annotations (PDAnnot), an optional thumbnail image of the page, and the beads used in any articles that occur on the page. The first page in a PDDoc is page 0.

Related Methods

Syntax

typedef struct _t_PDPage *PDPage;

Returned From

Used By

PDPageArea

Header: PDExpT.h:6351

Description

Different logical areas on a page.

For value options see PDPageAreas.

Syntax

typedef ASEnum16 PDPageArea;

PDPageDrawFlagsPI

Header: PDExpT.h:6798

Description

For value options see PDPageDrawFlagsPIs.

Syntax

typedef ASUns32 PDPageDrawFlagsPI;

PDPageMode

Header: PDExpT.h:2004

Description

An enumerated data type that specifies whether thumbnail images or bookmarks are shown.

For value options see PDPageModes.

Syntax

typedef ASEnum8 PDPageMode;

Returned From

Used By

PDPageNumber

Header: PDExpT.h:61

Description

A 0-based page number for use in AVPageView and AVDoc methods. Negative for special values.

For value options see AdobePDFVersion.

Syntax

typedef ASInt32 PDPageNumber;

Used In

PDRotate

Header: PDExpT.h:2469

Description

Specifies page rotation, in degrees. It is used for routines that set or get the value of a page's Rotate key.

For value options see PDPageRotation.

Syntax

typedef ASEnum16 PDRotate;

Returned From

Used By

PDPage Callback Signatures

PDPageEnumInksCallback

Header: PDExpT.h:6003

Description

Used for enumerating the inks on a page via PDPageEnumInks().

Syntax

ASBool PDPageEnumInksCallback(PDPageInk ink, void *clientData);

Used By

Used In

PDPageStmImageDataProc

Header: PDExpT.h:4034

Syntax

ASBool PDPageStmImageDataProc(ASUns8 *data, ASSize_t dataLen, void *clientData);

Used By

PDPageStmStringOverflowProc

Header: PDExpT.h:4010

Syntax

void PDPageStmStringOverflowProc(char *sVal, ASSize_t sValLen, void *clientData);

Used By

PDPage Structures

_t_PDHostSepsPlateRec

Header: PDExpT.h:6006

Description

Used to specify per-plate options when doing separations.

Syntax

struct _t_PDHostSepsPlateRec {
ASSize_t size;
The size of the structure. It must be set to sizeof(PDHostSepsPlateRec).
ASAtom colorantName;
The name of the colorant from the Separation or DeviceN colorspace, or a spot or process color name (Cyan, Magenta, Yellow, Black).
ASUns8 whatToDo;
ASUns32 wasColorSet;
Set internally. It is used to determine whether marks were made on this plate to aid in blank detection.
ASStm epsStm;
Set internally. It is the stream into which Acrobat emits PostScript for this plate. It is NULL if whatToDo is not set to kEmitPlate.
ASFile file;
Set internally. It is used only when separating documents, to close the file afterward.
ASPathName path;
Set internally. It is used only when separating documents, to reopen the stream on the next page.
float frequency;
The frequency for this ink. Set it to-1 to use the default value.
float angle;
The angle for this ink. Set it-1 to use the default value.
ASUns8 inkType;
The ink type for this ink.
ASInt32 trapSequence;
The trap sequence for this ink.
float density;
The neutral density for this ink.
ASAtom alias;
Alias this spot to another.
} PDHostSepsPlateRec, *PDHostSepsPlate;

Used In

_t_PDHostSepsSpecRec

Header: PDExpT.h:6062

Description

Used to control the generation of separations from Acrobat.

Syntax

struct _t_PDHostSepsSpecRec {
ASSize_t size;
The size of the structure. It must be set to sizeof(PDHostSepsSpecRec).
ASUns32 psLevel;

The PostScript printing level. 2 means emit as level 2, 3 means level 3.

It is used if the emitToPrinter or emitToFile print parameter is true.

ASBool binaryOK;

true if a binary channel to the printer is supported, false otherwise.

It is used if the emitToPrinter or emitToFile print parameter is true.

ASBool emitAnnots;
When true, emit annotations.
ASBool emitHalftones;
When true, emit halftones.
ASBool emitTransferFuncs;
When true, emit transfer functions.
ASBool emitSeparableImagesOnly;
When true, emit separable images only.
ASBool suppressCJKSubstitution;
When true, suppress CJK substitution.
ASEnum8 emitFontOption;
Font output options. Its values can be:
Value
Description
Embed no fonts.
Emit all embedded fonts.
Emit all fonts.
ASBool TTasT42;
When true, send TrueType fonts as TrueType fonts (level 3 and most level 2 PS printers). When false, convert TrueType to T1 (typically desirable only for Level 1 PS where no TrueType handling is present).
ASBool printerHasFarEastFonts;
true means do not include Far East fonts.
ASUns32 transparencyLevel;
The transparency level, which can be 0-100.
ASBool useCMYKWorkingColorspace;
When true, color manage DeviceCMYK. When false, pass it directly onto the process plates.
char destProfile [256];
The profile description of a valid CMYK profile, such as the strings seen in the color management preferences in Acrobat (for example, "U.S. Web Coated (SWOP) v2").
ASBool convertToProcessUsingOPP;
When true, use the overprint preview (OPP) for converting to process, which better simulates what would happen if the spot ink were really used.
ASUns32 numPlates;
The number of items in the plates array.
PDHostSepsPlate *plates;
A list of the colorant names and what to do with them for separations.
PDOCContext ocContext;
The optional-content context to use for visibility state information, or NULL to use the document's current states in the default context.
ASBool applyOCGPrintOverrides;
Print-specific visiblity state settings are always applied from the optional-content group. applyOCGPrintOverrides is no longer honored. It is always considered as true whatever may be the value passed to it.
ASBool negative;
When true, invert the plate.
ASEnum8 mirrorprint;
One of the following constants:
Constant
Value
0x01
0x02
0x04
0x08

Mirroring is done in the PostScript output stream.

ASUns32 whichMarks;
A page mark indication. It is a bit-wise OR of the PDPageMarkFlags values.
ASBool western;
When true, use the western style for page marks.
ASBool doInRipTrapping;
ASInt32 marksStyle;
ASInt32 trapType;
ASPathName customMarksPath;
} PDHostSepsSpecRec, *PDHostSepsSpec;

Used By

Used In

_t_PDPageInkRec

Header: PDExpT.h:5949

Description

Represents an ink used on a page.

Related Methods

Syntax

struct _t_PDPageInkRec {
ASSize_t size;
The size of the structure. It must be set to sizeof(PDPageInkRec).
ASAtom colorantName;
The name of the colorant from the Separation or DeviceN colorspace, or the process color name.
ASBool isProcessColor;
true if this is a process color, false if this is a spot color.
ASUns8 whatToDo;
    How to handle the colorant for a separation preview. Its value can be:
  • kEmitColorant
  • kDontEmitColorant
  • kConvertToProcess
ASUns8 r, g, b;
RGB values for on-screen display of a colorswatch.
float frequency;
The frequency for this ink.
float angle;
The angle for this ink.
ASUns8 inkType;
The ink type for this ink.
ASInt32 trapSequence;
The trap sequence for this ink.
float cyan;
CMYK values for spot inks, provided so that neutral density can be calculated
float magenta;
CMYK values for spot inks, provided so that neutral density can be calculated
float yellow;
CMYK values for spot inks, provided so that neutral density can be calculated
float black;
CMYK values for spot inks, provided so that neutral density can be calculated
float density;
The neutral density for this ink.
ASAtom alias;
Alias this spot to another.
} PDPageInkRec, *PDPageInk;

Used By

Used In

_t_PDPageRange

Header: PDExpT.h:5564

Description

Specifies a range of pages in a document. Page numbers begin with 0.

Syntax

struct _t_PDPageRange {
ASInt32 startPage;
The starting page number.
ASInt32 endPage;
The ending page number.
ASInt32 pageSpec;
The pages in the range to print. It must be one of: PDAllPages, PDEvenPagesOnly, or PDOddPagesOnly.
ASInt16 pagePaperSource;
} PDPageRange;

_t_PDPageRange

Header: PDExpT.h:5585

Description

Specifies a range of pages in a document. Page numbers begin with 0.

Syntax

struct _t_PDPageRange {
ASInt32 startPage;
The starting page number.
ASInt32 endPage;
The ending page number.
ASInt32 pageSpec;
The pages in the range to print. It must be one of: PDAllPages, PDEvenPagesOnly, or PDOddPagesOnly.
} PDPageRange;

Used In

_t_PDPageStmToken

Header: PDExpT.h:3980

Description

A data structure used by PDPageStmGetToken(). It contains information about the current page contents token.

Syntax

struct _t_PDPageStmToken {
ASSize_t size;
The size of this record. It is to be filled in by the caller.
CosType type;
The type of token.
ASUns32 flags;
Additional information about the token (for example, indicating a hex string).
ASInt32 iVal;
The value of the token if it is a CosInteger, ASFixed, or Name.
char sVal [kPDPageStmStringMax];
The value of the token if it is a CosString.
ASSize_t sValLen;
The number of bytes in sVal.
} PDPageStmTokenRec, *PDPageStmToken;

Used By

PDPage Functions

PDPageAcquirePDEContent

Header: PgCntProcs.h:50

Description

Creates a PDEContent from the PDPage object's contents and resources. The PDEContent is cached, so that subsequent calls on the same PDPage return the same PDEContent, even if the request is from another PDFEdit client. The PDEContent remains in the cache as long as someone has it acquired- until someone not using the PDFEdit API changes the PDPage object's contents, such as the viewer rotating a page 90 degrees. Requires ‘Export’ permission on PDDoc.

Do not call PDERelease() on PDEContent you have acquired with PDPageAcquirePDEContent(); call PDPageReleasePDEContent() to release it.

Syntax

PDEContent PDPageAcquirePDEContent(IN PDPage pdPage, IN ASExtension self);

Parameters

pdPage
The page whose content object is acquired.
self
Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.)

Returns

A PDEContent representing the page's contents.

PDPageAcquirePage

Header: PDProcs.h:11178

Description

Increments the page's reference count. After you are done using the page, release it using PDPageRelease(). If PDPageRelease() is not called, it could block the document containing the page from being closed. To avoid such problems use the CSmartPDPage class as it ensures that the page is released as it goes out of scope.

Related Methods

Syntax

void PDPageAcquirePage(PDPage pdPage);

Parameters

pdPage
IN The page whose reference count is to be incremented.

PDPageAddAnnot

Header: PDProcs.h:3421

Description

Adds an annotation at the specified location in a page's annotation array.

Syntax

void PDPageAddAnnot(PDPage aPage, ASInt32 addAfter, PDAnnot annot);

Parameters

aPage
The page to which the annotation is added.
addAfter

The index into the page's annotation array where the annotation is added. See the description of Annotations in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.5, page 381.

You can find this document on the web store of the International Standards Organization (ISO).

The first annotation in the array has an index of zero. Passing a value of-2 adds the annotation to the end of the array. Passing other negative values produces undefined results.

annot
The annotation to add.

Exceptions

    is raised if:
  • The annotation is of subtype Text and the document's permissions do not include pdPermEditNotes (see PDPerms).
  • The annotation is of any other subtype and the document's permissions do not include pdPermEdit.

PDPageAddCosContents

Header: PDProcs.h:3550

Description

Completely replaces the contents of the specified page with newContents.

Related Methods

Syntax

void PDPageAddCosContents(PDPage page, CosObj newContents);

Parameters

page
IN/OUT The page whose Cos contents are replaced.
newContents
IN/OUT A stream Cos object or an array Cos object containing the new contents (stream Cos objects) for page.

PDPageAddCosResource

Header: PDProcs.h:3536

Description

Adds a Cos resource to a page object. See the description of Resource Dictionaries in ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 7.8.3, page 82.

You can find this document on the web store of the International Standards Organization (ISO).

The necessary dictionaries are created automatically if the page does not already have any resources of the type specified by resType, or does not have a Resources dictionary. For example, if you specify a font resource, but the page does not already have a font resource dictionary, this method automatically creates one and puts the font you specify into it.

ProcSet resources cannot be added using this method; they must be added using Cos-level methods to:

  • Get the page's Resources dictionary.
  • Get the ProcSet array from the Resources dictionary.
  • Add an element to the ProcSet array.

Syntax

void PDPageAddCosResource(PDPage page, const char *resType, const char *resName, CosObj resObj);

Parameters

page
The page to which a resource is added.
resType
The resource type. The named resource types in PDF are: ExtGState, ColorSpace, Pattern, Shading, XObject, Font, and Properties. Although ProcSet is also a valid resource type, it cannot be added by this method.
resName
The resource name (for example, the name of a font might be F1).
resObj
The Cos object being added as a resource to page.

PDPageAddNewAnnot

Header: PDProcs.h:3390

Description

Adds an annotation to the page. To make the annotation visible after adding it, convert the coordinates of initialRect to device coordinates using AVPageViewRectToDevice(), then call AVPageViewInvalidateRect() using the converted rectangle. This method is equivalent to calling PDPageCreateAnnot() followed by PDPageAddAnnot().

The PDPageWillAddAnnot() and PDPageDidAddAnnot() notifications are broadcast before the PDPageAddNewAnnot() method returns. If you want to finish formatting the annotation before these notifications are called, for example, by adding additional key-value pairs to the annotation dictionary, you should call PDPageCreateAnnot() followed by PDPageAddAnnot() instead of PDPageAddNewAnnot().

Syntax

PDAnnot PDPageAddNewAnnot(PDPage aPage, ASInt32 addAfter, ASAtom subType, const ASFixedRect *initialRect);

Parameters

aPage
The page to which the annotation is added.
addAfter

Where to add the annotation in the page's annotation array. See the description of Annotations in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.5, page 381.

You can find this document on the web store of the International Standards Organization (ISO).

Passing a value of-2 adds the annotation to the end of the array (this is generally what you should do unless you have a need to place the annotation at a special location in the array). Passing a value of-1 adds the annotation to the beginning of the array. Passing other negative values produces undefined results.

subType
The subtype of the annotation to add.
initialRect
A pointer to a rectangle specifying the annotation's bounds, specified in user space coordinates.

Returns

The newly created annotation.

Exceptions

    is raised if:
  • The annotation is of subtype Text and the document's permissions do not include pdPermEditNotes (see PDPerms).
  • The annotation is of any other subtype and the document's permissions do not include pdPermEdit.

PDPageCreateAnnot

Header: PDProcs.h:312

Description

Creates a new annotation, associated with the specified page's CosDoc, but not added to the page. Use PDPageAddAnnot() to add the annotation to the page.

If you want to create an annotation that prints even if the annotation handler is not present, you must provide an appearance for it. To do this, add an appearance key (AP) to the annotation dictionary, in which you place the Forms XObject for the Normal (N), Rollover (R), and Down (D) appearances; only the Normal appearance is required. Also, add a flags field (F) to the annotation dictionary and set the appropriate value for the bit field. A value of 4, which displays the annotation if the handler is not present, shows the annotation, and allows printing it, is recommended.

Syntax

PDAnnot PDPageCreateAnnot(PDPage aPage, ASAtom subType, const ASFixedRect *initialLocation);

Parameters

aPage
The page to whose PDDoc the annotation is added.
subType
The subtype of annotation to create.
initialLocation
A pointer to a rectangle specifying the annotation's bounds, specified in user space coordinates.

Returns

The newly created annotation.

Exceptions

    is raised if:
  • The annotation is of subtype Text and the document's permissions do not include pdPermEditNotes (see PDPerms), or
  • The annotation is of any other subtype and the document's permissions do not include pdPermEdit.

PDPageDrawContentsToWindow

Header: PDProcs.h:3322

Description

Draws the contents of a page into the specified window.

This method just draws a bitmap to the window. If you want a live document, you need to open an AVDoc for the PDF file.

The page can also be derived from a PDDoc.

On UNIX, this method cannot be used to draw into a window. UNIX developers should instead use AVDocOpenFromASFileWithParamString() to draw PDF files into their own window from a client.

Note: This method cannot be reliably used to print to a device.

Syntax

void PDPageDrawContentsToWindow(PDPage page, void *window, void *displayContext, ASBool isDPS, ASFixedMatrix *matrix, ASFixedRect *updateRect, CancelProc cancelProc, void *cancelProcClientData);

Parameters

page
The page to draw into window.
window
A pointer to a platform-dependent window object ( HWND on Windows, or WindowPtr). On Windows, to draw into an offscreen DC, pass NULL for window.
displayContext
A platform-dependent display context structure ( HDC on Windows). Note that displayContext cannot be reliably used as the hDC for a printer device.
isDPS
Currently unused. Always set it to false.
matrix
A pointer to the matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling.
updateRect
A pointer to the rectangle to draw, defined in user space coordinates. Any objects outside of updateRect will not be drawn. All objects are drawn if updateRect is NULL.
cancelProc
The procedure called periodically to check for the user's cancelling of the drawing operation. The default cancel proc can be obtained using AVAppGetCancelProc(). It may be NULL, in which case no cancel proc is used.
cancelProcClientData
A pointer to user-supplied data to pass to cancelProc each time it is called. It should be NULL if cancelProc is NULL.

PDPageDrawContentsToWindowEx

Header: PDProcs.h:8078

Description

Provides control over the rendering of annotations on the page to be drawn into window. It provides the ability to specify the flags passed in to the PDPageDrawContentsToWindows() function.

Note: This function can only be called with a flags value of 0. The function is not supported with any other values for flags. flags = 0 means do not render the annotation faces. If you want to draw to a window with annotations, you should call the original PDPageDrawContentsToWindow(). In general, Adobe recommends that you not use PDPageDrawContentsToWindowsEx() unless you have a specific need to prevent the drawing of annotations.

Syntax

void PDPageDrawContentsToWindowEx(PDPage page, void *window, void *displayContext, ASBool isDPS, ASFixedMatrix *matrix, ASUns32 flags, ASFixedRect *updateRect, CancelProc cancelProc, void *cancelProcClientData);

Parameters

page
The page to draw into window.
window
A pointer to a platform-dependent window object ( HWND on Windows, or WindowPtr). On Windows, to draw into an offscreen DC, pass NULL for window.
displayContext
A platform-dependent display context structure ( HDC on Windows). Note that displayContext cannot be reliably used as the hDC for a printer device.
isDPS
Currently unused. Always set it to false.
matrix
A pointer to the matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling.
flags
See PDPageDrawFlagsPI for possible values.
updateRect
A rectangle represented by the coordinates of its four sides.
cancelProc
A procedure called periodically to check for the user's cancelling of the drawing operation. The default cancel procedure can be obtained using AVAppGetCancelProc(). It may be NULL in which case no cancel procedure is used.
cancelProcClientData
A pointer to user-supplied data to pass to cancelProc each time it is called. It should be NULL if cancelProc is NULL.

Exceptions

PDPageDrawContentsToWindowEx2

Header: PDProcs.h:12834

Description

Draws the contents of a page into the specified window.

This method just draws a bitmap to the window. If you want a live document, you need to open an AVDoc for the PDF file.

The page can also be derived from a PDDoc.

On UNIX, this method cannot be used to draw into a window. UNIX developers should instead use AVDocOpenFromASFileWithParamString() to draw PDF files into their own window from a client.

Note: This method cannot be reliably used to print to a device.

Syntax

void PDPageDrawContentsToWindowEx2(PDPage page, void *window, void *displayContext, ASBool isDPS, ASDoubleMatrix *matrix, ASCab flags, ASDoubleRect *updateRect, ASCancelProc cancelProc, void *cancelProcClientData);

Parameters

page
The page to draw into window.
window
A pointer to a platform-dependent window object ( HWND on Windows, or WindowPtr). On Windows, to draw into an offscreen DC, pass NULL for window.
displayContext
A platform-dependent display context structure ( HDC on Windows). Note that displayContext cannot be reliably used as the hDC for a printer device.
isDPS
Currently unused. Always set it to false.
matrix
A pointer to the matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling.
flags
See PDPageDrawFlagsPI for possible values.
updateRect
A pointer to the rectangle to draw, defined in user space coordinates. Any objects outside of updateRect will not be drawn. All objects are drawn if updateRect is NULL.
cancelProc
The procedure called periodically to check for the user's cancelling of the drawing operation. The default cancel proc can be obtained using AVAppGetCancelProc(). It may be NULL, in which case no cancel proc is used.
cancelProcClientData
A pointer to user-supplied data to pass to cancelProc each time it is called. It should be NULL if cancelProc is NULL.

PDPageDrawContentsWithParams

Header: PDProcs.h:10554

Description

Provides control over the rendering of contents on the page, including both those parameters you would pass to PDPageDrawContentsToWindowEx(), and an optional-content context that determines which contents are visible.

Syntax

void PDPageDrawContentsWithParams(PDPage page, PDDrawParams params);

Parameters

page
The page to draw.
params
The parameters with which to draw the page, including the optional-content context to use for content visibility.

Exceptions

PDPageEnumInks

Header: PDProcs.h:8360

Description

Enumerates the inks for a page, calling the supplied procedure for each PDPageInk structure.

For the DeviceCMYK_K process color model, it always finds the four inks Cyan, Magenta, Yellow, and Black, which are marked as process inks. The RGB values in the PDPageInk structure are the RGB equivalents (in system monitor space) of 100% of the ink, which can be used to show color swatches for a given ink.

If the inks are part of a DeviceN colorspace which has not been defined in a Colorants dictionary or elsewhere in a Separation colorspace, the color of the swatch is undefined.

This call finds all color spaces that are in a color space dictionary within the page, even if they are not used by the page contents.

Related Methods

Syntax

void PDPageEnumInks(PDPage pdPage, PDPageEnumInksCallback proc, void *clientData, ASBool includeOPI);

Parameters

pdPage
The page whose contents are enumerated.
proc
The user-supplied callback procedure to be applied to each ink. Enumeration ends if any procedure returns false.
clientData
A pointer to user-supplied data to pass to proc each time it is called.
includeOPI
If true, enumerate inks contained in OPI dictionaries.

PDPageEnumInksEx

Header: PDProcs.h:11349

Description

Enumerates the inks for a page, calling the supplied procedure for each PDPageInk structure. This differs from PDPageEnumInks() in that it allows the process color model to be passed in.

For the DeviceCMYK_K process color model, it always finds the four inks Cyan, Magenta, Yellow, and Black, which are marked as process inks. The RGB values in the PDPageInk structure are the RGB equivalents (in system monitor space) of 100% of the ink, which can be used to show color swatches for a given ink.

If the inks are part of a DeviceN color space which has not been defined in a Colorants dictionary or elsewhere in a Separation color space, the color of the swatch is undefined.

This call finds all color spaces that are in a color space dictionary within the page, even if they are not used by the page contents.

Related Methods

Syntax

void PDPageEnumInksEx(PDPage pdPage, PDPageEnumInksCallback proc, void *clientData, ASBool includeOPI, ASAtom colorModel);

Parameters

pdPage
The page whose contents are enumerated.
proc
The user-supplied callback procedure to be applied to each ink. Enumeration ends if any procedure returns false.
clientData
A pointer to user-supplied data to pass to proc each time it is called.
includeOPI
If true, enumerate inks contained in OPI dictionaries.
colorModel
CMYK_K, RGB_K, or Gray_K.

PDPageEnumOCGs

Header: PDProcs.h:9212

Description

Enumerates the optional-content groups for the page, calling the supplied procedure for each one. Enumeration continues until all groups have been enumerated, or until enumProc returns false. Each group is reported once, even if it is referenced multiple times in the page.

Syntax

void PDPageEnumOCGs(PDPage pdPage, PDOCGEnumProc enumProc, void *clientData);

Parameters

pdPage
The page whose groups are enumerated.
enumProc
A user-supplied callback to call for each group. Enumeration terminates if proc returns false.
clientData
A pointer to user-supplied data to pass to enumProc each time it is called.

PDPageFlattenOC

Header: PDProcs.h:10517

Description

Replaces the page's contents with a version that has no optional content, containing only what was visible on the page when the call was made.

Syntax

ASBool PDPageFlattenOC(PDPage pdPage, PDOCContext context);

Parameters

pdPage
The page to be modified.
context
The optional-content context in which content is checked for visibility.

Returns

true if the operation is successful, false otherwise.

PDPageGetAnnot

Header: PDProcs.h:3341

Description

Gets the annotIndex annotation on the page.

Related Methods

Syntax

PDAnnot PDPageGetAnnot(PDPage aPage, ASInt32 annotIndex);

Parameters

aPage
IN/OUT The page on which the annotation is located.
annotIndex
IN/OUT The index of the annotation to get on a page. The first annotation on a page has an index of zero.

Returns

The indexed annotation object.

PDPageGetAnnotIndex

Header: PDProcs.h:3466

Description

Gets the index of a given annotation object on a given page.

Syntax

ASInt32 PDPageGetAnnotIndex(PDPage aPage, PDAnnot anAnnot);

Parameters

aPage
IN/OUT The page to which the annotation is attached.
anAnnot
IN/OUT The annotation whose index is obtained.

Returns

The annotation's index. It returns-1 if the annotation is not on the page.

PDPageGetAnnotSequence

Header: PDProcs.h:6895

Description

Returns the sequence number of the specified annotation for the given page. It is applicable only to annotations that are listed in Acrobat's Comments pane and therefore cannot be summarized using Summarize command (as would be the case for link and widget annotations, for example).

This method is similar to PDPageGetAnnotIndex() but it checks the information flags from the annotation handler's PDAnnotHandlerGetAnnotInfoFlagsProc() to determine whether the PDAnnotOperationSummarize flag is set, meaning that the annotation has a sequence number.

Note: The sequence number is one-based, while the index returned by PDPageGetAnnotIndex() is zero-based.

Syntax

ASInt32 PDPageGetAnnotSequence(PDPage page, PDAnnot annot);

Parameters

page
The page on which the annotation exists.
annot
The annotation for which the sequence number is desired.

Returns

The sequence number of the specified annotation; or-1 if the annotation is not in the page or if it is an annotation that cannot be summarized.

PDPageGetBBox

Header: PDProcs.h:3245

Description

Gets the bounding box for a page. The bounding box is the rectangle that encloses all text, graphics, and images on the page.

Syntax

void PDPageGetBBox(PDPage page, ASFixedRect *bboxP);

Parameters

page
The page whose bounding box is obtained.
bboxP
(Filled by the method) A pointer to a rectangle specifying the page's bounding box, specified in user space coordinates.

PDPageGetBox

Header: PDProcs.h:7912

Description

Returns the box specified for the page object intersected with the media box. If the value for boxName is CropBox, this call is equivalent to PDPageGetCropBox(); if the value is MediaBox, this call is equivalent to PDPageGetMediaBox().

Related Methods

Syntax

ASBool PDPageGetBox(PDPage page, ASAtom boxName, ASFixedRect *box);

Parameters

page
The page whose box is obtained.
boxName
An ASAtom representing the type of box. It can have values such as ArtBox, BleedBox, CropBox, TrimBox, or MediaBox.
box
(Filled by the method) An ASFixedRect specifying the page's box.

Returns

true if the requested box was specified for the page, false otherwise.

PDPageGetCosObj

Header: PDProcs.h:3130

Description

Gets the dictionary Cos object associated with a page. This method does not copy the object, but is instead the logical equivalent of a type cast.

Syntax

CosObj PDPageGetCosObj(PDPage page);

Parameters

page
IN/OUT The page whose Cos object is obtained.

Returns

The dictionary Cos object associated with page.

PDPageGetCosResources

Header: PDProcs.h:3496

Description

Gets the Cos object corresponding to a page's resource dictionary. A page's resource Cos object may either be directly in the Page Cos object and apply only to the page. Or, it may be in the Pages tree, be shared by multiple pages, and applies to all Page nodes below the point in the Pages tree where it is located.

Related Methods

Syntax

CosObj PDPageGetCosResources(PDPage page);

Parameters

page
IN/OUT The page whose Cos resources are obtained.

Returns

The dictionary Cos object associated with the page's resource.

PDPageGetCropBox

Header: PDProcs.h:3214

Description

Gets the crop box for a page. The crop box is the region of the page to display and print.

Syntax

void PDPageGetCropBox(PDPage page, ASFixedRect *cropBoxP);

Parameters

page
The page whose crop box is obtained.
cropBoxP
(Filled by the method) A pointer to a rectangle specifying the page's crop box, specified in user space coordinates.

PDPageGetDefaultMatrix

Header: PDProcs.h:3260

Description

Gets the matrix that transforms user space coordinates to rotated and cropped coordinates. The origin of this space is the bottom-left of the rotated, cropped page. Y is increasing.

Related Methods

Syntax

void PDPageGetDefaultMatrix(PDPage pdPage, ASFixedMatrix *defaultMatrix);

Parameters

pdPage
The page whose default transformation matrix is obtained.
defaultMatrix
(Filled by the method) A pointer to the default transformation matrix.

PDPageGetDoc

Header: PDProcs.h:3119

Description

Gets the document that contains the specified page.

Related Methods

Syntax

PDDoc PDPageGetDoc(PDPage page);

Parameters

page
IN/OUT The page whose document is obtained.

Returns

The document that contains the page.

PDPageGetDuration

Header: PDProcs.h:5888

Description

Gets the page's automatic-advance timing value, which is the maximum amount of time the page is displayed before the viewer automatically advances to the next page.

Related Methods

Syntax

ASFixed PDPageGetDuration(PDPage pdp);

Parameters

pdp
The page whose timing value is obtained.

Returns

The automatic-advance timing for the page, in seconds. If the page does not have an advance timing value, fxDefaultPageDuration is returned (representing positive infinity, meaning that it never advances).

PDPageGetFlippedMatrix

Header: PDProcs.h:3275

Description

Gets the matrix that transforms user space coordinates to rotated and cropped coordinates. The origin of this space is the top-left of the rotated, cropped page. Y is decreasing.

Related Methods

Syntax

void PDPageGetFlippedMatrix(PDPage pdPage, ASFixedMatrix *flipped);

Parameters

pdPage
The page whose flipped transformation matrix is obtained.
flipped
(Filled by the method) A pointer to the flipped transformation matrix.

PDPageGetMediaBox

Header: PDProcs.h:3183

Description

Gets the media box for a page. The media box is the natural size of the page (for example, the dimensions of an A4 sheet of paper).

Syntax

void PDPageGetMediaBox(PDPage page, ASFixedRect *mediaBoxP);

Parameters

page
IN/OUT The page whose media box is obtained.
mediaBoxP
IN/OUT (Filled by the method) A pointer to a rectangle specifying the page's media box, specified in user space coordinates.

PDPageGetNumAnnots

Header: PDProcs.h:3479

Description

Gets the number of annotations on a page. Annotations associated with pop-up windows (such as strikeouts) are counted as two annotations. Widget annotations (form fields) are included in the count.

Related Methods

Syntax

ASInt32 PDPageGetNumAnnots(PDPage aPage);

Parameters

aPage
The page for which the number of annotations is obtained.

Returns

The number of annotations on aPage.

PDPageGetNumber

Header: PDProcs.h:3098

Description

Gets the page number for the specified page.

Related Methods

Syntax

ASInt32 PDPageGetNumber(PDPage page);

Parameters

page
IN/OUT The page whose page number is obtained.

Returns

The page within the document. The first page is 0.

PDPageGetOCGs

Header: PDProcs.h:9244

Description

Gets the optional-content groups for the document.

Syntax

PDOCG *PDPageGetOCGs(PDPage pdPage);

Parameters

pdPage
The page whose OCGs are obtained.

Returns

A NULL-terminated array of PDOCG objects. The client is responsible for freeing the array with ASfree().

PDPageGetPDEContentFilters

Header: PgCntProcs.h:260

Description

Gets filters used by PDPageSetPDEContent().

The caller is responsible for allocating the filter array filters that receives the filters. filters can be NULL to just obtain the number of filters.

Syntax

ASBool PDPageGetPDEContentFilters(IN PDPage pdPage, OUT ASInt32 *numFilters, OUT ASAtom **filters);

Parameters

pdPage
The page whose content filters are obtained.
numFilters
(Filled by the method) The number of filters used by PDPageSetPDEContent().
filters
(Filled by the method) The filters used by PDPageSetPDEContent(). If it is NULL, numFilters contains the number of filters.

Returns

true if filters are obtained, false if the page's contents are not cached.

PDPageGetPDEContentFlags

Header: PgCntProcs.h:218

Description

Gets flags used by PDPageSetPDEContent().

Syntax

ASBool PDPageGetPDEContentFlags(IN PDPage pdPage, OUT ASUns32 *flags);

Parameters

pdPage
The page whose content flags are obtained.
flags
(Filled by the method) PDEContentToCosObjFlags flags.

Returns

true if flags obtained, false if the page's contents are not cached.

PDPageGetPalette

Header: PDProcs.h:8318

Description

Useful for obtaining the static, platform-specific palette; the bitmap must be already selected into the displayContext to get the palette. This API was exposed for the purpose of the ImageConversion plug-in. When that code uses PDPageDrawContentsToWindow() to get a bitmap from AGM, it needs the palette that AGM used in order to get the correct results.

Syntax

ASBool PDPageGetPalette(PDPage page, void *displayContext, char *table);

Parameters

page
The page whose palette is obtained.
displayContext
The bitmap.
table
(Filled by the method) The palette.

Returns

true if the palette was returned, false otherwise.

PDPageGetRotate

Header: PDProcs.h:3154

Description

Gets the rotation value for a page.

Related Methods

Syntax

PDRotate PDPageGetRotate(PDPage page);

Parameters

page
IN/OUT The page whose rotation is obtained.

Returns

Rotation value for the given page. It must be one of the PDRotate values.

PDPageGetTransition

Header: PDProcs.h:5863

Description

Gets the transition for a given page.

Syntax

PDTrans PDPageGetTransition(PDPage pdp);

Parameters

pdp
The page whose transition is obtained.

Returns

The page's transition. If the page has no transition, it returns a NULL transition.

PDPageGetUserUnitSize

Header: PDProcs.h:11281

Description

Returns the UserUnit value for the page. If the key is not present in the page dictionary the default of 1.0 is returned.

Syntax

float PDPageGetUserUnitSize(PDPage page);

Parameters

page
The page whose UserUnit value is being obtained.

Returns

The value of UserUnit from the page dictionary, or a default value of 1.0 if not present.

PDPageGetVisibleBBox

Header: PDProcs.h:10783

Description

Gets the bounding box for a given page for those contents that are visible in the given optional-content context. The bounding box is the rectangle that encloses the visible text, graphics, and images on the page.

Related Methods

Syntax

void PDPageGetVisibleBBox(PDPage page, PDOCContext ocContext, ASBool includeAnnots, ASFixedRect *fr);

Parameters

page
The page whose visible-content bounding box is obtained.
ocContext
The context within which the contents are visible.
includeAnnots
When true, include annotations as content that must be visible to affect the bounding box. When false, annotations are not considered at all.
fr
(Filled by the method) A pointer to a rectangle specifying the page's visible content bounding box, specified in user space coordinates. The client must not pass NULL.

PDPageHasOverprintExt

Header: PDProcs.h:11884

Description

Checks whether a page contains overprint (with qualifications).

Syntax

ASBool PDPageHasOverprintExt(PDPage pdPage);

Parameters

pdPage
The page to check.

Returns

true only if the page contains overprint.

PDPageHasTransition

Header: PDProcs.h:5851

Description

Tests whether a page has a transition.

Syntax

ASBool PDPageHasTransition(PDPage pdp);

Parameters

pdp
The page to test.

Returns

true if the page has a transition, false otherwise.

PDPageHasTransparency

Header: PDProcs.h:8192

Description

Checks whether a page uses any transparency features.

Note: To determine whether the page uses transparency, the resources of the page must be enumerated (though the page contents do not need to be parsed). The page resources may not be optimized for slow (browser-based) connections, so calling PDPageHasTransparency() before the page has been downloaded may cause unpleasant read behavior and performance problems.

Syntax

ASBool PDPageHasTransparency(PDPage pdPage, ASBool includeAnnotAppearances);

Parameters

pdPage
The page to check.
includeAnnotAppearances
If true, annotation appearances are included in the check; if false annotation appearances will be ignored.

Returns

true only if the page uses any transparency features.

PDPageMakeSeparations

Header: PDProcs.h:8390

Description

Generates print color separations for a page.

This is the entry point for creating separations for a single page. The spec structure contains an array of PDHostSepsPlate pointers, (typically based on the page inks reported by PDPageEnumInks()), with settings such as what to do on each plate and the output stream for plates that are being produced. The client owns the memory for the array and all of the records in it, and is responsible for disposing of all allocated memory.

On completion, the marked flags in the wasColorSet field of the plates indicate whether each plate was marked, meaning that any marking operation happened, even if it was clipped away or knocked out later. The special All colorant in a Separation color space does not affect the marked flags.

For Adobe Reader and Acrobat, this method does nothing.

Syntax

void PDPageMakeSeparations(PDPage pdPage, PDHostSepsSpec spec);

Parameters

pdPage
The page.
spec
The separation specification structure containing parameters for the generation.

PDPageNotifyContentsDidChange

Header: PDProcs.h:3088

Description

Broadcasts a PDPageContentsDidChange() notification. If the Acrobat viewer is version 2.1 or later, also broadcasts a PDPageContentsDidChangeEx() notification with invalidateViews set to true.

You must use this method after using Cos methods to change a page's contents. Do not use this method if you use PDPageAddCosContents() or PDPageRemoveCosContents() to change a page's contents, because those methods automatically generate the appropriate notifications.

Use PDPageNotifyContentsDidChangeEx() instead of this method if you wish to suppress the Acrobat viewer's immediate redraw of the page.

Syntax

void PDPageNotifyContentsDidChange(PDPage page);

Parameters

page
IN/OUT The page that changed.

PDPageNotifyContentsDidChangeEx

Header: PDProcs.h:5435

Description

Broadcasts a PDPageContentsDidChange() notification and a PDPageContentsDidChangeEx() notification. These notify the Acrobat viewer that a page's contents have been modified, and tells the Acrobat viewer whether to redraw the page immediately.

You must use this method after using Cos methods to change a page's contents. Do not use this method if you use PDPageAddCosContents() or PDPageRemoveCosContents() to change a page's contents, because those methods automatically generate the appropriate notifications.

If your plug-in must be compatible with version 2.0 of the Acrobat viewer, you must use PDPageNotifyContentsDidChange() instead.

Syntax

void PDPageNotifyContentsDidChangeEx(PDPage page, ASBool invalidateViews);

Parameters

page
The page that changed.
invalidateViews
true if the Acrobat viewer redraws the page view, false otherwise. This allows plug-ins to make a sequence of modifications to a page's contents, without having the entire page flash after each modification. Passing true for invalidateViews is equivalent to calling PDPageNotifyContentsDidChange().

PDPageNumFromCosObj

Header: PDProcs.h:3143

Description

Gets the page number of the page specified by a Cos object.

Note: Do not call this method with a NULL Cos object.

Related Methods

Syntax

ASInt32 PDPageNumFromCosObj(CosObj pageObj);

Parameters

pageObj
IN/OUT The dictionary Cos object for the page whose number is obtained.

Returns

The page within the document (the first page in a document is page number zero).

PDPagePDEContentWasChanged

Header: PgCntProcs.h:125

Description

Indicates a page's PDEContent has changed.

Call this after you alter a PDPage object's PDEContent but do not call PDPageSetPDEContent(), so others who have acquired the PDEContent know it has changed.

Related Methods

Syntax

void PDPagePDEContentWasChanged(IN PDPage pdPage, IN ASExtension self);

Parameters

pdPage
The page whose content was changed.
self
Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.)

PDPageRegisterForPDEContentChanged

Header: PgCntProcs.h:143

Description

Registers for the PagePDEContentDidChange() notification.

Syntax

void PDPageRegisterForPDEContentChanged(IN PagePDEContentDidChangeNPROTO proc, IN ASExtension self);

Parameters

proc
A callback for the function to call when an acquired PDPage object's PDEContent has changed.
self
Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.)

PDPageRegisterForPDEContentNotCached

Header: PgCntProcs.h:187

Description

Register for the PagePDEContentNotCached() notification.

This notification is also sent when others change (or delete) a PDPage object's contents without using PDFEdit methods. For instance, rotating or deleting a page in the viewer results in this notification being sent.

PDFEdit registers for almost a half dozen different notifications for the different ways Acrobat can alter page contents; you may need only this notification.

Syntax

void PDPageRegisterForPDEContentNotCached(IN PagePDEContentNotCachedNPROTO proc, IN ASExtension self);

Parameters

proc
A callback for the function to call when an acquired PDPage object's PDEContent is no longer valid.
self
Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.)

PDPageRelease

Header: PDProcs.h:3109

Description

Decrements the specified page's reference count.

Syntax

void PDPageRelease(PDPage page);

Parameters

page
IN/OUT The page whose reference count is decremented.

PDPageReleasePDEContent

Header: PgCntProcs.h:77

Description

Decrements a PDPage object's PDEContent internal reference count.

The PDEContent is not automatically deleted when the reference count becomes zero: it remains in the cache until the cache slot is needed for another PDPage. Thus, you do not need to keep a PDEContent acquired for performance reasons. There is a notification for which you can register that is sent when a PDEContent is actually removed from the cache, thus enabling the use of PDFEdit object's tagging methods PDEAddTag(), PDEGetTag(), and PDERemoveTag() on the PDEContent object.

Syntax

ASInt32 PDPageReleasePDEContent(IN PDPage pdPage, IN ASExtension self);

Parameters

pdPage
The page whose content object's use count is decremented.
self
Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.)

Returns

The updated reference count.

PDPageRemoveAnnot

Header: PDProcs.h:3450

Description

Removes an annotation from the specified page. Annotations are stored in Cos arrays, which are automatically compressed when an annotation is removed (see CosArrayRemove()). For this reason, if you use a loop in which you remove annotations, structure the code so the loop processes from the highest to the lowest index. If you loop the other direction, you will skip over annotations immediately following ones you remove.

Syntax

void PDPageRemoveAnnot(PDPage aPage, ASInt32 annotIndex);

Parameters

aPage
The page from which the annotation is removed.
annotIndex
The index (into the page's annotation array) of the annotation to remove.

Exceptions

    is raised if:
  • The annotation is of subtype Text and the document's permissions do not include pdPermEditNotes (see PDPerms).
  • The annotation is of any other subtype and the document's permissions do not include pdPermEdit.

PDPageRemoveCosContents

Header: PDProcs.h:3581

Description

Removes the contents of the specified page.

Related Methods

Syntax

void PDPageRemoveCosContents(PDPage page);

Parameters

page
IN/OUT The page whose Cos contents are removed.

PDPageRemoveCosResource

Header: PDProcs.h:3571

Description

Removes a Cos resource from a page object. See the description of Resource Dictionaries in ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 7.8.3, page 82.

You can find this document on the web store of the International Standards Organization (ISO).

Syntax

void PDPageRemoveCosResource(PDPage page, const char *resType, const char *resName);

Parameters

page
The page whose Cos resources are removed.
resType
The resource type. The named resource types in PDF are: ExtGState, ColorSpace, Pattern, Shading, XObject, Font, ProcSet, and Properties.
resName
The resource name (for example, the name of a font might be F1).

PDPageResumePDEContentChanged

Header: PgCntProcs.h:303

Description

Resumes destruction of PDEContent objects when a PDPageContentsDidChange() notification occurs. Only use this API if you called PDPageSuspendPDEContentChanged().

Syntax

void PDPageResumePDEContentChanged(IN PDPage pdPage);

Parameters

pdPage
IN/OUT The page whose content is changed.

PDPageSetBox

Header: PDProcs.h:7938

Description

Sets the box specified by boxName for the page.

This method may throw exceptions.

Related Methods

Syntax

void PDPageSetBox(PDPage page, ASAtom boxName, ASFixedRect box);

Parameters

page
IN/OUT The page for which the box is to be set.
boxName
    IN/OUT An ASAtom representing the type of box. The box names are:
  • ArtBox
  • BleedBox
  • CropBox
  • TrimBox
  • MediaBox
box
IN/OUT An ASFixedRect specifying the coordinates to set for the box.

PDPageSetCropBox

Header: PDProcs.h:3230

Description

Sets the crop box for a page. The crop box is the region of the page to display and print. This method ignores the request if either the width or height of cropBox is less than 72 points (one inch).

Syntax

void PDPageSetCropBox(PDPage page, ASFixedRect cropBox);

Parameters

page
The page whose crop box is set.
cropBox
A rectangle specifying the page's crop box, specified in user space coordinates.

PDPageSetDuration

Header: PDProcs.h:5902

Description

Sets the page's automatic-advance timing value, which is the maximum amount of time the page is displayed before the viewer automatically advances to the next page.

Related Methods

Syntax

void PDPageSetDuration(PDPage pdp, ASFixed fxDuration);

Parameters

pdp
The page whose timing is set.
fxDuration
The auto-advance timing, in seconds. If no advance timing is desired, fxDuration should be set to fxDefaultPageDuration.

PDPageSetMediaBox

Header: PDProcs.h:3200

Description

Sets the media box for a page. The media box is the natural size of the page, for example, the dimensions of an A4 sheet of paper.

Syntax

void PDPageSetMediaBox(PDPage page, ASFixedRect mediaBox);

Parameters

page
IN/OUT The page whose media box is set.
mediaBox
IN/OUT Rectangle specifying the page's media box, specified in user space coordinates.

PDPageSetPDEContent

Header: PgCntProcs.h:105

Description

Sets the page's PDEContent back into the PDPage object's Cos object, using the same compression filters with which the content was previously encoded.

In order to properly synchronize the page's contents after setting them with PDPageSetPDEContent(), you must call PDPageNotifyContentsDidChange(). If you do not call PDPageNotifyContentsDidChange(), the page displayed will use the old page contents.

Syntax

ASBool PDPageSetPDEContent(IN PDPage pdPage, IN ASExtension self);

Parameters

pdPage
The page whose PDEContent is set.
self
Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.)

Returns

true if PDEContent successfully set, false otherwise.

PDPageSetPDEContentCanRaise

Header: PgCntProcs.h:328

Description

Sets the page's PDEContent back into the PDPage object's Cos object, using the same compression filters with which the content was previously encoded. This method calls PDPageNotifyContentsDidChangeEx().

This method differs from PDPageSetPDEContent() in that it returns no value, but does raise an exception if it is unable to set the content.

Syntax

void PDPageSetPDEContentCanRaise(IN PDPage pdPage, IN ASExtension self);

Parameters

pdPage
The page whose PDEContent is set.
self
Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.)

PDPageSetPDEContentFilters

Header: PgCntProcs.h:276

Description

Sets the filters used by PDPageSetPDEContent(). The filters are not instantiated until PDPageSetPDEContent() is called.

Syntax

ASBool PDPageSetPDEContentFilters(IN PDPage pdPage, IN ASInt32 numFilters, IN ASAtom *filters);

Parameters

pdPage
The page whose content filters are set.
numFilters
The number of filters used by PDPageSetPDEContent().
filters
An array of filters to use by PDPageSetPDEContent().

Returns

true if filters were set, false if the page's contents are not cached (meaning that nothing was done).

PDPageSetPDEContentFlags

Header: PgCntProcs.h:238

Description

Sets flags used by PDPageSetPDEContent(). The flags are not instantiated until PDPageSetPDEContent() is called.

Syntax

ASBool PDPageSetPDEContentFlags(IN PDPage pdPage, IN ASUns32 flags);

Parameters

pdPage
The page whose content flags are set.
flags

Returns

true if flags were set, false if the page's contents are not cached (meaning that nothing was done).

PDPageSetRotate

Header: PDProcs.h:3167

Description

Sets the rotation value for a page.

Related Methods

Syntax

void PDPageSetRotate(PDPage page, PDRotate angle);

Parameters

page
The page whose rotation is set.
angle
Rotation value to be set for a given page. It must be one of the PDRotate values.

PDPageSetTransition

Header: PDProcs.h:5874

Description

Sets the transition for a given page.

Syntax

void PDPageSetTransition(PDPage pdp, PDTrans pdt);

Parameters

pdp
The page whose transition is set.
pdt
The transition for the page.

PDPageSetUserUnitSize

Header: PDProcs.h:11289

Description

Set the UserUnit value for a page.

Syntax

void PDPageSetUserUnitSize(PDPage page, float unitSize);

Parameters

page
The page whose UserUnit value is being set.
unitSize
UserUnit value to be set for the page dictionary. The default value is 1.0.

Exceptions

is raised if unitSize 0.0.

PDPageStmGetInlineImage

Header: PDProcs.h:5740

Description

Reads a PDF page content inline image from a stream. The stream is typically obtained by getting the Cos stream for a page contents or a Form contents, and calling CosStreamOpenStm() to open the stream using the filtered mode. This method is called after a BI token has been read from the stream. BI indicates that the following tokens comprise an inline image dictionary and data.

It begins reading at the current stream position. It returns the number of bytes read. This is the number of bytes read from the stream and indicates the amount by which the stream position has advanced.

The image attributes dictionary is returned in imageDict. The image data is passed to the PDPageStmImageDataProc(); if proc is not provided, the image data is discarded.

imageRawDataStmOffsetP and imageRawDataLenP may be NULL, in which case they are ignored.

The caller should call CosObjDestroy() on imageDict when it is done.

This method can raise memory, I/O, and parsing exceptions.

Syntax

ASUns32 PDPageStmGetInlineImage(ASStm stm, ASUns32 flags, CosDoc cosDoc, CosObj resDict, PDPageStmImageDataProc proc, void *procClientData, ASUns32 *imageRawDataStmOffsetP, ASUns32 *imageRawDataLenP, CosObj *imageDict);

Parameters

stm
The stream from which data is read.
cosDoc
The CosDoc with the PDPage that contains the inline image.
resDict
The Resources dictionary in which to look up ColorSpace resources for inline images.
flags
Currently unused by this method (used by PDPageStmGetToken().)
proc
A callback method to handle inline image data.
procClientData
Client data passed to proc.
imageRawDataStmOffsetP
(Filled by the method) The offset of the data stream, after BI, relative to the beginning of stm.
imageRawDataLenP
(Filled by the method) The offset of the last byte of the data stream between the BI and EI PDF operators.
imageDict
(Filled by the method) The returned image dictionary.

Returns

The number of bytes read from stm.

PDPageStmGetToken

Header: PDProcs.h:5688

Description

Reads a PDF page content token from a stream. The stream is typically obtained by getting the Cos stream for a page contents or a Form contents, and calling CosStreamOpenStm() to open the stream using the filtered mode.

It begins reading at the current stream position, and reads exactly one token. It returns the number of bytes read. This is the number of bytes read from the stream and indicates the amount by which the stream position has advanced. The end-of-stream criteria (loop terminating condition) is the following:

  • A NULL object is returned (an object of type CosNull).
  • The number of bytes read (return value) is 1.

If the token is an integer, real (ASFixed), or ASBool, then the value is returned in pageStmToken.iVal. If the token is a string or a name, the value is returned in pageStmToken.sVal, and the length of the token is in pageStmToken.sValLen. Strings are not NULL-terminated, but names are NULL-terminated. If a string length is greater than kPDPageStmStringMax, the PDPageStmStringOverflowProc() is called repeatedly with portions of the string. On return from PDPageStmGetToken, the value of pageStmToken.sValLen is zero, and pageStmToken.sVal is empty ( ival, sVal, and sValLen are components of the PDPageStmToken). If there is no overflow proc, then the first kPDPageStmStringMax bytes of the string will be returned in pageStmToken.sVal, and the remaining bytes are lost. The value of pageStmToken.sValLen is kPDPageStmStringMax in this case.

If the token is BI (begin inline image), PDPageStmGetInlineImage() should be called to parse the inline image.

This method can raise memory, I/O, and parsing exceptions.

Syntax

ASUns32 PDPageStmGetToken(ASStm stm, ASUns32 flags, PDPageStmStringOverflowProc proc, void *procClientData, PDPageStmToken pageStmToken);

Parameters

stm
The stream from which data is read.
flags
A bit field of options such as 'skip comments' (kPDPageStmSkipComments means skip comments during token generation).
proc
A callback method to handle long strings.
procClientData
Client data passed to the callback method.
pageStmToken
The returned token.

Returns

The number of bytes read from stm.

PDPageSuspendPDEContentChanged

Header: PgCntProcs.h:292

Description

Suspends destruction of PDEContent objects when a PagePDEContentDidChange() notification occurs. Only use this API if you are about to call PDPageNotifyContentsDidChange() and you do not want PDFEdit to destroy all PDEContent objects associated with that PDPage. This is used, for example, when AVAppSetPreference() is called. Make sure to call PDPageSuspendPDEContentChanged() on the PDPage object after you call PDPageNotifyContentsDidChange().

Syntax

void PDPageSuspendPDEContentChanged(IN PDPage pdPage);

Parameters

pdPage
IN/OUT The page whose content is changed.

PDPageUnRegisterForPDEContentChanged

Header: PgCntProcs.h:160

Description

Un-registers for the PagePDEContentDidChange() notification.

Syntax

void PDPageUnRegisterForPDEContentChanged(IN PagePDEContentDidChangeNPROTO proc, IN ASExtension self);

Parameters

proc
A callback for the function to call when an acquired PDPage object's PDEContent has changed.
self
Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.)

PDPageUnRegisterForPDEContentNotCached

Header: PgCntProcs.h:205

Description

Un-registers for the PagePDEContentNotCached() notification.

Syntax

void PDPageUnRegisterForPDEContentNotCached(IN PagePDEContentNotCachedNPROTO proc, IN ASExtension self);

Parameters

proc
IN/OUT A callback for the function to call when an acquired PDPage object's PDEContent is no longer valid.
self
IN/OUT Identifies the caller/client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, clientID should be zero. If there are multiple clients, each should specify a nonzero, non-negative clientID. (A negative clientID is reserved for the implementation.)