#include <PdfPageTree.h>
Inherits mm::PdfDictionaryElement.
Class for managing the tree of Pages in a PDF document Don't use this class directly. Use PdfDocument instead.
- See also
- PdfDocument
◆ PdfPageTree() [1/2]
◆ PdfPageTree() [2/2]
| PdfPageTree::PdfPageTree |
( |
PdfObject & |
pagesRoot | ) |
|
Construct a PdfPageTree from the root /Pages object
- Parameters
-
| pagesRoot | pointer to page tree dictionary |
◆ ~PdfPageTree()
| PdfPageTree::~PdfPageTree |
( |
| ) |
|
|
virtual |
◆ 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
-
| size | 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 PdfPageTree::CreatePages |
( |
const std::vector< PdfRect > & |
sizes | ) |
|
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
-
| sizes | a vector of PdfRect specifying the size of each of the pages to create (i.e the /MediaBox key) in PDF units |
◆ DeletePage()
| void PdfPageTree::DeletePage |
( |
unsigned |
atIndex | ) |
|
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
-
| atIndex | 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 & PdfPageTree::GetPage |
( |
unsigned |
index | ) |
|
Return a PdfPage for the specified Page index The returned page is owned by the pages tree and deleted along with it.
- Parameters
-
- Returns
- a pointer to the requested page
◆ GetPageCount()
| unsigned PdfPageTree::GetPageCount |
( |
| ) |
const |
Return the number of pages in the entire tree
- Returns
- number of pages
◆ InsertPage()
| PdfPage * PdfPageTree::InsertPage |
( |
unsigned |
atIndex, |
|
|
const PdfRect & |
size |
|
) |
| |
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
-
| size | 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