PDFix SDK  7.2.0
Loading...
Searching...
No Matches
PdePageMap Struct Referenceabstract

PdePageMap class. More...

#include <pdfix.h>

Public Member Functions

virtual int Release ()=0
 
virtual PdeElementGetElement ()=0
 
virtual bool GetWhitespace (PdfWhitespaceParams *params, int index, PdfCancelProc cancel_proc, void *cancel_data, PdfRect *bbox)=0
 Searches for whitespaces at the page. They are sorted from biggest to smallest. More...
 
virtual void GetBBox (PdfRect *bbox) const =0
 
virtual bool HasElements ()=0
 Checks whether the elements are already created. More...
 
virtual bool CreateElements (PdfCancelProc cancel_proc, void *cancel_data)=0
 
virtual bool RemoveElements ()=0
 Clear a PdePageMap from the PdfPage's elements. More...
 
virtual PdeElementCreateElement (PdfElementType type, PdeElement *parent)=0
 Creates an empty element of specific type. More...
 
virtual bool AddTags (PdsStructElement *element, bool sibling, const PdfTagsParams *tag_params, PdfCancelProc cancel_proc, void *cancel_data)=0
 Adds tags. More...
 
virtual PdfPageGetPage ()=0
 Return the page object of a page map. More...
 
virtual int GetNumArtifacts () const =0
 Return the number of artifacts elements on a page. More...
 
virtual PdeElementGetArtifact (int index)=0
 Return the artifact element by index. More...
 

Detailed Description

PdePageMap class.

The PdePageMap object is a storage of all PdeElements whose were recognized on the page. A PdePageMap may be obtained from an existing page with the PdfPage::AcquirePageMap method. Once your application has the page's PdePageMap, it can get each logical element with GetElement method.

Member Function Documentation

◆ AddTags()

virtual bool PdePageMap::AddTags ( PdsStructElement element,
bool  sibling,
const PdfTagsParams tag_params,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Adds tags.

Parameters
elementThe reference structure element can be either parent or sibling of the new element
siblingAdd tags as a new sibling of the element when true or add tag as the last child when false.
tag_paramsPdfTagsParams structure definiing the tagattributes or null to use default settings;
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if tags were added successfuly, false otherwise.

◆ CreateElement()

virtual PdeElement * PdePageMap::CreateElement ( PdfElementType  type,
PdeElement parent 
)
pure virtual

Creates an empty element of specific type.

Parameters
paramsParameters of the newly created element.
Returns
true Pointer to the newly created PDEElement.

◆ CreateElements()

virtual bool PdePageMap::CreateElements ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Recreates a PdePageMap from the PdfPage's elements. NOTE: Can't be called when elements are already created. To recreate elements, call RemoveElements before CreateElements.

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if pagemap was generated successfuly, false otherwise.
See also
PdePageMap::HasElements
PdePageMap::RemoveElements

◆ GetArtifact()

virtual PdeElement * PdePageMap::GetArtifact ( int  index)
pure virtual

Return the artifact element by index.

Parameters
indexartifact element index
Returns
the artifact element

◆ GetBBox()

virtual void PdePageMap::GetBBox ( PdfRect bbox) const
pure virtual

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

Parameters
bbox(Filled by the method) A PdfRect specifying the page's box.
See also
PdePageMap::GetWhitespace

◆ GetElement()

virtual PdeElement * PdePageMap::GetElement ( )
pure virtual

Gets the requested element from a pagemap. You should never depend on these objects lasting the lifetime of the pagemap. You should extract the information you need from he object immediately and refer to it no further in your code. NOTE: This method does not copy the element, so do not destroy it.

Parameters
indexIndex of element to obtain.
Returns
The requested element.
See also
PdePageMap::GetNumElements

◆ GetNumArtifacts()

virtual int PdePageMap::GetNumArtifacts ( ) const
pure virtual

Return the number of artifacts elements on a page.

Returns
the number of artifacts.

◆ GetPage()

virtual PdfPage * PdePageMap::GetPage ( )
pure virtual

Return the page object of a page map.

Returns
the page object.

◆ GetWhitespace()

virtual bool PdePageMap::GetWhitespace ( PdfWhitespaceParams params,
int  index,
PdfCancelProc  cancel_proc,
void *  cancel_data,
PdfRect bbox 
)
pure virtual

Searches for whitespaces at the page. They are sorted from biggest to smallest.

Parameters
paramsWhitespace parameters that specify which whitespace should be obtained.
indexIndex of whitespace to obtain. Set to zero for the first call. Update the index with each consecutive call of the method while result is true.
bbox(Filled by the method) A PdfRect specifying requested whitespace.
Returns
This method returns true if whitespace with requested params exists, otherwise it returns false.
Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure. Sample GetWhitespace

◆ HasElements()

virtual bool PdePageMap::HasElements ( )
pure virtual

Checks whether the elements are already created.

Returns
true if elements are created, false otherwise.

◆ Release()

virtual int PdePageMap::Release ( )
pure virtual

Releases the pagemap resources at the current page. NOTE: The caller can call PdePageMap::Release to optimize a memory handling. Otherwise the page is responsible for freeing PdePageMap resources.

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

◆ RemoveElements()

virtual bool PdePageMap::RemoveElements ( )
pure virtual

Clear a PdePageMap from the PdfPage's elements.

Returns
true if pagemap was cleared successfuly, false otherwise.
See also
PdePageMap::CreateElements