PDFix SDK  6.19.0
Loading...
Searching...
No Matches
PdfPage Struct Referenceabstract

PdfPage class. More...

#include <pdfix.h>

Public Member Functions

virtual int Release ()=0
 
virtual int GetRefNum ()=0
 Returns the current number of references to the page object. More...
 
virtual void GetCropBox (PdfRect *crop_box) const =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) const =0
 
virtual PdfRotate GetRotate () const =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) const =0
 
virtual int GetNumber () const =0
 Gets the page number for the specified page. More...
 
virtual PdePageMapAcquirePageMap ()=0
 
virtual PdfPageViewAcquirePageView (float zoom, PdfRotate rotate)=0
 
virtual int GetNumAnnots () const =0
 
virtual PdfAnnotGetAnnot (int index)=0
 Acquires 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 int GetNumAnnotsAtPoint (const PdfPoint *point) const =0
 Gets the number of annotations that reside under the given point. More...
 
virtual PdfAnnotGetAnnotAtPoint (const PdfPoint *point, int index)=0
 Gets the requested annotation that resides under the given point. More...
 
virtual int GetNumAnnotsAtRect (const PdfRect *rect) const =0
 
virtual PdfAnnotGetAnnotAtRect (const 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 bool CloneFormXObjects ()=0
 Clone orm XObjects on the page so that each XObject is referenced only once. More...
 
virtual bool FlattenAnnot (PdfAnnot *annot)=0
 
virtual PdfPageContentFlags GetContentFlags ()=0
 Checks for various content objects in the page content. More...
 
virtual bool SetContent ()=0
 Write all pending page content modifications to the content stream. More...
 
virtual PdfDocGetDoc ()=0
 Gets a reference to a document object. More...
 
virtual PdeWordListAcquireWordList (PdfWordFinderAlgorithm alg)=0
 
virtual PdfPageFlags GetFlags ()=0
 Get the page flags. More...
 
virtual bool ClearFlags ()=0
 Clears the page flags. More...
 
virtual PdsFormCreateFormFromObject (PdsStream *stream)=0
 Create the PdsForm object from an existing PdsStream object (XObject) on a page. 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 ( )
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. NOTE: Acquisition of the page map increments page's reference count.

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

◆ AcquirePageView()

virtual PdfPageView * PdfPage::AcquirePageView ( float  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. NOTE: Acquisition of the page view increments page's reference count.

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

◆ AcquireWordList()

virtual PdeWordList * PdfPage::AcquireWordList ( PdfWordFinderAlgorithm  alg)
pure virtual

Acquire all words on page. NOTE: Acquisition of the word list increments document's reference count.

Parameters
algpass kWordFinderAlgLatest to use the lastest algorithm
Returns
List of words on the page
See also
PdeWordList::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.

◆ ClearFlags()

virtual bool PdfPage::ClearFlags ( )
pure virtual

Clears the page flags.

Returns
true if the flags was cleared successfuly

◆ CloneFormXObjects()

virtual bool PdfPage::CloneFormXObjects ( )
pure virtual

Clone orm XObjects on the page so that each XObject is referenced only once.

Returns
True if operation was successfull. False otherwise.
See also
PdfPage::SetContent

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

◆ CreateFormFromObject()

virtual PdsForm * PdfPage::CreateFormFromObject ( PdsStream stream)
pure virtual

Create the PdsForm object from an existing PdsStream object (XObject) on a page.

Parameters
streamAn XObject PdsStream from which the form will be obtained.
Returns
PdsForm.

◆ 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

◆ FlattenAnnot()

virtual bool PdfPage::FlattenAnnot ( PdfAnnot annot)
pure virtual

Flatten annotation appearance to the page The user must call PdfPage::SetContent to write changes to the page content

Parameters
annotThe annotation to flatten.
Returns
True if operation was successfull. False otherwise.
See also
PdfPage::SetContent

◆ 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.
See also
PdfPage::SetContent

◆ GetAnnot()

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

Acquires the requested annotation on the page.

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

◆ GetAnnotAtPoint()

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

Gets the requested annotation that resides under the given point.

Parameters
pointThe point to test.
indexIndex of annotation to obtain.
Returns
Pointer to the requested annotation object, nullptr in a case of error.
See also
PdfPage::GetAnnotAtRect

◆ GetAnnotAtRect()

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

Gets the requested annotation that resides under the given rectangle.

Parameters
rectThe rectangle to test.
indexIndex of annotation to obtain.
Returns
Pointer to the requested annotation, nullptr in a case of error.
See also
PdfPage::GetAnnotAtPoint

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

◆ GetFlags()

virtual PdfPageFlags PdfPage::GetFlags ( )
pure virtual

Get the page flags.

Returns
Flags field, containing an OR of the PdfPageFlags values

◆ 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) const
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 ( ) const
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::GetAnnotObj

◆ GetNumAnnotsAtPoint()

virtual int PdfPage::GetNumAnnotsAtPoint ( const PdfPoint point) const
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 ( const PdfRect rect) const
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::GetAnnotAtRect

◆ GetNumber()

virtual int PdfPage::GetNumber ( ) const
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.

◆ GetRefNum()

virtual int PdfPage::GetRefNum ( )
pure virtual

Returns the current number of references to the page object.

Returns
the number of remaining references to the object
See also
PdfPage::AcquirePage

◆ 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 ( ) const
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 int 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.

Returns
the number of remaining references to the object
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 all pending page content modifications 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.