#include <PdfPagesTree.h>
Class for managing the tree of Pages in a PDF document Don't use this class directly. Use PdfDocument instead.
- See also
- PdfDocument
◆ PdfPagesTree() [1/2]
◆ PdfPagesTree() [2/2]
PoDoFo::PdfPagesTree::PdfPagesTree |
( |
PdfObject * |
pPagesRoot | ) |
|
Construct a PdfPagesTree from the root /Pages object
- Parameters
-
pPagesRoot | pointer to page tree dictionary |
◆ ~PdfPagesTree()
PoDoFo::PdfPagesTree::~PdfPagesTree |
( |
| ) |
|
|
virtual |
◆ ClearCache()
void PoDoFo::PdfPagesTree::ClearCache |
( |
| ) |
|
|
inline |
Clear internal cache of PdfPage objects. All references to PdfPage object will become invalid when calling this method. All PdfPages will be deleted.
You normally will never have to call this method. It is only useful if one modified the page nodes of the pagestree manually.
◆ CreatePage()
Creates a new page object and inserts it into the internal page tree. The returned page is owned by the pages tree and will get deleted along with it!
- Parameters
-
rSize | a PdfRect specifying the size of the page (i.e the /MediaBox key) in PDF units |
- Returns
- a pointer to a PdfPage object
◆ CreatePages()
void PoDoFo::PdfPagesTree::CreatePages |
( |
const std::vector< PdfRect > & |
vecSizes | ) |
|
Creates several new page objects and inserts them into the internal page tree. The new pages are owned by the pages tree and will get deleted along with it! Note: this function will attach all new pages onto the same page node which can cause the tree to be unbalanced if
- Parameters
-
vecSizes | a vector of PdfRect specifying the size of each of the pages to create (i.e the /MediaBox key) in PDF units |
◆ DeletePage()
void PoDoFo::PdfPagesTree::DeletePage |
( |
int |
inPageNumber | ) |
|
Delete the specified page object from the internal pages tree. It does NOT remove any PdfObjects from memory - just the reference from the tree
- Parameters
-
inPageNumber | the page number (0-based) to be removed |
The PdfPage object refering to this page will be deleted by this call! Empty page nodes will also be deleted.
- See also
- PdfMemDocument::DeletePages
◆ GetPage() [1/2]
Return a PdfPage for the specified Page reference. The returned page is owned by the pages tree and deleted along with it.
- Parameters
-
ref | the reference of the pages object |
- Returns
- a pointer to the requested page
◆ GetPage() [2/2]
PdfPage * PoDoFo::PdfPagesTree::GetPage |
( |
int |
nIndex | ) |
|
Return a PdfPage for the specified Page index The returned page is owned by the pages tree and deleted along with it.
- Parameters
-
nIndex | page index, 0-based |
- Returns
- a pointer to the requested page
◆ GetTotalNumberOfPages()
int PoDoFo::PdfPagesTree::GetTotalNumberOfPages |
( |
| ) |
const |
Return the number of pages in the entire tree
- Returns
- number of pages
◆ InsertPage() [1/3]
PdfPage * PoDoFo::PdfPagesTree::InsertPage |
( |
const PdfRect & |
rSize, |
|
|
int |
atIndex |
|
) |
| |
Creates a new page object and inserts it at index atIndex. The returned page is owned by the pages tree and will get deleted along with it!
- Parameters
-
rSize | a PdfRect specifying the size of the page (i.e the /MediaBox key) in PDF units |
atIndex | index where to insert the new page (0-based) |
- Returns
- a pointer to a PdfPage object
◆ InsertPage() [2/3]
void PoDoFo::PdfPagesTree::InsertPage |
( |
int |
nAfterPageIndex, |
|
|
PdfObject * |
pPage |
|
) |
| |
Inserts an existing page object into the internal page tree. after the specified page number
- Parameters
-
nAfterPageIndex | an integer specifying after what page
- may be one of the special values from EPdfPageInsertionPoint. Pages are 0 based.
|
pPage | musst be a PdfObject with type /Page |
◆ InsertPage() [3/3]
void PoDoFo::PdfPagesTree::InsertPage |
( |
int |
nAfterPageIndex, |
|
|
PdfPage * |
pPage |
|
) |
| |
Inserts an existing page object into the internal page tree. after the specified page number
- Parameters
-
nAfterPageIndex | an integer specifying after what page
- may be one of the special values from EPdfPageInsertionPoint. Pages are 0 based.
|
pPage | a PdfPage to be inserted, the PdfPage will not get owned by the PdfPagesTree |
◆ InsertPages()
void PoDoFo::PdfPagesTree::InsertPages |
( |
int |
nAfterPageIndex, |
|
|
const std::vector< PdfObject * > & |
vecPages |
|
) |
| |
Inserts a vector of page objects at once into the internal page tree after the specified page index (zero based index)
- Parameters
-
nAfterPageIndex | a zero based integer index specifying after what page to insert
- you need to pass ePdfPageInsertionPoint_InsertBeforeFirstPage if you want to insert before the first page.
|
vecPages | must be a vector of PdfObjects with type /Page |