#include <PdfPagesTree.h>
Public Member Functions | |
PdfPagesTree (PdfVecObjects *pParent) | |
PdfPagesTree (PdfObject *pPagesRoot) | |
virtual | ~PdfPagesTree () |
int | GetTotalNumberOfPages () const |
PdfPage * | GetPage (int nIndex) |
PdfPage * | GetPage (const PdfReference &ref) |
void | InsertPage (int nAfterPageIndex, PdfObject *pPage) |
void | InsertPage (int nAfterPageIndex, PdfPage *pPage) |
void | InsertPages (int nAfterPageIndex, const std::vector< PdfObject * > &vecPages) |
PdfPage * | CreatePage (const PdfRect &rSize) |
void | CreatePages (const std::vector< PdfRect > &vecSizes) |
PdfPage * | InsertPage (const PdfRect &rSize, int atIndex) |
void | DeletePage (int inPageNumber) |
void | ClearCache () |
PoDoFo::PdfPagesTree::PdfPagesTree | ( | PdfVecObjects * | pParent | ) |
Construct a new PdfPagesTree
PoDoFo::PdfPagesTree::PdfPagesTree | ( | PdfObject * | pPagesRoot | ) |
Construct a PdfPagesTree from the root /Pages object
pPagesRoot | pointer to page tree dictionary |
PoDoFo::PdfPagesTree::~PdfPagesTree | ( | ) | [virtual] |
Close/down destruct a PdfPagesTree
int PoDoFo::PdfPagesTree::GetTotalNumberOfPages | ( | ) | const |
Return the number of pages in the entire tree
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.
nIndex | page index, 0-based |
PdfPage * PoDoFo::PdfPagesTree::GetPage | ( | const PdfReference & | ref | ) |
Return a PdfPage for the specified Page reference. The returned page is owned by the pages tree and deleted along with it.
ref | the reference of the pages object |
void PoDoFo::PdfPagesTree::InsertPage | ( | int | nAfterPageIndex, | |
PdfObject * | pPage | |||
) |
Inserts an existing page object into the internal page tree. after the specified page number
nAfterPageIndex | an integer specifying after what page
| |
pPage | musst be a PdfObject with type /Page |
void PoDoFo::PdfPagesTree::InsertPage | ( | int | nAfterPageIndex, | |
PdfPage * | pPage | |||
) |
Inserts an existing page object into the internal page tree. after the specified page number
nAfterPageIndex | an integer specifying after what page
| |
pPage | a PdfPage to be inserted, the PdfPage will not get owned by the PdfPagesTree |
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)
nAfterPageIndex | a zero based integer index specifying after what page to insert
| |
vecPages | must be a vector of PdfObjects with type /Page |
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
vecSizes | a vector of PdfRect specifying the size of each of the pages to create (i.e the /MediaBox key) in PDF units |
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!
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) |
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
inPageNumber | the page number (0-based) to be removed |
void PoDoFo::PdfPagesTree::ClearCache | ( | ) | [inline] |