PdePageMap class.
More...
#include <pdfix.h>
|
virtual int | Release ()=0 |
|
virtual PdeElement * | GetElement ()=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 PdeElement * | CreateElement (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 PdfPage * | GetPage ()=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 PdeElement * | GetArtifact (int index)=0 |
| Return the artifact element by index. More...
|
|
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.
◆ AddTags()
Adds tags.
- Parameters
-
element | The reference structure element can be either parent or sibling of the new element |
sibling | Add tags as a new sibling of the element when true or add tag as the last child when false. |
tag_params | PdfTagsParams structure definiing the tagattributes or null to use default settings; |
cancel_proc | Callback to check for canceling operations. |
cancel_data | Pointer to client data for the cancel procedure. |
- Returns
- true if tags were added successfuly, false otherwise.
◆ CreateElement()
Creates an empty element of specific type.
- Parameters
-
params | Parameters 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_proc | Callback to check for canceling operations. |
cancel_data | Pointer 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
-
index | artifact 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()
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
-
index | Index 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()
Searches for whitespaces at the page. They are sorted from biggest to smallest.
- Parameters
-
params | Whitespace parameters that specify which whitespace should be obtained. |
index | Index 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_proc | Callback to check for canceling operations. |
cancel_data | Pointer 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 |