Class for managing the tree of Pages in a PDF document Don't use this class directly.
More...
#include <PdfPageCollection.h>
Inherits PoDoFo::PdfDictionaryElement.
|
using | PageList = std::vector< PdfPage * > |
|
using | iterator = Iterator< PdfPage, PageList::iterator > |
|
using | const_iterator = Iterator< const PdfPage, PageList::const_iterator > |
|
|
| PdfPageCollection (PdfDocument &doc) |
| Construct a new PdfPageTree.
|
|
| PdfPageCollection (PdfObject &pagesRoot) |
| Construct a PdfPageTree from the root /Pages object. More...
|
|
virtual | ~PdfPageCollection () |
| Close/down destruct a PdfPageTree.
|
|
unsigned | GetCount () const |
| Return the number of pages in document. More...
|
|
PdfPage & | GetPageAt (unsigned index) |
| Return a PdfPage for the specified Page index The returned page is owned by the pages tree and deleted along with it. More...
|
|
const PdfPage & | GetPageAt (unsigned index) const |
|
PdfPage & | GetPage (const PdfReference &ref) |
| Return a PdfPage for the specified Page reference. More...
|
|
const PdfPage & | GetPage (const PdfReference &ref) const |
|
PdfPage & | CreatePage (const nullable< Rect > &size=nullptr) |
| Creates a new page object and inserts it into the internal page tree. More...
|
|
PdfPage & | CreatePage (PdfPageSize pageSize) |
|
PdfPage & | CreatePageAt (unsigned atIndex, const nullable< Rect > &size=nullptr) |
| Creates a new page object and inserts it at index atIndex. More...
|
|
PdfPage & | CreatePageAt (unsigned atIndex, PdfPageSize pageSize) |
|
void | CreatePagesAt (unsigned atIndex, unsigned count, const nullable< Rect > &size=nullptr) |
| Create count new page objects and insert at the index atIndex. More...
|
|
void | CreatePagesAt (unsigned atIndex, unsigned count, PdfPageSize pageSize) |
|
void | AppendDocumentPages (const PdfDocument &doc) |
| Appends another PdfDocument to this document. More...
|
|
void | AppendDocumentPages (const PdfDocument &doc, unsigned pageIndex, unsigned pageCount) |
| Copies one or more pages from another PdfMemDocument to this document. More...
|
|
void | InsertDocumentPageAt (unsigned atIndex, const PdfDocument &doc, unsigned pageIndex) |
| Inserts existing page from another PdfDocument to this document. More...
|
|
void | RemovePageAt (unsigned atIndex) |
| Delete the specified page object from the internal pages tree. More...
|
|
void | FlattenStructure () |
| Flatten the document page structure tree. More...
|
|
iterator | begin () |
|
iterator | end () |
|
const_iterator | begin () const |
|
const_iterator | end () const |
|
|
class | PdfDocument |
|
class | PdfPage |
|
Class for managing the tree of Pages in a PDF document Don't use this class directly.
Use PdfDocument instead.
- See also
- PdfDocument
◆ PdfPageCollection()
PdfPageCollection::PdfPageCollection |
( |
PdfObject & |
pagesRoot | ) |
|
Construct a PdfPageTree from the root /Pages object.
- Parameters
-
pagesRoot | pointer to page tree dictionary |
◆ AppendDocumentPages() [1/2]
void PdfPageCollection::AppendDocumentPages |
( |
const PdfDocument & |
doc | ) |
|
Appends another PdfDocument to this document.
- Parameters
-
doc | the document to append |
◆ AppendDocumentPages() [2/2]
void PdfPageCollection::AppendDocumentPages |
( |
const PdfDocument & |
doc, |
|
|
unsigned |
pageIndex, |
|
|
unsigned |
pageCount |
|
) |
| |
Copies one or more pages from another PdfMemDocument to this document.
- Parameters
-
doc | the document to append |
atIndex | the first page number to copy (0-based) |
pageCount | the number of pages to copy |
◆ 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 Rect specifying the size of the page (i.e the /MediaBox key) in PDF units |
- Returns
- a pointer to a PdfPage object
◆ CreatePageAt()
PdfPage & PdfPageCollection::CreatePageAt |
( |
unsigned |
atIndex, |
|
|
const nullable< Rect > & |
size = nullptr |
|
) |
| |
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 Rect 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
◆ CreatePagesAt()
void PdfPageCollection::CreatePagesAt |
( |
unsigned |
atIndex, |
|
|
unsigned |
count, |
|
|
const nullable< Rect > & |
size = nullptr |
|
) |
| |
Create count new page objects and insert at the index atIndex.
This is significantly faster than calling CreatePageAt repeatedly.
- Parameters
-
size | a Rect specifying the size of the page (i.e the /MediaBox key) in PDF units |
count | number of pages to create |
atIndex | index where to insert the new page (0-based) |
◆ FlattenStructure()
void PdfPageCollection::FlattenStructure |
( |
| ) |
|
Flatten the document page structure tree.
This copy pages inheritable attributes and remove intermediate /Pages nodes. This operation is allowed by the PDF specification, see "ISO 32000-2:2020, 7.7.3.2 Page tree nodes"
◆ GetCount()
unsigned PdfPageCollection::GetCount |
( |
| ) |
const |
Return the number of pages in document.
- Returns
- number of pages
◆ GetPage()
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
◆ GetPageAt()
PdfPage & PdfPageCollection::GetPageAt |
( |
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
◆ InsertDocumentPageAt()
void PdfPageCollection::InsertDocumentPageAt |
( |
unsigned |
atIndex, |
|
|
const PdfDocument & |
doc, |
|
|
unsigned |
pageIndex |
|
) |
| |
Inserts existing page from another PdfDocument to this document.
- Parameters
-
atIndex | index at which to add the page in this document |
doc | the document to append from |
pageIndex | index of page to append from doc |
◆ RemovePageAt()
void PdfPageCollection::RemovePageAt |
( |
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 referring to this page will be deleted by this call! Empty page nodes will also be deleted.
- See also
- PdfMemDocument::DeletePages
The documentation for this class was generated from the following files: