PDFix SDK  6.5.0
PdfPage Struct Referenceabstract

PdfPage class. More...

Public Member Functions

virtual void Release ()=0
 
virtual void GetCropBox (PdfRect *crop_box)=0
 Gets the crop box for a page. The crop box is the region of the page to display and print. More...
 
virtual void GetMediaBox (PdfRect *media_box)=0
 
virtual PdfRotate GetRotate ()=0
 Gets the rotation value for a page. More...
 
virtual bool SetRotate (PdfRotate rotate)=0
 Sets the rotation value for a page. More...
 
virtual PdfRotate GetLogicalRotate ()=0
 Gets the rotation value of elements(texts) on a page. More...
 
virtual void GetDefaultMatrix (PdfMatrix *matrix)=0
 
virtual int GetNumber ()=0
 Gets the page number for the specified page. More...
 
virtual PdePageMapCreatePageMap ()=0
 
virtual PdePageMapAcquirePageMap (PdfCancelProc cancel_proc, void *cancel_data)=0
 
virtual PdfPageViewAcquirePageView (double zoom, PdfRotate rotate)=0
 
virtual int GetNumAnnots ()=0
 
virtual PdfAnnotGetAnnot (int index)=0
 Gets the requested annotation on the page. More...
 
virtual bool RemoveAnnot (int index, PdfRemoveAnnotFlags flags)=0
 
virtual bool AddAnnot (int index, PdfAnnot *annot)=0
 Add an annotation to the page at specified position. More...
 
virtual PdfAnnotCreateAnnot (PdfAnnotSubtype subtype, PdfRect *rect)=0
 
virtual PdfTextAnnotCreateTextAnnot (PdfRect *rect)=0
 
virtual PdfTextMarkupAnnotCreateTextMarkupAnnot (PdfAnnotSubtype subtype, PdfRect *rect)=0
 
virtual PdfTextAnnotAddNewTextAnnot (int index, PdfRect *rect)=0
 Create and add new text annotation to the page. More...
 
virtual PdfLinkAnnotAddNewLinkAnnot (int index, PdfRect *rect)=0
 Create and add new link annotation to the page. More...
 
virtual PdfTextMarkupAnnotAddNewTextMarkupAnnot (int index, PdfRect *rect, PdfAnnotSubtype subtype)=0
 Create and add new text markup annotation to the page. More...
 
virtual PdfAnnotAddNewAnnot (int index, PdfRect *rect, PdfAnnotSubtype subtype)=0
 Create and add new annotation to the page at specified position. More...
 
virtual int GetNumAnnotsAtPoint (PdfPoint *point)=0
 Gets the number of annotations that reside under the given point. More...
 
virtual PdfAnnotGetAnnotAtPoint (PdfPoint *point, int index)=0
 Gets the requested annotation that resides under the given point. More...
 
virtual int GetNumAnnotsAtRect (PdfRect *rect)=0
 
virtual PdfAnnotGetAnnotAtRect (PdfRect *rect, int index)=0
 Gets the requested annotation that resides under the given rectangle. More...
 
virtual bool DrawContent (PdfPageRenderParams *params, PdfCancelProc cancel_proc, void *cancel_data)=0
 
virtual PdsContentGetContent ()=0
 Gets a PdsContent from the PdfPage object's contents and resources. More...
 
virtual PdsDictionaryGetResources (const wchar_t *res_type, bool create)=0
 
virtual PdsDictionaryGetObject ()=0
 Gets the dictionary object associated with the page. More...
 
virtual bool FlattenFormXObjects ()=0
 Flatten all Form XObjects on the page into main page content. More...
 
virtual PdfPageContentFlags GetContentFlags ()=0
 Checks for various content objects in the page content. More...
 
virtual bool SetContent ()=0
 Write modified page content to the content stream. More...
 
virtual PdfDocGetDoc ()=0
 Gets a reference to a document object. More...
 

Detailed Description

PdfPage class.

A PdfPage is a page in a document. Among other associated objects, a page contains PdePageMap, that represents the page content.

Member Function Documentation

◆ AcquirePageMap()

virtual PdePageMap* PdfPage::AcquirePageMap ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Generates a PdePageMap from the PdfPage's elements. The PdePageMap is cached, so that subsequent calls on the same PDPage return the same PdePageMap and increments the reference count. The PdePageMap remains in the cache as long as page exists or PdePageMap::Release was not called. Call PdePageMap::Release to release pagemap resources if necessary.

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
PdePageMap for the current page.
See also
PdePageMap::Release

◆ AcquirePageView()

virtual PdfPageView* PdfPage::AcquirePageView ( double  zoom,
PdfRotate  rotate 
)
pure virtual

Generates a PdfPageView from the PdfPage's elements. The PdfPageView is cached, so that subsequent calls on the same PDPage and same input parameters return the same PdfPageView and increments the reference count. The PdePageMap remains in the cache as long as page exists or PdfPageView::Release was not called. Call PdfPageView::Release to release pagemap resources if necessary.

Parameters
zoomExpected zoom of the page view.
rotateExpected rotation of the page view.
Returns
An acquired page view or null.
See also
PdfPageView::Release

◆ AddAnnot()

virtual bool PdfPage::AddAnnot ( int  index,
PdfAnnot annot 
)
pure virtual

Add an annotation to the page at specified position.

Parameters
indexWhere to add the annotation in the page's annotation array.
annotThe annotation to add.
Returns
true if annotation was added, false otherwise.

◆ AddNewAnnot()

virtual PdfAnnot* PdfPage::AddNewAnnot ( int  index,
PdfRect rect,
PdfAnnotSubtype  subtype 
)
pure virtual

Create and add new annotation to the page at specified position.

Parameters
indexWhere to add the annotation in the page's annotation array.
rectPointer to a rectangle specifying the annotation's bounds, specified in user space coordinates. If it's null, use PdfTextMarkupAnnot::AddQuad to specify the size and location of an annotation on its page.
Returns
The newly created PdfAnnot.

◆ AddNewLinkAnnot()

virtual PdfLinkAnnot* PdfPage::AddNewLinkAnnot ( int  index,
PdfRect rect 
)
pure virtual

Create and add new link annotation to the page.

Parameters
indexWhere to add the annotation in the page's annotation array.
rectPointer to a rectangle specifying the annotation's bounds, specified in user space coordinates. If it's null, use PdfLinkAnnot::AddQuad to specify the size and location of an annotation on its page.
Returns
The newly created PdfLinkAnnot.
See also
PdfPage::AddNewTextAnnot, PdfLinkAnnot::AddQuad

◆ AddNewTextAnnot()

virtual PdfTextAnnot* PdfPage::AddNewTextAnnot ( int  index,
PdfRect rect 
)
pure virtual

Create and add new text annotation to the page.

Parameters
indexWhere to add the annotation in the page's annotation array. Passing a value of -1 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 0 adds the annotation to the beginning of the array.
rectPointer to a rectangle specifying the annotation's bounds, specified in user space coordinates.
Returns
The newly created PdfTextAnnot.
See also
PdfPage::GetNumAnnots Sample AddComment

◆ AddNewTextMarkupAnnot()

virtual PdfTextMarkupAnnot* PdfPage::AddNewTextMarkupAnnot ( int  index,
PdfRect rect,
PdfAnnotSubtype  subtype 
)
pure virtual

Create and add new text markup annotation to the page.

Parameters
subtypeDefine a subtype of the text markup annotation. Must be one of kAnnotHighlight, kAnnotUnderline, kAnnotSquiggly, kAnnotStrikeOut.
indexWhere to add the annotation in the page's annotation array.
rectPointer to a rectangle specifying the annotation's bounds, specified in user space coordinates. If it's null, use PdfTextMarkupAnnot::AddQuad to specify the size and location of an annotation on its page.
Returns
The newly created PdfTextMarkupAnnot.
See also
PdfPage::AddNewTextAnnot, PdfTextMarkupAnnot::AddQuad

◆ CreateAnnot()

virtual PdfAnnot* PdfPage::CreateAnnot ( PdfAnnotSubtype  subtype,
PdfRect rect 
)
pure virtual

Creates a new annotation, associated with the specified page, but not added to the page. Use AddAnnot() to add the annotation to the page.

Parameters
subtypeDefine a subtype of the annotation.
rectPointer to a rectangle specifying the annotation's bounds, specified in user space coordinates.
Returns
The newly created annotation..

◆ CreatePageMap()

virtual PdePageMap* PdfPage::CreatePageMap ( )
pure virtual

Creates a PdePageMap from the PdfPage's elements.and increments the reference count. Call PdePageMap::AcquireElements to parse page objects. The PdePageMap remains in the cache as long as page exists or PdePageMap::Release was not called. Call PdePageMap::Release to release pagemap resources if necessary.

Returns
PdePageMap for the current page.
See also
PdePageMap::Release, PdePageMap::AcquireElements

◆ CreateTextAnnot()

virtual PdfTextAnnot* PdfPage::CreateTextAnnot ( PdfRect rect)
pure virtual

Creates a new text annotation, associated with the specified page, but not added to the page. Use AddAnnot() to add the annotation to the page.

Parameters
subtypeDefine a subtype of the annotation.
rectPointer to a rectangle specifying the annotation's bounds, specified in user space coordinates.
Returns
The newly created annotation..

◆ CreateTextMarkupAnnot()

virtual PdfTextMarkupAnnot* PdfPage::CreateTextMarkupAnnot ( PdfAnnotSubtype  subtype,
PdfRect rect 
)
pure virtual

Creates a new textmarkup annotation, associated with the specified page, but not added to the page. Use AddAnnot() to add the annotation to the page.

Parameters
subtypeDefine a subtype of the annotation.
rectPointer to a rectangle specifying the annotation's bounds, specified in user space coordinates.
Returns
The newly created annotation..

◆ DrawContent()

virtual bool PdfPage::DrawContent ( PdfPageRenderParams params,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Draws the contents of a page into the page view PsImage. This method just draws a bitmap. Provides control over the rendering with respect to PdfPageRenderParams. The PsImage remains in the cache as the page view class exists or next PdfPageViewDrawPage method is called.

Parameters
paramsRendering parameters.
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if page was rendered, false otherwise.
See also
PdfPageView::GetImage Sample RenderPage

◆ FlattenFormXObjects()

virtual bool PdfPage::FlattenFormXObjects ( )
pure virtual

Flatten all Form XObjects on the page into main page content.

Returns
True if operation was successfull. False otherwise.

◆ GetAnnot()

virtual PdfAnnot* PdfPage::GetAnnot ( int  index)
pure virtual

Gets the requested annotation on the page.

Parameters
indexThe index of annotation to obtain.
Returns
Requested annotation object.
See also
PdfPage::GetNumAnnots

◆ GetAnnotAtPoint()

virtual PdfAnnot* PdfPage::GetAnnotAtPoint ( PdfPoint point,
int  index 
)
pure virtual

Gets the requested annotation that resides under the given point.

Parameters
pointThe point to test.
index(Filled by the method) Index of annotation to obtain.
Returns
Pointer to the requested annotation, nullptr in a case of error.
See also
PdfPage::GetAnnotAtRect

◆ GetAnnotAtRect()

virtual PdfAnnot* PdfPage::GetAnnotAtRect ( PdfRect rect,
int  index 
)
pure virtual

Gets the requested annotation that resides under the given rectangle.

Parameters
rectThe rectangle to test.
index(Filled by the method) Index of annotation to obtain.
Returns
Pointer to the requested annotation, nullptr in a case of error.
See also
PdfPage::GetAnnotAtRect

◆ GetContent()

virtual PdsContent* PdfPage::GetContent ( )
pure virtual

Gets a PdsContent from the PdfPage object's contents and resources.

Returns
A PdsContent representing the page's contents.

◆ GetContentFlags()

virtual PdfPageContentFlags PdfPage::GetContentFlags ( )
pure virtual

Checks for various content objects in the page content.

Returns
A combination of the page content flags

◆ GetCropBox()

virtual void PdfPage::GetCropBox ( PdfRect crop_box)
pure virtual

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

Parameters
crop_box(Filled by the method) Pointer to a rectangle specifying the page's crop box, specified in user space coordinates.

◆ GetDefaultMatrix()

virtual void PdfPage::GetDefaultMatrix ( PdfMatrix matrix)
pure virtual

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.

Parameters
matrix(Filled by the method) Pointer to the default transformation matrix.

◆ GetDoc()

virtual PdfDoc* PdfPage::GetDoc ( )
pure virtual

Gets a reference to a document object.

Returns
PdfDoc object.

◆ GetLogicalRotate()

virtual PdfRotate PdfPage::GetLogicalRotate ( )
pure virtual

Gets the rotation value of elements(texts) on a page.

Returns
Rotation value of elements on the page. Must be one of the PdfRotate values.
See also
PdfRotate

◆ GetMediaBox()

virtual void PdfPage::GetMediaBox ( PdfRect media_box)
pure virtual

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.

Parameters
media_box(Filled by the method) Pointer to a rectangle specifying the page's media box, specified in user space coordinates.

◆ GetNumAnnots()

virtual int PdfPage::GetNumAnnots ( )
pure virtual

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.

Returns
The number of annotations on a page.
See also
PdfPage::GetAnnot

◆ GetNumAnnotsAtPoint()

virtual int PdfPage::GetNumAnnotsAtPoint ( PdfPoint point)
pure virtual

Gets the number of annotations that reside under the given point.

Parameters
pointThe point to test.
Returns
Number of annotations under the given point.
See also
PdfPage::GetAnnotAtPoint

◆ GetNumAnnotsAtRect()

virtual int PdfPage::GetNumAnnotsAtRect ( PdfRect rect)
pure virtual

Gets the number of annotations that reside under the given rectangle. It returns each annotation that have intersection the given rectangle.

Parameters
rectThe rectangle to test.
Returns
Number of annotations under the given rectangle.
See also
PdfPage::GetAnnotAtPoint

◆ GetNumber()

virtual int PdfPage::GetNumber ( )
pure virtual

Gets the page number for the specified page.

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

◆ GetObject()

virtual PdsDictionary* PdfPage::GetObject ( )
pure virtual

Gets the dictionary object associated with the page.

Returns
The requested page object.

◆ GetResources()

virtual PdsDictionary* PdfPage::GetResources ( const wchar_t *  res_type,
bool  create 
)
pure virtual

Gets the page resources dictionary. It can be either directly in the page object or it may be in the page tree stared with multiple pages.

Parameters
res_typeName of the resource type (ExtGState, ColorSpace, Pattern, Shading, XObject, Font, and Properties).
createThe page resources objects is created if does not exists.
Returns
The requested page resources objects.

◆ GetRotate()

virtual PdfRotate PdfPage::GetRotate ( )
pure virtual

Gets the rotation value for a page.

Returns
Rotation value for the given page. Must be one of the PdfRotate values.
See also
PdfRotate

◆ Release()

virtual void PdfPage::Release ( )
pure virtual

Releases page's resources. Decrements a page�s reference count. The document will not be released until the reference count is zero, or the application terminates.

Parameters
pageThe page to release.
See also
PdfPage::AcquirePage

◆ RemoveAnnot()

virtual bool PdfPage::RemoveAnnot ( int  index,
PdfRemoveAnnotFlags  flags 
)
pure virtual

Removes an annotation from the specified page. Annotations are stored in arrays, which are automatically compressed when an annotation is removed. 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.

Parameters
indexThe index of annotation to remove.
flagsPdfRemoveAnnotFlags to specify what other connected annotations will be removed.
Returns
true if annotation was removed, false otherwise.
See also
PdfPage::GetNumAnnots Sample RemoveComments

◆ SetContent()

virtual bool PdfPage::SetContent ( )
pure virtual

Write modified page content to the content stream.

Returns
True if operation was successfull. False otherwise.

◆ SetRotate()

virtual bool PdfPage::SetRotate ( PdfRotate  rotate)
pure virtual

Sets the rotation value for a page.

Parameters
rotateRotation value to be set for a given page. It must be one of the PdfRotate values.
Returns
true if succeeded, false otherwise.