PoDoFo
0.9.6
|
#include <PdfStreamedDocument.h>
Public Member Functions | |
PdfStreamedDocument (PdfOutputDevice *pDevice, EPdfVersion eVersion=ePdfVersion_Default, PdfEncrypt *pEncrypt=NULL, EPdfWriteMode eWriteMode=ePdfWriteMode_Default) | |
PdfStreamedDocument (const char *pszFilename, EPdfVersion eVersion=ePdfVersion_Default, PdfEncrypt *pEncrypt=NULL, EPdfWriteMode eWriteMode=ePdfWriteMode_Default) | |
void | Close () |
virtual EPdfWriteMode | GetWriteMode () const |
virtual EPdfVersion | GetPdfVersion () const |
virtual bool | IsLinearized () const |
virtual bool | IsPrintAllowed () const |
virtual bool | IsEditAllowed () const |
virtual bool | IsCopyAllowed () const |
virtual bool | IsEditNotesAllowed () const |
virtual bool | IsFillAndSignAllowed () const |
virtual bool | IsAccessibilityAllowed () const |
virtual bool | IsDocAssemblyAllowed () const |
virtual bool | IsHighPrintAllowed () const |
![]() | |
virtual | ~PdfDocument () |
PdfInfo * | GetInfo () const |
PdfOutlines * | GetOutlines (bool bCreate=ePdfCreateObject) |
PdfNamesTree * | GetNamesTree (bool bCreate=ePdfCreateObject) |
PdfAcroForm * | GetAcroForm (bool bCreate=ePdfCreateObject, EPdfAcroFormDefaulAppearance eDefaultAppearance=ePdfAcroFormDefaultAppearance_BlackText12pt) |
PdfPagesTree * | GetPagesTree () const |
int | GetPageCount () const |
PdfPage * | GetPage (int nIndex) const |
PdfFont * | CreateFont (const char *pszFontName, bool bSymbolCharset=false, const PdfEncoding *const pEncoding=PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), PdfFontCache::EFontCreationFlags eFontCreationFlags=PdfFontCache::eFontCreationFlags_AutoSelectBase14, bool bEmbedd=true) |
PdfFont * | CreateFont (const char *pszFontName, bool bBold, bool bItalic, bool bSymbolCharset=false, const PdfEncoding *const pEncoding=PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), PdfFontCache::EFontCreationFlags eFontCreationFlags=PdfFontCache::eFontCreationFlags_AutoSelectBase14, bool bEmbedd=true, const char *pszFileName=NULL) |
PdfFont * | CreateFont (FT_Face face, bool bSymbolCharset=false, const PdfEncoding *const pEncoding=PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), bool bEmbedd=true) |
PdfFont * | CreateDuplicateFontType1 (PdfFont *pFont, const char *pszSuffix) |
PdfFont * | CreateFontSubset (const char *pszFontName, bool bBold, bool bItalic, bool bSymbolCharset=false, const PdfEncoding *const pEncoding=PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), const char *pszFileName=NULL) |
FT_Library | GetFontLibrary () const |
void | EmbedSubsetFonts () |
PdfPage * | CreatePage (const PdfRect &rSize) |
void | CreatePages (const std::vector< PdfRect > &vecSizes) |
PdfPage * | InsertPage (const PdfRect &rSize, int atIndex) |
const PdfDocument & | Append (const PdfMemDocument &rDoc, bool bAppendAll=true) |
const PdfDocument & | InsertExistingPageAt (const PdfMemDocument &rDoc, int nPageIndex, int nAtIndex) |
PdfRect | FillXObjectFromDocumentPage (PdfXObject *pXObj, const PdfMemDocument &rDoc, int nPage, bool bUseTrimBox) |
PdfRect | FillXObjectFromExistingPage (PdfXObject *pXObj, int nPage, bool bUseTrimBox) |
PdfRect | FillXObjectFromPage (PdfXObject *pXObj, const PdfPage *pPage, bool bUseTrimBox, unsigned int difference) |
void | AttachFile (const PdfFileSpec &rFileSpec) |
PdfFileSpec * | GetAttachment (const PdfString &rName) |
void | AddNamedDestination (const PdfDestination &rDest, const PdfString &rsName) |
void | SetPageMode (EPdfPageMode inMode) |
EPdfPageMode | GetPageMode (void) const |
void | SetUseFullScreen (void) |
void | SetPageLayout (EPdfPageLayout inLayout) |
void | SetHideToolbar (void) |
void | SetHideMenubar (void) |
void | SetHideWindowUI (void) |
void | SetFitWindow (void) |
void | SetCenterWindow (void) |
void | SetDisplayDocTitle (void) |
void | SetPrintScaling (PdfName &inScalingType) |
void | SetBaseURI (const std::string &inBaseURI) |
void | SetLanguage (const std::string &inLanguage) |
void | SetBindingDirection (PdfName &inDirection) |
PdfVecObjects * | GetObjects () |
const PdfVecObjects * | GetObjects () const |
void | SetFontConfigWrapper (const PdfFontConfigWrapper &rFontConfig) |
Additional Inherited Members | |
![]() | |
PdfDocument (bool bEmpty=false) | |
void | SetInfo (PdfInfo *pInfo) |
PdfObject * | GetCatalog () |
const PdfObject * | GetCatalog () const |
void | SetCatalog (PdfObject *pObject) |
PdfObject * | GetTrailer () |
const PdfObject * | GetTrailer () const |
void | SetTrailer (PdfObject *pObject) |
PdfObject * | GetNamedObjectFromCatalog (const char *pszName) const |
void | InitPagesTree () |
void | FixObjectReferences (PdfObject *pObject, int difference) |
void | SetViewerPreference (const PdfName &whichPref, const PdfObject &valueObj) |
void | SetViewerPreference (const PdfName &whichPref, bool inValue) |
void | Clear () |
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* pPage = document.CreatePage( PdfPage::CreateStandardPageSize( ePdfPageSize_A4 ) ); PdfFont* pFont = document.CreateFont( "Arial" );
PdfPainter painter; painter.SetPage( pPage ); painter.SetFont( pFont ); painter.DrawText( 56.69, pPage->GetPageSize().GetHeight() - 56.69, "Hello World!" ); painter.FinishPage();
document.Close();
PoDoFo::PdfStreamedDocument::PdfStreamedDocument | ( | PdfOutputDevice * | pDevice, |
EPdfVersion | eVersion = ePdfVersion_Default , |
||
PdfEncrypt * | pEncrypt = NULL , |
||
EPdfWriteMode | eWriteMode = ePdfWriteMode_Default |
||
) |
Create a new PdfStreamedDocument. All data is written to an output device immediately.
pDevice | an output device |
eVersion | 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. |
pEncrypt | pointer to an encryption object or NULL. If not NULL the PdfEncrypt object will be copied and used to encrypt the created document. |
eWriteMode | additional options for writing the pdf |
PoDoFo::PdfStreamedDocument::PdfStreamedDocument | ( | const char * | pszFilename, |
EPdfVersion | eVersion = ePdfVersion_Default , |
||
PdfEncrypt * | pEncrypt = NULL , |
||
EPdfWriteMode | eWriteMode = ePdfWriteMode_Default |
||
) |
Create a new PdfStreamedDocument. All data is written to a file immediately.
pszFilename | resulting PDF file |
eVersion | 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. |
pEncrypt | pointer to an encryption object or NULL. If not NULL the PdfEncrypt object will be copied and used to encrypt the created document. |
eWriteMode | additional options for writing the pdf |
void PoDoFo::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.
|
inlinevirtual |
Get the PDF version of the document
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
|
inlinevirtual |
Checks if it is allowed to extract text and graphics to support users with disabillities Every PDF consuming applications has to adhere this value!
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
Checks if text and graphics extraction is allowed. Every PDF consuming applications has to adhere this value!
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
Checks if it is allowed to insert, create, rotate, delete pages or add bookmarks Every PDF consuming applications has to adhere this value!
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
Checks if modifiying this document (besides annotations, form fields or changing pages) is allowed. Every PDF consuming applications has to adhere this value!
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
Checks if it is allowed to add or modify annotations or form fields Every PDF consuming applications has to adhere this value!
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
Checks if it is allowed to fill in existing form or signature fields Every PDF consuming applications has to adhere this value!
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
Checks if it is allowed to print a high quality version of this document Every PDF consuming applications has to adhere this value!
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
Returns wether this PDF document is linearized, aka weboptimized
Implements PoDoFo::PdfDocument.
|
inlinevirtual |
Checks if printing this document is allowed. Every PDF consuming applications has to adhere this value!
Implements PoDoFo::PdfDocument.