PoDoFo 0.9.20
|
#include <PdfDocument.h>
Protected Member Functions | |
PdfDocument (bool empty=false) | |
void | SetTrailer (std::unique_ptr< PdfObject > obj) |
void | Init () |
void | Clear () |
virtual PdfVersion | GetPdfVersion () const =0 |
virtual void | SetPdfVersion (PdfVersion version)=0 |
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.
|
virtual |
Close down/destruct the PdfDocument
|
protected |
Construct a new (empty) PdfDocument
empty | if true NO default objects (such as catalog) are created. |
void PdfDocument::AddNamedDestination | ( | const PdfDestination & | dest, |
const PdfString & | name ) |
Adds a PdfDestination into the global Names tree with the specified name, optionally replacing one of the same name.
dest | the destination to be assigned |
name | the name for the destination |
void PdfDocument::AttachFile | ( | const PdfFileSpec & | fileSpec | ) |
Attach a file to the document.
rFileSpec | a file specification |
|
protected |
Clear all internal variables and reset PdfDocument to an intial state.
unique_ptr< PdfImage > PdfDocument::CreateImage | ( | const std::string_view & | prefix = { } | ) |
Constuct a new PdfImage object
prefix | optional prefix for XObject-name |
PdfFileSpec * PdfDocument::GetAttachment | ( | const PdfString & | name | ) |
Get an attached file's filespec.
name | the name of the attachment |
|
inline |
Get access to the internal Catalog dictionary or root object.
|
inline |
Get access to the internal Catalog dictionary or root object.
|
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::BlackText12pt | ) |
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 appearence shall be created |
PdfNameTree & PdfDocument::GetOrCreateNameTree | ( | ) |
Get access to the Names dictionary (where all the named objects are stored) The returned PdfNameTree 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::PdfMemDocument, and PoDoFo::PdfStreamedDocument.
|
inline |
Get access to the internal trailer dictionary or root object.
|
inline |
Get access to the internal trailer dictionary or root object.
|
protected |
Internal method for initializing the pages tree for this document
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::PdfMemDocument, and PoDoFo::PdfStreamedDocument.
|
protected |
Set the trailer of this PdfDocument deleting the old one.
obj | the new trailer object It will be owned by PdfDocument. |