PDFix SDK  9.0.0
Loading...
Searching...
No Matches
PdfDoc Struct Referenceabstract

PdfDoc class. More...

#include <pdfix.h>

Public Member Functions

virtual bool Save (const wchar_t *path, PdfSaveFlags save_flags)=0
virtual bool SaveToStream (PsStream *stream, PdfSaveFlags flags)=0
virtual int Close ()=0
 Closes a document and releases its resources. Changes are not saved.
virtual bool Authorize (PdfPermissionLevel perm, PdfGetAuthDataProc callback, void *client_data)=0
virtual bool IsSecured ()=0
 Gets whether the document is secured or not. This means it contains encryption dictionary.
virtual bool SetSecurityHandler (PdfSecurityHandler *handler)=0
 Set the new security handler to the document which will be used when saving the document.
virtual PdfSecurityHandlerGetSecurityHandler ()=0
 Get the current security handler of the document.
virtual int GetNumPages () const =0
 Gets the number of pages in a document.
virtual PdfPageAcquirePage (int page_num)=0
virtual PdfPageCreatePage (int index, const PdfRect *media_box)=0
virtual bool DeletePages (int index_from, int index_to)=0
 Deletes the specified pages.
virtual bool InsertPages (int index, const PdfDoc *doc, int index_from, int index_to, PdfPageInsertFlags insert_flags)=0
virtual bool MovePage (int index_to, int index_from)=0
 Moves one page in a document.
virtual int GetNumDocumentJavaScripts ()=0
 Gets the number of document JavaScript name/action pairs in the document JavaScript name tree.
virtual int GetDocumentJavaScript (int index, wchar_t *buffer, int len)=0
 Gets the document JavaScript action by it's index in th documente JavaScript name tree.
virtual int GetDocumentJavaScriptName (int index, wchar_t *buffer, int len)=0
 Gets the document JavaScript action name by it's index in th documente JavaScript name tree.
virtual int GetNumCalculatedFormFields ()=0
 Gets the number of calculated form fields in AcroForm calculated order (CO) which is an array.
virtual PdfFormFieldGetCalculatedFormField (int index)=0
 Gets the calculated form field from AcroForm calculation order array (CO) by index.
virtual int GetNumFormFields ()=0
 Gets the total number of form fields in document's AcroForm Fields tree.
virtual PdfFormFieldGetFormField (int index)=0
 Gets the form field in document's AcroForm Fields tree by index.
virtual PdfFormFieldGetFormFieldByName (const wchar_t *buffer)=0
 Gets the form field in document's AcroForm Fields tree by name.
virtual int GetInfo (const wchar_t *key, wchar_t *buffer, int len)=0
 Gets the value of a key in a document's Info dictionary.
virtual bool SetInfo (const wchar_t *key, const wchar_t *info)=0
 Sets the value of a key in a document's Info dictionary.
virtual PdfBookmarkGetBookmarkRoot ()=0
virtual PdfBookmarkCreateBookmarkRoot ()=0
virtual bool ApplyRedaction ()=0
 Apply redaction annotations to the document content.
virtual int GetNumAlternates () const =0
 Gets the number of PDF alternate in the document.
virtual PdfAlternateAcquireAlternate (int index)=0
virtual bool AddTags (const PdfTagsParams *tag_params)=0
 Add tags into document.
virtual bool RemoveTags ()=0
virtual PdfDocTemplateGetTemplate ()=0
 Accesses document template.
virtual PdsStreamGetMetadata ()=0
 Gets documnent metadata object.
virtual int GetLang (wchar_t *buffer, int len) const =0
 Gets documnent primary language.
virtual bool SetLang (const wchar_t *lang)=0
 Sets documnent primary language.
virtual bool ReplaceFont (PdfFont *font, const wchar_t *face_name)=0
 Replace font used with font installed on the system.
virtual bool EmbedFont (PdfFont *font, bool subset)=0
 Embeds or subsets specified font used in the document.
virtual bool EmbedFonts (bool subset)=0
 Embeds or subsets fonts used in the document.
virtual PdsDictionaryGetTrailerObject ()=0
 Gets the document trailer dictionary.
virtual PdsDictionaryGetRootObject ()=0
 Gets the document catalog dictionary which is a Root entry.
virtual PdsDictionaryGetInfoObject ()=0
 Gets the Info dictionary of the document.
virtual PdsDictionaryCreateDictObject (bool indirect)=0
 Create new PdsDictionary object.
virtual PdsArrayCreateArrayObject (bool indirect)=0
 Create new PdsArray object.
virtual PdsBooleanCreateBooleanObject (bool indirect, bool value)=0
 Create new PdsBoolean object.
virtual PdsNameCreateNameObject (bool indirect, const wchar_t *value)=0
 Create new PdsName object.
virtual PdsStringCreateStringObject (bool indirect, const wchar_t *value, bool hex)=0
 Create new PdsString object.
virtual PdsNumberCreateIntObject (bool indirect, int value)=0
 Create new PdsNumber (integer) object.
virtual PdsNumberCreateNumberObject (bool indirect, float value)=0
 Create new PdsNumber (float) object.
virtual PdsStreamCreateStreamObject (bool indirect, PdsDictionary *dict, const uint8_t *buffer, int size)=0
 Create new PdsStream object.
virtual PdsStreamCreateXObjectFromImage (PsStream *image_data, PdfImageFormat format, int page_index)=0
virtual PdsStreamCreateXObjectFromPage (PdfPage *page)=0
 Create new XObject of the type Form from page.
virtual PdsObjectGetObjectById (int obj_id)=0
 Get the document object by number.
virtual PdsStructTreeCreateStructTree ()=0
virtual PdsStructTreeGetStructTree ()=0
 Gets the Struct Tree root object of the document.
virtual bool RemoveStructTree ()=0
virtual bool RemoveBookmarks ()=0
 Removes all bookmarks from the document.
virtual bool CreateBookmarks ()=0
 Create bookmark tree from the document's structure tree headings.
virtual bool AddFontMissingUnicode ()=0
 Search used font's characters and add appropriate unicode character if not present.
virtual PdfNameTreeGetNameTree (const wchar_t *name, bool create)=0
virtual bool RemoveNameTree (const wchar_t *name)=0
 Removes the name tree in the Names dictionary with the specified key name it that name exists.
virtual int GetPageNumFromObject (PdsObject *page_dict)=0
 Gets the page number of the page specified by a page dictionary.
virtual PdfAnnotGetAnnotFromObject (PdsObject *annot_dict)=0
 Gets the PdfAnnot object from a PdsObject.
virtual PdfBookmarkGetBookmarkFromObject (PdsObject *bookmark_obj)=0
 Creates the PdfBookmark object from a PdsObject.
virtual PdfActionGetActionFromObject (PdsObject *action_obj)=0
 Creates the PdfAction object from a PdsObject.
virtual PdfActionGetActionFromViewDest (PdfViewDestination *dest)=0
virtual PdfViewDestinationGetViewDestinationFromObject (PdsObject *dest_obj)=0
 Creates the PdfViewDestination object from a PdsObject.
virtual PdfViewDestinationCreateViewDestination (int page_num, PdfDestFitType fit_type, const PdfRect *rect, float zoom)=0
 Creates a new PdfViewDestination object.
virtual PdsFormCreateFormFromObject (PdsStream *stream, PdfMatrix *matrix)=0
 Create the PdsForm object from a PdsStream.
virtual PdfActionCreateAction (PdfActionType type)=0
 Create new PdfAction object.
virtual PdsContentCreateContent ()=0
 Create new PdsContent object.
virtual PdfColorSpaceCreateColorSpace (PdfColorSpaceFamily cs_family)=0
 Create new PdfColorSpace object.
virtual PdfFontCreateFont (PsSysFont *sys_font, PdfFontCharset charset, PdfFontCreateFlags flags)=0
 Create new PdfFont object.
virtual PdfDocUndoCreateUndo (const wchar_t *title, void *client_data)=0
 Create new PdfDocUndo object and push it to the edn of the document's undo stack.
virtual int GetNumUndos () const =0
 Get the number of available document's PdfDocUndo objects in undo stack.
virtual PdfDocUndoGetUndo (int index)=0
 Get the PdfDocUndo objects in undo stack by index.
virtual bool ClearUndos (int index)=0
 Clear document's undo stack.
virtual int GetNumRedos () const =0
 Get the number of available document's PdfDocUndo objects in redo stack.
virtual PdfDocUndoGetRedo (int index)=0
 Get the PdfDocUndo objects in undo stack by index.
virtual bool ClearRedos (int count)=0
 Clear document's redo stack.
virtual PdfDocFlags GetFlags ()=0
 Get the document flags.
virtual bool SetFlags (PdfDocFlags flags)=0
 Get the document flags.
virtual bool ClearFlags ()=0
 Clears the document flags. This method marks a modified document as clean.
virtual PdfUserPermissionFlags GetUserPermissions ()=0
 Get the document user permissions.
virtual int GetVersion ()=0
 Get the document's PDF version. For example value for PDF version 1.2 is 12.
virtual bool SetVersion (int version)=0
 Set the document's PDF version. For example value for PDF version 1.2 is 12.
virtual PdfStandardFlags GetPdfStandard ()=0
 Gets the document's PDF compliance level with PDF standards.
virtual bool SetPdfStandard (PdfStandardFlags flags, const wchar_t *part)=0
virtual int GetPath (wchar_t *path, int len)=0
virtual bool SetPath (const wchar_t *path)=0
virtual PdfHtmlConversionCreateHtmlConversion ()=0
virtual PdfJsonConversionCreateJsonConversion ()=0
virtual PdfTiffConversionCreateTiffConversion ()=0
virtual PsCommandGetCommand ()=0
 Creates a PsCommand object.
virtual PdfEnumResultType EnumFonts (PdfEnumFlags flags, PdfFontEnumProc proc, void *client_data)=0
virtual PdfEnumResultType EnumBookmarks (PdfBookmark *bmk, PdfEnumFlags flags, PdfBookmarkEnumProc proc, void *client_data)=0
virtual PdfEnumResultType EnumAnnots (int page_num, PdfEnumFlags flags, PdfAnnotEnumProc proc, void *client_data)=0
virtual PdfEnumResultType EnumPageObjects (PdsContent *content, PdsPageObject *object, PdfEnumFlags flags, PdfPageObjectEnumProc proc, void *client_data)=0
virtual PdfEnumResultType EnumStructTree (PdsStructElement *structElem, PdfEnumFlags flags, PdfStructElemEnumProc proc, void *client_data)=0
virtual PsProgressControlGetProgressControl ()=0
virtual PdsFileSpecCreateFileSpec (const wchar_t *name, const wchar_t *desc, const wchar_t *af_relationship, const wchar_t *subtype, const uint8_t *buffer, int size)=0
 Creates a File specification dictionary from data.
virtual PdfObjectInfoAcquireObjectInfo (const wchar_t *path)=0

Detailed Description

PdfDoc class.

A PdfDoc object represents a PDF document.

Member Function Documentation

◆ AcquireAlternate()

virtual PdfAlternate * PdfDoc::AcquireAlternate ( int index)
pure virtual

Gets the PDF alternate based on it's index. NOTE: Acquisition of the alternate increments document reference count.

Parameters
indexThe index of an alternate.

◆ AcquireObjectInfo()

virtual PdfObjectInfo * PdfDoc::AcquireObjectInfo ( const wchar_t * path)
pure virtual

◆ AcquirePage()

virtual PdfPage * PdfDoc::AcquirePage ( int page_num)
pure virtual

Gets a PdfPage from a document. The page is cached, so that subsequent calls on the same PDPage return The same PdfPage and increments the reference count. The page remains in the cache as long as document exists or PdfPage::Release was not called. AcquirePage increments a page's reference count. The page will not be released until the reference count is zero, or the application terminates. NOTE: After you are done using the page, release it using PdfPage::Release to release resources. NOTE: Acquisition of the page increments document reference count.

Parameters
page_numThe page number of the page to get. The first page is 0.
Returns
The requested page.
See also
PdfPage::Release

◆ AddFontMissingUnicode()

virtual bool PdfDoc::AddFontMissingUnicode ( )
pure virtual

Search used font's characters and add appropriate unicode character if not present.

Returns
true if successfull. false otherwise
See also
PdfDoc::EmbedFonts

◆ AddTags()

virtual bool PdfDoc::AddTags ( const PdfTagsParams * tag_params)
pure virtual

Add tags into document.

Parameters
tag_paramsPdfTagsParams structure definiing the tagattributes or null to use default settings;
Returns
true if tags were added successfuly, false otherwise.

◆ ApplyRedaction()

virtual bool PdfDoc::ApplyRedaction ( )
pure virtual

Apply redaction annotations to the document content.

Returns
true if doument redaction was successfull, false otherwise.

TODO: PdfRedactionParams* params

◆ Authorize()

virtual bool PdfDoc::Authorize ( PdfPermissionLevel perm,
PdfGetAuthDataProc callback,
void * client_data )
pure virtual

Authorize/Unlock the secured document. This should be called after opening the document without

Parameters
permlevel of permission (user/owner)
callbackto get the required authorization data that will be set to a security handler
dataadditional user supplied data that will be passed to the callback
Returns
true if document was authorized succsessfully, false otherwise.

◆ ClearFlags()

virtual bool PdfDoc::ClearFlags ( )
pure virtual

Clears the document flags. This method marks a modified document as clean.

Returns
true if the flags was cleared successfuly

◆ ClearRedos()

virtual bool PdfDoc::ClearRedos ( int count)
pure virtual

Clear document's redo stack.

Parameters
countThe number of the entries to keep in redo stack.
Returns
true if the the redo stack was cleard successfuly

◆ ClearUndos()

virtual bool PdfDoc::ClearUndos ( int index)
pure virtual

Clear document's undo stack.

Parameters
countThe number of the entries to keep in undo stack.
Returns
true if the the undo stack was cleard successfuly

◆ Close()

virtual int PdfDoc::Close ( )
pure virtual

Closes a document and releases its resources. Changes are not saved.

Returns
number of references to the document, returns -1 if the document wasn't closed successfully
See also
PdfDoc::Save

◆ CreateAction()

virtual PdfAction * PdfDoc::CreateAction ( PdfActionType type)
pure virtual

Create new PdfAction object.

Parameters
typeThe PdfActiontype which should be created.
Returns
PdsContent.

◆ CreateArrayObject()

virtual PdsArray * PdfDoc::CreateArrayObject ( bool indirect)
pure virtual

Create new PdsArray object.

Parameters
indirectif true the method creates indorect object otherwise a direct object.
Returns
newly created PdsArray object.

◆ CreateBookmarkRoot()

virtual PdfBookmark * PdfDoc::CreateBookmarkRoot ( )
pure virtual

Creates the abstract root of the document's bookmark tree if does not exist. This bookmark has no representation in PDF, it only holds top level of document's bookmarks. NOTE: Call only PdfBookmark::GetNumChildren and PdfBookmark::GetChild PdfBookmark::AddNewChild methods for this bookmark. Other methods return false.

Returns
The document's root bookmark. Sample GetBookmarks
See also
PdfDoc::GetBookmarkRoot

◆ CreateBookmarks()

virtual bool PdfDoc::CreateBookmarks ( )
pure virtual

Create bookmark tree from the document's structure tree headings.

Returns
true if successfull. false otherwise
See also
PdfDoc::RemoveBookmarks

◆ CreateBooleanObject()

virtual PdsBoolean * PdfDoc::CreateBooleanObject ( bool indirect,
bool value )
pure virtual

Create new PdsBoolean object.

Parameters
indirectif true the methods indorect object otherwise a direct object.
valuethe value to be set to an object.
Returns
newly created PdsBoolean object.

◆ CreateColorSpace()

virtual PdfColorSpace * PdfDoc::CreateColorSpace ( PdfColorSpaceFamily cs_family)
pure virtual

Create new PdfColorSpace object.

Parameters
cs_familyColor space family of the color space to be created. The family must be one of the following: kColorSpaceDeviceCMYK, kColorSpaceDeviceGray, or kColorSpaceDeviceRGB.
Returns
the newly created color space.

◆ CreateContent()

virtual PdsContent * PdfDoc::CreateContent ( )
pure virtual

Create new PdsContent object.

Returns
PdsContent.

◆ CreateDictObject()

virtual PdsDictionary * PdfDoc::CreateDictObject ( bool indirect)
pure virtual

Create new PdsDictionary object.

Parameters
indirectif true the method creates indorect object otherwise a direct object.
Returns
newly created PdsDictionary object.

◆ CreateFileSpec()

virtual PdsFileSpec * PdfDoc::CreateFileSpec ( const wchar_t * name,
const wchar_t * desc,
const wchar_t * af_relationship,
const wchar_t * subtype,
const uint8_t * buffer,
int size )
pure virtual

Creates a File specification dictionary from data.

Parameters
nameA name of the file specification
descA description of the file specification
af_relationshipA name value that represents the relationship between thecomponent of this PDF document that refers to this file specification and the associated file denoted by this file specification dictionary
subtype(Optional, required in the case of an embedded file stream used as as associated file) The subtype of the embedded file. The value of this entry shall conform to the MIME media type names defined in Internet RFC 2046, Multipurpose Internet Mail Extensions (MIME)
bufferA buffer holding the data that is to be written. The buffer must be able to hold at least count bytes.
sizeThe number of bytes to write.
Returns
The newly created document conversion or null if operation failed.

◆ CreateFont()

virtual PdfFont * PdfDoc::CreateFont ( PsSysFont * sys_font,
PdfFontCharset charset,
PdfFontCreateFlags flags )
pure virtual

Create new PdfFont object.

Parameters
sys_fontSystem font from which PdfFont will eb created. See Pdfix::FindSysFont
charsetCharset of the font kFontAnsiCharset.
flagsCurrently only kFontCreateNormal is supported.
Returns
the newly created font

◆ CreateFormFromObject()

virtual PdsForm * PdfDoc::CreateFormFromObject ( PdsStream * stream,
PdfMatrix * matrix )
pure virtual

Create the PdsForm object from a PdsStream.

Parameters
streamThe PdsObject from which the content will be obtained.
Returns
PdsForm.

◆ CreateHtmlConversion()

virtual PdfHtmlConversion * PdfDoc::CreateHtmlConversion ( )
pure virtual

Creates a HTML conversion from PdfDoc. NOTE: You must call PdfConversion::Destroy once for every successful create.

Returns
The newly created document conversion or null if operation failed.
See also
PdfConversion::Destroy

◆ CreateIntObject()

virtual PdsNumber * PdfDoc::CreateIntObject ( bool indirect,
int value )
pure virtual

Create new PdsNumber (integer) object.

Parameters
indirectif true the method creates indorect object otherwise a direct object.
valuethe value to be set to an object.
Returns
newly created PdsNumber object.

◆ CreateJsonConversion()

virtual PdfJsonConversion * PdfDoc::CreateJsonConversion ( )
pure virtual

Creates a JSON conversion from PdfDoc. NOTE: You must call PdfConversion::Destroy once for every successful create.

Returns
The newly created document conversion or null if operation failed.
See also
PdfConversion::Destroy

◆ CreateNameObject()

virtual PdsName * PdfDoc::CreateNameObject ( bool indirect,
const wchar_t * value )
pure virtual

Create new PdsName object.

Parameters
indirectif true the methods indorect object otherwise a direct object.
valuethe value to be set to an object.
Returns
newly created PdsName object.

◆ CreateNumberObject()

virtual PdsNumber * PdfDoc::CreateNumberObject ( bool indirect,
float value )
pure virtual

Create new PdsNumber (float) object.

Parameters
indirectif true the method creates indorect object otherwise a direct object.
valuethe value to be set to an object.
Returns
newly created PdsNumber object.

◆ CreatePage()

virtual PdfPage * PdfDoc::CreatePage ( int index,
const PdfRect * media_box )
pure virtual

Creates and acquires a new page. The page is inserted into the document at the specified location. NOTE: After you are done using the page, release it using PdfPage::Release to release resources. NOTE: Acquisition of the page increments document reference count.

Parameters
indexWhere to add the page. Passing a value of kInsertAfterLast adds the page to the end. Passing a value of kInsertBeforeFirst adds the page to the beginning of the document.
mediaBoxRectangle specifying the page's media box.
Returns
The newly created page.
See also
PdfPage::Release

◆ CreateStreamObject()

virtual PdsStream * PdfDoc::CreateStreamObject ( bool indirect,
PdsDictionary * dict,
const uint8_t * buffer,
int size )
pure virtual

Create new PdsStream object.

Parameters
indirectif true the method creates indorect object otherwise a direct object.
dictthe stream dictionary object.
bufferdata to be set a a stream value.
sizethe size of the buffer in bytes.
Returns
newly created PdsStream object.

◆ CreateStringObject()

virtual PdsString * PdfDoc::CreateStringObject ( bool indirect,
const wchar_t * value,
bool hex )
pure virtual

Create new PdsString object.

Parameters
indirectif true the method creates indorect object otherwise a direct object.
valuethe value to be set to an object.
Returns
newly created PdsString object.

◆ CreateStructTree()

virtual PdsStructTree * PdfDoc::CreateStructTree ( )
pure virtual

Creates the Struct Tree root object of the document. If PdfDoc already has a StructTree it returns the existing structure tree.

Returns
PdsStructTree object that represents document struct tree root.

◆ CreateTiffConversion()

virtual PdfTiffConversion * PdfDoc::CreateTiffConversion ( )
pure virtual

Creates a TIFF document from PdfDoc. NOTE: You must call PdfConversion::Destroy once for every successful create.

Returns
The newly created document conversion or null if operation failed.
See also
PdfConversion::Destroy

◆ CreateUndo()

virtual PdfDocUndo * PdfDoc::CreateUndo ( const wchar_t * title,
void * client_data )
pure virtual

Create new PdfDocUndo object and push it to the edn of the document's undo stack.

Parameters
titlethe display name of the undo
Returns
the newly created undo object

◆ CreateViewDestination()

virtual PdfViewDestination * PdfDoc::CreateViewDestination ( int page_num,
PdfDestFitType fit_type,
const PdfRect * rect,
float zoom )
pure virtual

Creates a new PdfViewDestination object.

Parameters
page_numA number of the destination page.
fit_typeThe destination fit type.
rectA pointer to an PdfRect strucutre specifying the destination rectangle, specified in user space coordinates.
zoomThe zoom factor to set for the destination. Used only if fit_type is PdfDestFitType::kDestFitXYZ.
Returns
the newly created destination object

◆ CreateXObjectFromImage()

virtual PdsStream * PdfDoc::CreateXObjectFromImage ( PsStream * image_data,
PdfImageFormat format,
int page_index )
pure virtual

Create new XObject of the type Image from an image data. Supported image types are JPEG and PNG

Parameters
image_dataThe image data
formatThe format of the he image
page_indexIndex of the page in the image file. Default value is 0 for single page images.
Returns
Newly created PdsStream object of the XObject.

◆ CreateXObjectFromPage()

virtual PdsStream * PdfDoc::CreateXObjectFromPage ( PdfPage * page)
pure virtual

Create new XObject of the type Form from page.

Parameters
pageThe page to convert to Form
Returns
Newly created PdsStream object of the XObject.

◆ DeletePages()

virtual bool PdfDoc::DeletePages ( int index_from,
int index_to )
pure virtual

Deletes the specified pages.

Parameters
index_fromThe page number of the first page to delete. The first page is 0.
index_toThe page number of the last page to delete.
Returns
true if pages were deleted succsessfully, false otherwise.

◆ EmbedFont()

virtual bool PdfDoc::EmbedFont ( PdfFont * font,
bool subset )
pure virtual

Embeds or subsets specified font used in the document.

Parameters
fontFont to subest, has to be used in the document
subsetIf true, embeds each font inside doc with creating a subset.
Returns
true if the was embedded successfully
See also
PdfDoc::AddFontMissingUnicode
PdfDoc::EmbedFonts

◆ EmbedFonts()

virtual bool PdfDoc::EmbedFonts ( bool subset)
pure virtual

Embeds or subsets fonts used in the document.

Parameters
subsetIf true, embeds each font inside doc with creating a subset.
Returns
true if the was embedded successfully
See also
PdfDoc::AddFontMissingUnicode
PdfDoc::EmbedFont

◆ EnumAnnots()

virtual PdfEnumResultType PdfDoc::EnumAnnots ( int page_num,
PdfEnumFlags flags,
PdfAnnotEnumProc proc,
void * client_data )
pure virtual

◆ EnumBookmarks()

virtual PdfEnumResultType PdfDoc::EnumBookmarks ( PdfBookmark * bmk,
PdfEnumFlags flags,
PdfBookmarkEnumProc proc,
void * client_data )
pure virtual

◆ EnumFonts()

virtual PdfEnumResultType PdfDoc::EnumFonts ( PdfEnumFlags flags,
PdfFontEnumProc proc,
void * client_data )
pure virtual

◆ EnumPageObjects()

virtual PdfEnumResultType PdfDoc::EnumPageObjects ( PdsContent * content,
PdsPageObject * object,
PdfEnumFlags flags,
PdfPageObjectEnumProc proc,
void * client_data )
pure virtual

◆ EnumStructTree()

virtual PdfEnumResultType PdfDoc::EnumStructTree ( PdsStructElement * structElem,
PdfEnumFlags flags,
PdfStructElemEnumProc proc,
void * client_data )
pure virtual

◆ GetActionFromObject()

virtual PdfAction * PdfDoc::GetActionFromObject ( PdsObject * action_obj)
pure virtual

Creates the PdfAction object from a PdsObject.

Parameters
action_objThe action object from which the action will be obtained.
Returns
the newly created action

◆ GetActionFromViewDest()

virtual PdfAction * PdfDoc::GetActionFromViewDest ( PdfViewDestination * dest)
pure virtual

Creates a new action that takes the user to the specified destination view. This method can only be used for destinations in the same document as the source document.

Parameters
destThe destination view.
Returns
the newly created action

◆ GetAnnotFromObject()

virtual PdfAnnot * PdfDoc::GetAnnotFromObject ( PdsObject * annot_dict)
pure virtual

Gets the PdfAnnot object from a PdsObject.

Parameters
annot_dictThe annotation dictionary object from which the annotation will be obtained.
Returns
the newly created annotation

◆ GetBookmarkFromObject()

virtual PdfBookmark * PdfDoc::GetBookmarkFromObject ( PdsObject * bookmark_obj)
pure virtual

Creates the PdfBookmark object from a PdsObject.

Parameters
bookmark_objThe bookmark object from which the action will be obtained.
Returns
the newly created bookmark

◆ GetBookmarkRoot()

virtual PdfBookmark * PdfDoc::GetBookmarkRoot ( )
pure virtual

Gets the abstract root of the document's bookmark tree. This bookmark has no representation in PDF, it only holds top level of document's bookmarks. NOTE: Call only PdfBookmark::GetNumChildren and PdfBookmark::GetChild PdfBookmark::AddNewChild methods for this bookmark. Other methods return false.

Returns
The document's root bookmark or null object if does not exist. Sample GetBookmarks
See also
PdfDoc::CreateBookmarkRoot

◆ GetCalculatedFormField()

virtual PdfFormField * PdfDoc::GetCalculatedFormField ( int index)
pure virtual

Gets the calculated form field from AcroForm calculation order array (CO) by index.

Parameters
indexThe index of a form field to retrieve.
Returns
The PdfFormField object or nullptr in case of error.
See also
PdfDoc::GetNumCalculatedFormFields
PdfDoc::GetNumFormFieldCounts
PdfDoc:GetFormField

◆ GetCommand()

virtual PsCommand * PdfDoc::GetCommand ( )
pure virtual

Creates a PsCommand object.

Returns
The newly created document utils object or null if operation failed.
See also
PdfConversion::Destroy

◆ GetDocumentJavaScript()

virtual int PdfDoc::GetDocumentJavaScript ( int index,
wchar_t * buffer,
int len )
pure virtual

Gets the document JavaScript action by it's index in th documente JavaScript name tree.

Parameters
indexThe index of a JavaScript action name to retrieve
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.
See also
PdfDoc::GetNumDocumentJavaScripts
PdfDoc::GetDocumentJavaScriptName

◆ GetDocumentJavaScriptName()

virtual int PdfDoc::GetDocumentJavaScriptName ( int index,
wchar_t * buffer,
int len )
pure virtual

Gets the document JavaScript action name by it's index in th documente JavaScript name tree.

Parameters
indexThe index of a JavaScript action name to retrieve
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.
See also
PdfDoc::GetNumDocumentJavaScripts
PdfDoc::GetDocumentJavaScript

◆ GetFlags()

virtual PdfDocFlags PdfDoc::GetFlags ( )
pure virtual

Get the document flags.

Returns
Flags field, containing an OR of the PdfDocFlags values

◆ GetFormField()

virtual PdfFormField * PdfDoc::GetFormField ( int index)
pure virtual

Gets the form field in document's AcroForm Fields tree by index.

Returns
The PdfFormField object or nullptr in case of error.
See also
PdfDoc::GetNumCalculatedFormFields
PdfDoc::GetCalculatedFormField
PdfDoc::GetNumFormFieldCounts

◆ GetFormFieldByName()

virtual PdfFormField * PdfDoc::GetFormFieldByName ( const wchar_t * buffer)
pure virtual

Gets the form field in document's AcroForm Fields tree by name.

Returns
The PdfFormField object or nullptr in case of error.
See also
PdfDoc::GetNumCalculatedFormFields
PdfDoc::GetCalculatedFormField
PdfDoc::GetNumFormFieldCounts

◆ GetInfo()

virtual int PdfDoc::GetInfo ( const wchar_t * key,
wchar_t * buffer,
int len )
pure virtual

Gets the value of a key in a document's Info dictionary.

Parameters
keyThe name of the Info dictionary key whose value is obtained.
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ GetInfoObject()

virtual PdsDictionary * PdfDoc::GetInfoObject ( )
pure virtual

Gets the Info dictionary of the document.

Returns
PdsObject that represents document root.

◆ GetLang()

virtual int PdfDoc::GetLang ( wchar_t * buffer,
int len ) const
pure virtual

Gets documnent primary language.

A language identifier that shall specify the natural language for all text in the document except where overridden by language specifications for structure elements or marked content.

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.
See also
PdfDoc::SetLang

◆ GetMetadata()

virtual PdsStream * PdfDoc::GetMetadata ( )
pure virtual

Gets documnent metadata object.

Returns
PdsStream object if such exists, nullptr otherwise.

◆ GetNameTree()

virtual PdfNameTree * PdfDoc::GetNameTree ( const wchar_t * name,
bool create )
pure virtual

Get a name tree, with the key name specified in the tree, from the Names dictionary of the PdfDoc

Parameters
nameThe name of requested tree.
createCreate the tree if the tree with requested name does not exist.

◆ GetNumAlternates()

virtual int PdfDoc::GetNumAlternates ( ) const
pure virtual

Gets the number of PDF alternate in the document.

Returns
The number of alternates.

◆ GetNumCalculatedFormFields()

virtual int PdfDoc::GetNumCalculatedFormFields ( )
pure virtual

Gets the number of calculated form fields in AcroForm calculated order (CO) which is an array.

Returns
Number of calculated form fields in the document.
See also
PdfDoc::GetCalculatedFormField
PdfDoc::GetNumFormFieldCounts
PdfDoc:GetFormField

◆ GetNumDocumentJavaScripts()

virtual int PdfDoc::GetNumDocumentJavaScripts ( )
pure virtual

Gets the number of document JavaScript name/action pairs in the document JavaScript name tree.

Returns
Number document name/action pairs in the document's JavaScript name tree.
See also
PdfDoc::GetDocumentJavaScript
PdfDoc::GetDocumentJavaScriptName

◆ GetNumFormFields()

virtual int PdfDoc::GetNumFormFields ( )
pure virtual

Gets the total number of form fields in document's AcroForm Fields tree.

Returns
Number of form fields in the document.
See also
PdfDoc::GetNumCalculatedFormFields
PdfDoc::GetCalculatedFormField
PdfDoc:GetFormField

◆ GetNumPages()

virtual int PdfDoc::GetNumPages ( ) const
pure virtual

Gets the number of pages in a document.

Returns
Number of pages in the document.

◆ GetNumRedos()

virtual int PdfDoc::GetNumRedos ( ) const
pure virtual

Get the number of available document's PdfDocUndo objects in redo stack.

Returns
Number of undos in the the document.

◆ GetNumUndos()

virtual int PdfDoc::GetNumUndos ( ) const
pure virtual

Get the number of available document's PdfDocUndo objects in undo stack.

Returns
Number of undos in the the document.

◆ GetObjectById()

virtual PdsObject * PdfDoc::GetObjectById ( int obj_id)
pure virtual

Get the document object by number.

Parameters
obj_idThe number of the object to retrieve
Returns
Corresponding object or null if no such object exists in the document

◆ GetPageNumFromObject()

virtual int PdfDoc::GetPageNumFromObject ( PdsObject * page_dict)
pure virtual

Gets the page number of the page specified by a page dictionary.

Parameters
page_dictThe page dictionary object whose number is obtained.
Returns
the page number in the document.
See also
PdfDoc::AcquirePage

◆ GetPath()

virtual int PdfDoc::GetPath ( wchar_t * path,
int len )
pure virtual

Retrieves the path from which the PDF was opened. If the document was accessed from memory or a custom stream, the function returns empty string or the path set by the PdfDoc::SetPath method.

Parameters
pathThe document path to be set.
Returns
Number of characters written into buffer of required length.
See also
PdfDoc::SetPath

◆ GetPdfStandard()

virtual PdfStandardFlags PdfDoc::GetPdfStandard ( )
pure virtual

Gets the document's PDF compliance level with PDF standards.

Returns
PDF compliance level

◆ GetProgressControl()

virtual PsProgressControl * PdfDoc::GetProgressControl ( )
pure virtual

◆ GetRedo()

virtual PdfDocUndo * PdfDoc::GetRedo ( int index)
pure virtual

Get the PdfDocUndo objects in undo stack by index.

Parameters
indexThe index of the undo object in redo stack.
Returns
The PdfDocUndo object.

◆ GetRootObject()

virtual PdsDictionary * PdfDoc::GetRootObject ( )
pure virtual

Gets the document catalog dictionary which is a Root entry.

Returns
PdsObject that represents document root.

◆ GetSecurityHandler()

virtual PdfSecurityHandler * PdfDoc::GetSecurityHandler ( )
pure virtual

Get the current security handler of the document.

Returns
pointer to PdfSecurityHandler, null in case there is not security handler

◆ GetStructTree()

virtual PdsStructTree * PdfDoc::GetStructTree ( )
pure virtual

Gets the Struct Tree root object of the document.

Returns
PdsStructTree object that represents document struct tree root.

◆ GetTemplate()

virtual PdfDocTemplate * PdfDoc::GetTemplate ( )
pure virtual

Accesses document template.

Returns
true if successfull, false otherwise.

◆ GetTrailerObject()

virtual PdsDictionary * PdfDoc::GetTrailerObject ( )
pure virtual

Gets the document trailer dictionary.

Returns
PdsObject that represents document trailer.

◆ GetUndo()

virtual PdfDocUndo * PdfDoc::GetUndo ( int index)
pure virtual

Get the PdfDocUndo objects in undo stack by index.

Parameters
indexThe index of the undo object in undo stack.
Returns
The PdfDocUndo object.

◆ GetUserPermissions()

virtual PdfUserPermissionFlags PdfDoc::GetUserPermissions ( )
pure virtual

Get the document user permissions.

Returns
Flags field, containing an OR of the PdfUserPermissionFlags values

◆ GetVersion()

virtual int PdfDoc::GetVersion ( )
pure virtual

Get the document's PDF version. For example value for PDF version 1.2 is 12.

Returns
the document PDF version

◆ GetViewDestinationFromObject()

virtual PdfViewDestination * PdfDoc::GetViewDestinationFromObject ( PdsObject * dest_obj)
pure virtual

Creates the PdfViewDestination object from a PdsObject.

Parameters
dest_objThe view destination object from which the object will be obtained.
Returns
the newly created destination object

◆ InsertPages()

virtual bool PdfDoc::InsertPages ( int index,
const PdfDoc * doc,
int index_from,
int index_to,
PdfPageInsertFlags insert_flags )
pure virtual

Inserts pages from input doc into the current doc. All annotations, and anything else associated with the page (such as a thumbnail image) are copied from the doc pages to the new pages in doc. The insertFlags control whether data are inserted along with the specified pages.

Parameters
indexThe page number in the current doc after where pages from doc are inserted.
docThe document containing the pages that are inserted into the current doc.
index_fromThe page number of the first page of doc to insert.
index_toThe page number of the last page of doc to insert.
insert_flagsFlags that determine what additional information is copied from doc.
Returns
true if pages were inserted succsessfully, false otherwise.

◆ IsSecured()

virtual bool PdfDoc::IsSecured ( )
pure virtual

Gets whether the document is secured or not. This means it contains encryption dictionary.

Returns
true if the document is secured, false otherwise

◆ MovePage()

virtual bool PdfDoc::MovePage ( int index_to,
int index_from )
pure virtual

Moves one page in a document.

Parameters
index_toThe new location of the page to move.
index_fromThe page number of the page to move.
Returns
true if page was moved succsessfully, false otherwise.

◆ RemoveBookmarks()

virtual bool PdfDoc::RemoveBookmarks ( )
pure virtual

Removes all bookmarks from the document.

Returns
true if remove operation was successfull, false otherwise
See also
PdfDoc::CreateBookmarks

◆ RemoveNameTree()

virtual bool PdfDoc::RemoveNameTree ( const wchar_t * name)
pure virtual

Removes the name tree in the Names dictionary with the specified key name it that name exists.

Parameters
nameThe name of requested tree to remove.
Returns
true if remove operation was successfull, false otherwise

◆ RemoveStructTree()

virtual bool PdfDoc::RemoveStructTree ( )
pure virtual

Removes and destroy the StructTreeRoot element from the specified PdfDoc. This methods doesn't remove marked-content from pages. To do that each page needs to be acquired with CPdfDoc::AcquirePage and marked-content needs to be removed. To be sure that all structural elements were removed, rather call PdfDoc::RemoveTags.

Returns
true if remove operation was successfull, false otherwise
See also
PdfDoc::RemoveTags

◆ RemoveTags()

virtual bool PdfDoc::RemoveTags ( )
pure virtual

Remove tags and all structural elements from the document. This method is internally called in CPdfDoc::AddTags method to be sure that all previous tags were removed.

◆ ReplaceFont()

virtual bool PdfDoc::ReplaceFont ( PdfFont * font,
const wchar_t * face_name )
pure virtual

Replace font used with font installed on the system.

Parameters
fontFont to subest, has to be used in the document
face_nameA face name to be used or null if any font can be used
Returns
true if the was embedded successfully
See also
PdfDoc::AddFontMissingUnicode
PdfDoc::EmbedFont

◆ Save()

virtual bool PdfDoc::Save ( const wchar_t * path,
PdfSaveFlags save_flags )
pure virtual

Saves a document to the file. NOTE: You must call PdfDoc::Close to release resources.

Parameters
pathAbsolute file path where the document should be saved.
flagsA bit field combination PdfSaveFlags values. If kSaveIncremental is specified in flags, then path should be NULL. If kSaveFull is specified and path is the same as the file's original path, the new file is saved to a file system-determined temporary path, then the old file is deleted and the new file is renamed to path.
Returns
true if document was saved succsessfully, false otherwise.
See also
PdfDoc::Close

◆ SaveToStream()

virtual bool PdfDoc::SaveToStream ( PsStream * stream,
PdfSaveFlags flags )
pure virtual

Saves a document to the stream. NOTE: You must call PdfDoc::Close to release resources.

Parameters
streamThe stream to which the file is saved.
flagsA PdfSaveFlags value. If kSaveIncremental is specified in flags, then path should be NULL. If kSaveFull is specified and path is the same as the file's original path, the new file is saved to a file system-determined temporary path, then the old file is deleted and the new file is renamed to path.
Returns
true if document was saved succsessfully, false otherwise.
See also
PdfDoc::Close

◆ SetFlags()

virtual bool PdfDoc::SetFlags ( PdfDocFlags flags)
pure virtual

Get the document flags.

Parameters
flagsFlags field, containing an OR of the PdfDocFlags values
Returns
true if the flags was set successfuly

◆ SetInfo()

virtual bool PdfDoc::SetInfo ( const wchar_t * key,
const wchar_t * info )
pure virtual

Sets the value of a key in a document's Info dictionary.

Parameters
keyThe name of the Info dictionary key whose value is obtained.
bufferString value to be set for the specific Info dictionary entry.
Returns
true if optaining the font state was succsessfull, false otherwise.

◆ SetLang()

virtual bool PdfDoc::SetLang ( const wchar_t * lang)
pure virtual

Sets documnent primary language.

Parameters
bufferThe buffer containing document primary buffer
Returns
true if the language was successfully set
See also
PdfDoc::GetLang

◆ SetPath()

virtual bool PdfDoc::SetPath ( const wchar_t * path)
pure virtual

Specifies the path from which the PDF was opened. This method is useful when the document is accessed from a memory stream or a custom stream.

Parameters
pathThe document path to be set.
Returns
true if the operation was successful, false othervise
See also
PdfDoc::GetPath

◆ SetPdfStandard()

virtual bool PdfDoc::SetPdfStandard ( PdfStandardFlags flags,
const wchar_t * part )
pure virtual

Sets the document's PDF compliance level with PDF standards. Method only updates the document metadata according to the specified standard.

Parameters
flagsThe number of the document version to set.
partThe part number to set.
Returns
true if the operation was successful, false othervise

◆ SetSecurityHandler()

virtual bool PdfDoc::SetSecurityHandler ( PdfSecurityHandler * handler)
pure virtual

Set the new security handler to the document which will be used when saving the document.

Parameters
handlernew security handler associated with the document
Returns
true if method completed successfully, false otherwise

◆ SetVersion()

virtual bool PdfDoc::SetVersion ( int version)
pure virtual

Set the document's PDF version. For example value for PDF version 1.2 is 12.

Parameters
versionThe number of the document version to set.
Returns
true if the operation was successful, false othervise