7 #ifndef PDF_PAGES_TREE_H
8 #define PDF_PAGES_TREE_H
12 #include "PdfElement.h"
45 unsigned GetCount()
const;
54 PdfPage& GetPageAt(
unsigned index);
55 const PdfPage& GetPageAt(
unsigned index)
const;
96 void CreatePagesAt(
unsigned atIndex,
unsigned count,
const nullable<Rect>& size =
nullptr);
97 void CreatePagesAt(
unsigned atIndex,
unsigned count,
PdfPageSize pageSize);
109 void AppendDocumentPages(
const PdfDocument& doc,
unsigned pageIndex,
unsigned pageCount);
116 void InsertDocumentPageAt(
unsigned atIndex,
const PdfDocument& doc,
unsigned pageIndex);
128 void RemovePageAt(
unsigned atIndex);
135 void FlattenStructure();
138 template <
typename TObject,
typename TListIterator>
143 using difference_type = void;
144 using value_type = TObject*;
145 using pointer = void;
146 using reference = void;
147 using iterator_category = std::forward_iterator_tag;
151 Iterator(
const TListIterator& iterator) : m_iterator(iterator) { }
153 Iterator(
const Iterator&) =
default;
154 Iterator& operator=(
const Iterator&) =
default;
155 bool operator==(
const Iterator& rhs)
const
157 return m_iterator == rhs.m_iterator;
159 bool operator!=(
const Iterator& rhs)
const
161 return m_iterator != rhs.m_iterator;
163 Iterator& operator++()
168 Iterator operator++(
int)
174 value_type operator*()
178 value_type operator->()
183 TListIterator m_iterator;
186 using PageList = std::vector<PdfPage*>;
188 using iterator = Iterator<PdfPage, PageList::iterator>;
189 using const_iterator = Iterator<const PdfPage, PageList::const_iterator>;
194 const_iterator begin()
const;
195 const_iterator end()
const;
202 void InsertPageAt(
unsigned atIndex,
PdfPage& page);
210 bool TryMovePageTo(
unsigned atIndex,
unsigned toIndex);
213 void insertPageAt(
unsigned atIndex,
PdfPage& page);
221 unsigned traversePageTreeNode(
PdfObject& obj,
unsigned count,
222 std::vector<PdfObject*>& parents, std::unordered_set<PdfObject*>& visitedNodes);
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
This class represents a PdfArray Use it for all arrays that are written to a PDF file.
Definition: PdfArray.h:81
PdfDocument is the core interface for working with PDF documents.
Definition: PdfDocument.h:108
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
Class for managing the tree of Pages in a PDF document Don't use this class directly.
Definition: PdfPageCollection.h:24
PdfPage is one page in the pdf document.
Definition: PdfPage.h:127
A reference is a pointer to a object in the PDF file of the form "4 0 R", where 4 is the object numbe...
Definition: PdfReference.h:24
A rectangle defined by position and size.
Definition: Rect.h:20
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
PdfPageSize
Enum holding the supported page sizes by PoDoFo.
Definition: PdfDeclarations.h:479
tcb::span< const T, Extent > cspan
Constant span.
Definition: span.h:13