PDFix SDK  5.0.27
PdfPage Struct Referenceabstract

PdfPage class. More...

Public Member Functions

virtual void Release ()=0
 
virtual void GetCropBox (_out_ 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 (_out_ PdfRect *media_box)=0
 
virtual PdfRotate GetRotate ()=0
 Gets 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 (_out_ PdfMatrix *matrix)=0
 
virtual int GetNumber ()=0
 Gets the page number for the specified page. More...
 
virtual PdePageMapCreatePageMap ()=0
 
virtual PdePageMapAcquirePageMap (_callback_ 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 PdfTextAnnotAddTextAnnot (int index, PdfRect *rect)=0
 Adds a text annotation to the page. More...
 
virtual PdfLinkAnnotAddLinkAnnot (int index, PdfRect *rect)=0
 Adds a link annotation to the page. More...
 
virtual PdfTextMarkupAnnotAddTextMarkupAnnot (int index, PdfRect *rect, PdfAnnotSubtype subtype)=0
 Adds a text markup annotation to the page. 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, _callback_ PdfCancelProc cancel_proc, void *cancel_data)=0
 
virtual int GetNumPageObjects ()=0
 Gets the number of page objects. More...
 
virtual PdsPageObjectGetPageObject (int index)=0
 
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 ( _callback_ 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. A CancelProc is typically passed to some method that takes a long time to complete. At frequent intervals, the method calls the CancelProc. If it returns true, then the method cancels its operation; if false, it continues.
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

◆ AddLinkAnnot()

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

Adds a 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::AddTextAnnot, PdfLinkAnnot::AddQuad

◆ AddTextAnnot()

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

Adds a 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

◆ AddTextMarkupAnnot()

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

Adds a 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::AddTextAnnot, PdfTextMarkupAnnot::AddQuad

◆ 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

◆ DrawContent()

virtual bool PdfPage::DrawContent ( PdfPageRenderParams params,
_callback_ 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. A CancelProc is typically passed to some method that takes a long time to complete. At frequent intervals, the method calls the CancelProc. If it returns true, then the method cancels its operation; if false, it continues.
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

◆ 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 ( _out_ 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 ( _out_ 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 ( _out_ 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.

◆ GetNumPageObjects()

virtual int PdfPage::GetNumPageObjects ( )
pure virtual

Gets the number of page objects.

Returns
Number of page objects in the page content.

◆ GetObject()

virtual PdsDictionary* PdfPage::GetObject ( )
pure virtual

Gets the dictionary object associated with the page.

Returns
The requested page object.

◆ GetPageObject()

virtual PdsPageObject* PdfPage::GetPageObject ( int  index)
pure virtual

Gets the requested page object from a page content. NOTE: This method does not copy the page object.


Parameters
indexIndex of page object to obtain.
Returns
The requested page objects.

◆ 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.