PoDoFo  0.9.4
Public Member Functions | List of all members
PoDoFo::PdfStreamedDocument Class Reference

#include <PdfStreamedDocument.h>

Inheritance diagram for PoDoFo::PdfStreamedDocument:
PoDoFo::PdfDocument

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
 
- Public Member Functions inherited from PoDoFo::PdfDocument
virtual ~PdfDocument ()
 
PdfInfoGetInfo () const
 
PdfOutlinesGetOutlines (bool bCreate=ePdfCreateObject)
 
PdfNamesTree * GetNamesTree (bool bCreate=ePdfCreateObject)
 
PdfAcroForm * GetAcroForm (bool bCreate=ePdfCreateObject, EPdfAcroFormDefaulAppearance eDefaultAppearance=ePdfAcroFormDefaultAppearance_BlackText12pt)
 
PdfPagesTreeGetPagesTree () const
 
int GetPageCount () const
 
PdfPageGetPage (int nIndex) const
 
PdfFontCreateFont (const char *pszFontName, bool bSymbolCharset=false, const PdfEncoding *const pEncoding=PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), PdfFontCache::EFontCreationFlags eFontCreationFlags=PdfFontCache::eFontCreationFlags_AutoSelectBase14, bool bEmbedd=true)
 
PdfFontCreateFont (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)
 
PdfFontCreateFont (FT_Face face, bool bSymbolCharset=false, const PdfEncoding *const pEncoding=PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), bool bEmbedd=true)
 
PdfFontCreateDuplicateFontType1 (PdfFont *pFont, const char *pszSuffix)
 
PdfFontCreateFontSubset (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 ()
 
PdfPageCreatePage (const PdfRect &rSize)
 
void CreatePages (const std::vector< PdfRect > &vecSizes)
 
PdfPageInsertPage (const PdfRect &rSize, int atIndex)
 
const PdfDocumentAppend (const PdfMemDocument &rDoc, bool bAppendAll=true)
 
const PdfDocumentInsertExistingPageAt (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)
 
PdfFileSpecGetAttachment (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)
 
PdfVecObjectsGetObjects ()
 
const PdfVecObjectsGetObjects () const
 
void SetFontConfigWrapper (const PdfFontConfigWrapper &rFontConfig)
 

Additional Inherited Members

- Protected Member Functions inherited from PoDoFo::PdfDocument
 PdfDocument (bool bEmpty=false)
 
void SetInfo (PdfInfo *pInfo)
 
PdfObjectGetCatalog ()
 
const PdfObjectGetCatalog () const
 
void SetCatalog (PdfObject *pObject)
 
PdfObjectGetTrailer ()
 
const PdfObjectGetTrailer () const
 
void SetTrailer (PdfObject *pObject)
 
PdfObjectGetNamedObjectFromCatalog (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 ()
 

Detailed Description

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.

See also
PdfDocument
PdfMemDocument

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();

Constructor & Destructor Documentation

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.

Parameters
pDevicean output device
eVersionthe 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.
pEncryptpointer to an encryption object or NULL. If not NULL the PdfEncrypt object will be copied and used to encrypt the created document.
eWriteModeadditional 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.

Parameters
pszFilenameresulting PDF file
eVersionthe 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.
pEncryptpointer to an encryption object or NULL. If not NULL the PdfEncrypt object will be copied and used to encrypt the created document.
eWriteModeadditional options for writing the pdf

Member Function Documentation

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.

EPdfVersion PoDoFo::PdfStreamedDocument::GetPdfVersion ( ) const
inlinevirtual

Get the PDF version of the document

Returns
EPdfVersion version of the pdf document

Implements PoDoFo::PdfDocument.

EPdfWriteMode PoDoFo::PdfStreamedDocument::GetWriteMode ( ) const
inlinevirtual

Get the write mode used for wirting the PDF

Returns
the write mode

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsAccessibilityAllowed ( ) const
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!

Returns
true if you are allowed to extract text and graphics to support users with disabillities
See also
PdfEncrypt to set own document permissions.

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsCopyAllowed ( ) const
inlinevirtual

Checks if text and graphics extraction is allowed. Every PDF consuming applications has to adhere this value!

Returns
true if you are allowed to extract text and graphics from this document
See also
PdfEncrypt to set own document permissions.

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsDocAssemblyAllowed ( ) const
inlinevirtual

Checks if it is allowed to insert, create, rotate, delete pages or add bookmarks Every PDF consuming applications has to adhere this value!

Returns
true if you are allowed to insert, create, rotate, delete pages or add bookmarks
See also
PdfEncrypt to set own document permissions.

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsEditAllowed ( ) const
inlinevirtual

Checks if modifiying this document (besides annotations, form fields or changing pages) is allowed. Every PDF consuming applications has to adhere this value!

Returns
true if you are allowed to modfiy this document
See also
PdfEncrypt to set own document permissions.

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsEditNotesAllowed ( ) const
inlinevirtual

Checks if it is allowed to add or modify annotations or form fields Every PDF consuming applications has to adhere this value!

Returns
true if you are allowed to add or modify annotations or form fields
See also
PdfEncrypt to set own document permissions.

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsFillAndSignAllowed ( ) const
inlinevirtual

Checks if it is allowed to fill in existing form or signature fields Every PDF consuming applications has to adhere this value!

Returns
true if you are allowed to fill in existing form or signature fields
See also
PdfEncrypt to set own document permissions.

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsHighPrintAllowed ( ) const
inlinevirtual

Checks if it is allowed to print a high quality version of this document Every PDF consuming applications has to adhere this value!

Returns
true if you are allowed to print a high quality version of this document
See also
PdfEncrypt to set own document permissions.

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsLinearized ( ) const
inlinevirtual

Returns wether this PDF document is linearized, aka weboptimized

Returns
true if the PDF document is linearized

Implements PoDoFo::PdfDocument.

bool PoDoFo::PdfStreamedDocument::IsPrintAllowed ( ) const
inlinevirtual

Checks if printing this document is allowed. Every PDF consuming applications has to adhere this value!

Returns
true if you are allowed to print this document
See also
PdfEncrypt to set own document permissions.

Implements PoDoFo::PdfDocument.