|
pdfmm 0.9.20
|
#include <PdfStreamedDocument.h>
Public Member Functions | |
| PdfStreamedDocument (PdfOutputDevice &device, PdfVersion version=PdfVersionDefault, PdfEncrypt *encrypt=nullptr, PdfSaveOptions opts=PdfSaveOptions::None) | |
| PdfStreamedDocument (const std::string_view &filename, PdfVersion version=PdfVersionDefault, PdfEncrypt *encrypt=nullptr, PdfSaveOptions opts=PdfSaveOptions::None) | |
| void | Close () |
| PdfVersion | GetPdfVersion () const override |
| bool | IsLinearized () const override |
| bool | IsPrintAllowed () const override |
| bool | IsEditAllowed () const override |
| bool | IsCopyAllowed () const override |
| bool | IsEditNotesAllowed () const override |
| bool | IsFillAndSignAllowed () const override |
| bool | IsAccessibilityAllowed () const override |
| bool | IsDocAssemblyAllowed () const override |
| bool | IsHighPrintAllowed () const override |
Public Member Functions inherited from mm::PdfDocument | |
| virtual | ~PdfDocument () |
| virtual PdfVersion | GetPdfVersion () const =0 |
| virtual bool | IsLinearized () const =0 |
| PdfOutlines & | GetOrCreateOutlines () |
| PdfNameTree & | GetOrCreateNameTree () |
| PdfAcroForm & | GetOrCreateAcroForm (PdfAcroFormDefaulAppearance eDefaultAppearance=PdfAcroFormDefaulAppearance::BlackText12pt) |
| void | EmbedSubsetFonts () |
| const PdfDocument & | Append (const PdfDocument &doc, bool appendAll=true) |
| const PdfDocument & | InsertExistingPageAt (const PdfDocument &doc, unsigned pageIndex, unsigned atIndex) |
| PdfRect | FillXObjectFromDocumentPage (PdfXObject &xobj, const PdfDocument &doc, unsigned pageIndex, bool useTrimBox) |
| PdfRect | FillXObjectFromExistingPage (PdfXObject &xobj, unsigned pageIndex, bool useTrimBox) |
| PdfRect | FillXObjectFromPage (PdfXObject &xobj, const PdfPage &page, bool useTrimBox, unsigned difference) |
| void | AttachFile (const PdfFileSpec &fileSpec) |
| PdfFileSpec * | GetAttachment (const PdfString &name) |
| void | AddNamedDestination (const PdfDestination &dest, const PdfString &name) |
| void | SetPageMode (PdfPageMode inMode) |
| PdfPageMode | GetPageMode () const |
| void | SetUseFullScreen () |
| void | SetPageLayout (PdfPageLayout inLayout) |
| void | SetHideToolbar () |
| void | SetHideMenubar () |
| void | SetHideWindowUI () |
| void | SetFitWindow () |
| void | SetCenterWindow () |
| void | SetDisplayDocTitle () |
| void | SetPrintScaling (const PdfName &scalingType) |
| void | SetBaseURI (const std::string_view &baseURI) |
| void | SetLanguage (const std::string_view &language) |
| void | SetBindingDirection (const PdfName &direction) |
| virtual bool | IsPrintAllowed () const =0 |
| virtual bool | IsEditAllowed () const =0 |
| virtual bool | IsCopyAllowed () const =0 |
| virtual bool | IsEditNotesAllowed () const =0 |
| virtual bool | IsFillAndSignAllowed () const =0 |
| virtual bool | IsAccessibilityAllowed () const =0 |
| virtual bool | IsDocAssemblyAllowed () const =0 |
| virtual bool | IsHighPrintAllowed () const =0 |
| PdfObject & | GetCatalog () |
| const PdfObject & | GetCatalog () const |
| PdfPageTree & | GetPageTree () |
| const PdfPageTree & | GetPageTree () const |
| PdfObject & | GetTrailer () |
| const PdfObject & | GetTrailer () const |
| PdfInfo & | GetInfo () |
| const PdfInfo & | GetInfo () const |
| PdfIndirectObjectList & | GetObjects () |
| const PdfIndirectObjectList & | GetObjects () const |
| PdfObject * | GetStructTreeRoot () |
| PdfObject * | GetMetadata () |
| PdfObject * | GetMarkInfo () |
| PdfObject * | GetLanguage () |
Additional Inherited Members | |
Protected Member Functions inherited from mm::PdfDocument | |
| PdfDocument (bool empty=false) | |
| void | SetTrailer (std::unique_ptr< PdfObject > obj) |
| void | Init () |
| void | FixObjectReferences (PdfObject &obj, int difference) |
| void | SetViewerPreference (const PdfName &whichPref, const PdfObject &valueObj) |
| void | SetViewerPreference (const PdfName &whichPref, bool inValue) |
| void | Clear () |
| PdfObject * | getCatalog () |
PdfStreamedDocument is the preferred class for creating new PDF documents.
Page contents, fonts and images are written to disk as soon as possible and are not kept in memory. This results in faster document generation and less memory being used.
Please use PdfMemDocument if you intend to work on the object structure of a PDF file.
One of the design goals of PdfStreamedDocument was to hide the underlying object structure of a PDF file as far as possible.
Example of using PdfStreamedDocument:
PdfStreamedDocument document("outputfile.pdf"); PdfPage* page = document.CreatePage(PdfPage::CreateStandardPageSize(PdfPageSize::A4)); PdfFont* font = document.CreateFont("Arial");
PdfPainter painter; painter.SetPage(page); painter.SetFont(font); painter.DrawText(56.69, page->GetRect().GetHeight() - 56.69, "Hello World!"); painter.FinishPage();
document.Close();
| PdfStreamedDocument::PdfStreamedDocument | ( | PdfOutputDevice & | device, |
| PdfVersion | version = PdfVersionDefault, |
||
| PdfEncrypt * | encrypt = nullptr, |
||
| PdfSaveOptions | opts = PdfSaveOptions::None |
||
| ) |
Create a new PdfStreamedDocument. All data is written to an output device immediately.
| device | an output device |
| version | the PDF version of the document to write. The PDF version can only be set in the constructor as it is the first item written to the document on disk. |
| encrypt | pointer to an encryption object or nullptr. If not nullptr the PdfEncrypt object will be copied and used to encrypt the created document. |
| opts | additional save options for writing the pdf |
| mm::PdfStreamedDocument::PdfStreamedDocument | ( | const std::string_view & | filename, |
| PdfVersion | version = PdfVersionDefault, |
||
| PdfEncrypt * | encrypt = nullptr, |
||
| PdfSaveOptions | opts = PdfSaveOptions::None |
||
| ) |
Create a new PdfStreamedDocument. All data is written to a file immediately.
| filename | resulting PDF file |
| version | the PDF version of the document to write. The PDF version can only be set in the constructor as it is the first item written to the document on disk. |
| encrypt | pointer to an encryption object or nullptr. If not nullptr the PdfEncrypt object will be copied and used to encrypt the created document. |
| opts | additional options for writing the pdf |
| void PdfStreamedDocument::Close | ( | ) |
Close the document. The PDF file on disk is finished. No other member function of this class maybe called after calling this function.
|
overridevirtual |
Get the PDF version of the document
Implements mm::PdfDocument.
|
overridevirtual |
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!
Implements mm::PdfDocument.
|
overridevirtual |
Checks if text and graphics extraction is allowed. Every PDF-consuming application has to adhere to this value!
Implements mm::PdfDocument.
|
overridevirtual |
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!
Implements mm::PdfDocument.
|
overridevirtual |
Checks if modifying this document (besides annotations, form fields or substituting pages) is allowed. Every PDF-consuming application has to adhere to this value!
Implements mm::PdfDocument.
|
overridevirtual |
Checks if it is allowed to add or modify annotations or form fields. Every PDF-consuming application has to adhere to this value!
Implements mm::PdfDocument.
|
overridevirtual |
Checks if it is allowed to fill in existing form or signature fields. Every PDF-consuming application has to adhere to this value!
Implements mm::PdfDocument.
|
overridevirtual |
Checks if it is allowed to print a high quality version of this document Every PDF-consuming application has to adhere to this value!
Implements mm::PdfDocument.
|
overridevirtual |
Returns whether this PDF document is linearized, aka web-optimized
Implements mm::PdfDocument.
|
overridevirtual |
Checks if printing this document is allowed. Every PDF-consuming application has to adhere to this value!
Implements mm::PdfDocument.