PoDoFo
1.0.0-dev
|
PdfDocument is the core interface for working with PDF documents. More...
#include <PdfDocument.h>
Public Member Functions | |
virtual | ~PdfDocument () |
Close down/destruct the PdfDocument. | |
PdfOutlines & | GetOrCreateOutlines () |
Get access to the Outlines (Bookmarks) dictionary The returned outlines object is owned by the PdfDocument. More... | |
PdfNameTrees & | GetOrCreateNames () |
Get access to the Names dictionary (where all the named objects are stored) The returned PdfNameTrees object is owned by the PdfDocument. More... | |
PdfAcroForm & | GetOrCreateAcroForm (PdfAcroFormDefaulAppearance eDefaultAppearance=PdfAcroFormDefaulAppearance::ArialBlack) |
Get access to the AcroForm dictionary. More... | |
void | CollectGarbage () |
std::unique_ptr< PdfImage > | CreateImage () |
Construct a new PdfImage object. | |
std::unique_ptr< PdfXObjectForm > | CreateXObjectForm (const Rect &rect) |
std::unique_ptr< PdfDestination > | CreateDestination () |
std::unique_ptr< PdfColorSpace > | CreateColorSpace (const PdfColorSpaceFilterPtr &filter) |
std::unique_ptr< PdfExtGState > | CreateExtGState () |
template<typename Taction > | |
std::unique_ptr< Taction > | CreateAction () |
std::unique_ptr< PdfAction > | CreateAction (PdfActionType type) |
std::unique_ptr< PdfFileSpec > | CreateFileSpec () |
bool | IsPrintAllowed () const |
Checks if printing this document is allowed. More... | |
bool | IsEditAllowed () const |
Checks if modifying this document (besides annotations, form fields or substituting pages) is allowed. More... | |
bool | IsCopyAllowed () const |
Checks if text and graphics extraction is allowed. More... | |
bool | IsEditNotesAllowed () const |
Checks if it is allowed to add or modify annotations or form fields. More... | |
bool | IsFillAndSignAllowed () const |
Checks if it is allowed to fill in existing form or signature fields. More... | |
bool | IsAccessibilityAllowed () const |
Checks if it is allowed to extract text and graphics to support users with disabilities. More... | |
bool | IsDocAssemblyAllowed () const |
Checks if it is allowed to insert, create, rotate, or delete pages or add bookmarks. More... | |
bool | IsHighPrintAllowed () const |
Checks if it is allowed to print a high quality version of this document Every PDF-consuming application has to adhere to this value! More... | |
PdfAcroForm & | MustGetAcroForm () |
const PdfAcroForm & | MustGetAcroForm () const |
PdfNameTrees & | MustGetNames () |
const PdfNameTrees & | MustGetNames () const |
PdfOutlines & | MustGetOutlines () |
const PdfOutlines & | MustGetOutlines () const |
PdfDocumentFieldIterable | GetFieldsIterator () |
Get an iterator for all fields in the document. More... | |
PdfDocumentConstFieldIterable | GetFieldsIterator () const |
void | Reset () |
Clear all internal structures and reset PdfDocument to an empty state. | |
virtual const PdfEncrypt * | GetEncrypt () const =0 |
bool | IsEncrypted () const |
PdfCatalog & | GetCatalog () |
Get access to the internal Catalog dictionary or root object. More... | |
const PdfCatalog & | GetCatalog () const |
Get access to the internal Catalog dictionary or root object. More... | |
PdfPageCollection & | GetPages () |
Get access to the page tree. More... | |
const PdfPageCollection & | GetPages () const |
Get access to the page tree. More... | |
PdfTrailer & | GetTrailer () |
Get access to the internal trailer dictionary or root object. More... | |
const PdfTrailer & | GetTrailer () const |
Get access to the internal trailer dictionary or root object. More... | |
const PdfInfo * | GetInfo () const |
Get access to the internal Info dictionary You can set the author, title etc. More... | |
PdfMetadata & | GetMetadata () |
const PdfMetadata & | GetMetadata () const |
PdfIndirectObjectList & | GetObjects () |
Get access to the internal vector of objects or root object. More... | |
const PdfIndirectObjectList & | GetObjects () const |
Get access to the internal vector of objects or root object. More... | |
PdfAcroForm * | GetAcroForm () |
const PdfAcroForm * | GetAcroForm () const |
PdfNameTrees * | GetNames () |
const PdfNameTrees * | GetNames () const |
PdfOutlines * | GetOutlines () |
const PdfOutlines * | GetOutlines () const |
PdfFontManager & | GetFonts () |
template<typename TAction > | |
std::unique_ptr< TAction > | CreateAction () |
Protected Member Functions | |
PdfDocument (bool empty=false) | |
Construct a new (empty) PdfDocument. More... | |
PdfDocument (const PdfDocument &doc) | |
void | SetTrailer (std::unique_ptr< PdfObject > obj) |
Set the trailer of this PdfDocument deleting the old one. More... | |
void | Init () |
Internal method for initializing the pages tree for this document. | |
virtual void | reset () |
void | Clear () |
Clear all variables that have internal memory usage. | |
virtual void | clear () |
virtual PdfVersion | GetPdfVersion () const =0 |
Get the PDF version of the document. More... | |
virtual void | SetPdfVersion (PdfVersion version)=0 |
Get the PDF version of the document. More... | |
Friends | |
class | PdfMetadata |
class | PdfXObjectForm |
class | PdfPageCollection |
PdfDocument is the core interface for working with PDF documents.
PdfDocument provides easy access to the individual pages in the PDF file and to certain special dictionaries.
PdfDocument cannot be used directly. Use PdfMemDocument whenever you want to change the object structure of a PDF file.
When you are only creating PDF files, please use PdfStreamedDocument which is usually faster for creating PDFs.
|
protected |
Construct a new (empty) PdfDocument.
empty | if true NO default objects (such as catalog) are created. |
|
inline |
Get access to the internal Catalog dictionary or root object.
|
inline |
Get access to the internal Catalog dictionary or root object.
PdfDocumentFieldIterable PdfDocument::GetFieldsIterator | ( | ) |
Get an iterator for all fields in the document.
All widget annotation fields in the pages will be returned, plus non annotation fields in the /AcroForm (eg. invisibile signatures)
|
inline |
Get access to the internal Info dictionary You can set the author, title etc.
of the document using the info dictionary.
|
inline |
Get access to the internal vector of objects or root object.
|
inline |
Get access to the internal vector of objects or root object.
PdfAcroForm & PdfDocument::GetOrCreateAcroForm | ( | PdfAcroFormDefaulAppearance | eDefaultAppearance = PdfAcroFormDefaulAppearance::ArialBlack | ) |
Get access to the AcroForm dictionary.
create | create the object if it does not exist (ePdfCreateObject) or return nullptr if it does not exist |
eDefaultAppearance | specifies if a default appearance shall be created |
PdfNameTrees & PdfDocument::GetOrCreateNames | ( | ) |
Get access to the Names dictionary (where all the named objects are stored) The returned PdfNameTrees object is owned by the PdfDocument.
create | create the object if it does not exist (ePdfCreateObject) or return nullptr if it does not exist |
PdfOutlines & PdfDocument::GetOrCreateOutlines | ( | ) |
Get access to the Outlines (Bookmarks) dictionary The returned outlines object is owned by the PdfDocument.
create | create the object if it does not exist (ePdfCreateObject) or return nullptr if it does not exist |
|
inline |
Get access to the page tree.
|
inline |
Get access to the page tree.
|
protectedpure virtual |
Get the PDF version of the document.
Implemented in PoDoFo::PdfStreamedDocument, and PoDoFo::PdfMemDocument.
|
inline |
Get access to the internal trailer dictionary or root object.
|
inline |
Get access to the internal trailer dictionary or root object.
bool PdfDocument::IsAccessibilityAllowed | ( | ) | const |
Checks if it is allowed to extract text and graphics to support users with disabilities.
Every PDF-consuming application has to adhere to this value!
bool PdfDocument::IsCopyAllowed | ( | ) | const |
Checks if text and graphics extraction is allowed.
Every PDF-consuming application has to adhere to this value!
bool PdfDocument::IsDocAssemblyAllowed | ( | ) | const |
Checks if it is allowed to insert, create, rotate, or delete pages or add bookmarks.
Every PDF-consuming application has to adhere to this value!
bool PdfDocument::IsEditAllowed | ( | ) | const |
Checks if modifying this document (besides annotations, form fields or substituting pages) is allowed.
Every PDF-consuming application has to adhere to this value!
bool PdfDocument::IsEditNotesAllowed | ( | ) | const |
Checks if it is allowed to add or modify annotations or form fields.
Every PDF-consuming application has to adhere to this value!
bool PdfDocument::IsEncrypted | ( | ) | const |
bool PdfDocument::IsFillAndSignAllowed | ( | ) | const |
Checks if it is allowed to fill in existing form or signature fields.
Every PDF-consuming application has to adhere to this value!
bool PdfDocument::IsHighPrintAllowed | ( | ) | const |
Checks if it is allowed to print a high quality version of this document Every PDF-consuming application has to adhere to this value!
bool PdfDocument::IsPrintAllowed | ( | ) | const |
Checks if printing this document is allowed.
Every PDF-consuming application has to adhere to this value!
|
protectedpure virtual |
Get the PDF version of the document.
Implemented in PoDoFo::PdfStreamedDocument, and PoDoFo::PdfMemDocument.
|
protected |
Set the trailer of this PdfDocument deleting the old one.
obj | the new trailer object It will be owned by PdfDocument. |