PDFix SDK  7.2.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. More...
 
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. More...
 
virtual bool SetSecurityHandler (PdfSecurityHandler *handler)=0
 Set the new security handler to the document which will be used when saving the document. More...
 
virtual PdfSecurityHandlerGetSecurityHandler ()=0
 Get the current security handler of the document. More...
 
virtual int GetNumPages () const =0
 Gets the number of pages in a document. More...
 
virtual PdfPageAcquirePage (int page_num)=0
 
virtual PdfPageCreatePage (int index, const PdfRect *media_box)=0
 
virtual bool DeletePages (int index_from, int index_to, PdfCancelProc cancel_proc, void *cancel_data)=0
 Deletes the specified pages. More...
 
virtual bool InsertPages (int index, const PdfDoc *doc, int index_from, int index_to, PdfPageInsertFlags insert_flags, PdfCancelProc cancel_proc, void *cancel_data)=0
 
virtual bool MovePage (int index_to, int index_from)=0
 Moves one page in a document. More...
 
virtual int GetNumDocumentJavaScripts ()=0
 Gets the number of document JavaScript name/action pairs in the document JavaScript name tree. More...
 
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. More...
 
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. More...
 
virtual int GetNumCalculatedFormFields ()=0
 Gets the number of calculated form fields in AcroForm calculated order (CO) which is an array. More...
 
virtual PdfFormFieldGetCalculatedFormField (int index)=0
 Gets the calculated form field from AcroForm calculation order array (CO) by index. More...
 
virtual int GetNumFormFields ()=0
 Gets the total number of form fields in document's AcroForm Fields tree. More...
 
virtual PdfFormFieldGetFormField (int index)=0
 Gets the form field in document's AcroForm Fields tree by index. More...
 
virtual PdfFormFieldGetFormFieldByName (const wchar_t *buffer)=0
 Gets the form field in document's AcroForm Fields tree by name. More...
 
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. More...
 
virtual bool SetInfo (const wchar_t *key, const wchar_t *info)=0
 Sets the value of a key in a document's Info dictionary. More...
 
virtual PdfBookmarkGetBookmarkRoot ()=0
 
virtual PdfBookmarkCreateBookmarkRoot ()=0
 
virtual bool ApplyRedaction (PdfCancelProc cancel_proc, void *cancel_data)=0
 Apply redaction annotations to the document content. More...
 
virtual int GetNumAlternates () const =0
 Gets the number of PDF alternate in the document. More...
 
virtual PdfAlternateAcquireAlternate (int index)=0
 
virtual PdsObjectCreatePdsObject (PdfObjectType type, bool indirect)=0
 Creates a new PdsObject associated with the specified document. More...
 
virtual bool AddTags (const PdfTagsParams *tag_params, PdfCancelProc cancel_proc, void *cancel_data)=0
 Add tags into document. More...
 
virtual bool RemoveTags (PdfCancelProc cancel_proc, void *cancel_data)=0
 
virtual PdfDocTemplateGetTemplate ()=0
 Accesses document template. More...
 
virtual PdsStreamGetMetadata ()=0
 Gets documnent metadata object. More...
 
virtual int GetLang (wchar_t *buffer, int len) const =0
 Gets documnent primary language. More...
 
virtual bool SetLang (const wchar_t *lang)=0
 Sets documnent primary language. More...
 
virtual bool EmbedFont (PdfFont *font, bool subset, PdfCancelProc cancel_proc, void *cancel_data)=0
 Embeds or subsets specified font used in the document. More...
 
virtual bool EmbedFonts (bool subset, PdfCancelProc cancel_proc, void *cancel_data)=0
 Embeds or subsets fonts used in the document. More...
 
virtual bool MakeAccessible (const PdfAccessibleParams *params, const wchar_t *title, const wchar_t *language, PdfCancelProc cancel_proc, void *cancel_data)=0
 Makes a PDF document accessible. More...
 
virtual PdsDictionaryGetTrailerObject ()=0
 Gets the document trailer dictionary. More...
 
virtual PdsDictionaryGetRootObject ()=0
 Gets the document catalog dictionary which is a Root entry. More...
 
virtual PdsDictionaryGetInfoObject ()=0
 Gets the Info dictionary of the document. More...
 
virtual PdsDictionaryCreateDictObject (bool indirect)=0
 Create new PdsDictionary object. More...
 
virtual PdsArrayCreateArrayObject (bool indirect)=0
 Create new PdsArray object. More...
 
virtual PdsBooleanCreateBooleanObject (bool indirect, bool value)=0
 Create new PdsBoolean object. More...
 
virtual PdsNameCreateNameObject (bool indirect, const wchar_t *value)=0
 Create new PdsName object. More...
 
virtual PdsStringCreateStringObject (bool indirect, const wchar_t *value, bool hex)=0
 Create new PdsString object. More...
 
virtual PdsNumberCreateIntObject (bool indirect, int value)=0
 Create new PdsNumber (integer) object. More...
 
virtual PdsNumberCreateNumberObject (bool indirect, float value)=0
 Create new PdsNumber (float) object. More...
 
virtual PdsStreamCreateStreamObject (bool indirect, PdsDictionary *dict, const uint8_t *buffer, int size)=0
 Create new PdsStream object. More...
 
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. More...
 
virtual PdsObjectGetObjectById (int obj_id)=0
 Get the document object by number. More...
 
virtual PdsStructTreeCreateStructTree ()=0
 
virtual PdsStructTreeGetStructTree ()=0
 Gets the Struct Tree root object of the document. More...
 
virtual bool RemoveStructTree ()=0
 
virtual bool RemoveBookmarks ()=0
 Removes all bookmarks from the document. More...
 
virtual bool CreateBookmarks (PdfCancelProc cancel_proc, void *cancel_data)=0
 Create bookmark tree from the document's structure tree headings. More...
 
virtual bool AddFontMissingUnicode (PdfCancelProc cancel_proc, void *cancel_data)=0
 Search used font's characters and add appropriate unicode character if not present. More...
 
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. More...
 
virtual int GetPageNumFromObject (PdsObject *page_dict)=0
 Gets the page number of the page specified by a page dictionary. More...
 
virtual PdfAnnotGetAnnotFromObject (PdsObject *annot_dict)=0
 Gets the PdfAnnot object from a PdsObject. More...
 
virtual PdfBookmarkGetBookmarkFromObject (PdsObject *bookmark_obj)=0
 Creates the PdfBookmark object from a PdsObject. More...
 
virtual PdfActionGetActionFromObject (PdsObject *action_obj)=0
 Creates the PdfAction object from a PdsObject. More...
 
virtual PdfActionGetActionFromViewDest (PdfViewDestination *dest)=0
 
virtual PdfViewDestinationGetViewDestinationFromObject (PdsObject *dest_obj)=0
 Creates the PdfViewDestination object from a PdsObject. More...
 
virtual PdfViewDestinationCreateViewDestination (int page_num, PdfDestFitType fit_type, const PdfRect *rect, float zoom)=0
 Creates a new PdfViewDestination object. More...
 
virtual PdsFormCreateFormFromObject (PdsStream *stream, PdfMatrix *matrix)=0
 Create the PdsForm object from a PdsStream. More...
 
virtual PdfActionCreateAction (PdfActionType type)=0
 Create new PdfAction object. More...
 
virtual PdsContentCreateContent ()=0
 Create new PdsContent object. More...
 
virtual PdfColorSpaceCreateColorSpace (PdfColorSpaceFamily cs_family)=0
 Create new PdfColorSpace object. More...
 
virtual PdfFontCreateFont (PsSysFont *sys_font, PdfFontCharset charset, PdfFontCreateFlags flags)=0
 Create new PdfFont object. More...
 
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. More...
 
virtual int GetNumUndos () const =0
 Get the number of available document's PdfDocUndo objects in undo stack. More...
 
virtual PdfDocUndoGetUndo (int index)=0
 Get the PdfDocUndo objects in undo stack by index. More...
 
virtual bool ClearUndos (int index)=0
 Clear document's undo stack. More...
 
virtual int GetNumRedos () const =0
 Get the number of available document's PdfDocUndo objects in redo stack. More...
 
virtual PdfDocUndoGetRedo (int index)=0
 Get the PdfDocUndo objects in undo stack by index. More...
 
virtual bool ClearRedos (int count)=0
 Clear document's redo stack. More...
 
virtual PdfDocFlags GetFlags ()=0
 Get the document flags. More...
 
virtual bool ClearFlags ()=0
 Clears the document flags. This method marks a modified document as clean. More...
 
virtual PdfUserPermissionFlags GetUserPermissions ()=0
 Get the document user permissions. More...
 
virtual int GetVersion ()=0
 Get the document's PDF version. For example value for PDF version 1.2 is 12. More...
 
virtual bool SetVersion (int version)=0
 Set the document's PDF version. For example value for PDF version 1.2 is 12. More...
 
virtual PdfStandardFlags GetPdfStandard ()=0
 Gets the document's PDF compliance level with PDF standards. More...
 
virtual bool SetPdfStandard (PdfStandardFlags flags)=0
 
virtual PdfHtmlConversionCreateHtmlConversion ()=0
 
virtual PdfJsonConversionCreateJsonConversion ()=0
 
virtual PdfTiffConversionCreateTiffConversion ()=0
 
virtual PsCommandGetCommand ()=0
 Creates a PsCommand object. More...
 
virtual PdfEnumResultType EnumAnnots (int page_num, PdfAnnotEnumProc proc, PdfCancelProc cancel_proc, void *cancel_data, void *client_data, PdfEnumFlags flags)=0
 
virtual PdfEnumResultType EnumPageObjects (PdsContent *content, PdfPageObjectEnumProc proc, PdfCancelProc cancel_proc, void *cancel_data, void *client_data, PdfEnumFlags flags)=0
 
virtual PdfEnumResultType EnumStructTree (PdsStructElement *structElem, PdfStructElemEnumProc proc, PdfCancelProc cancel_proc, void *cancel_data, void *client_data, PdfEnumFlags flags)=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.

◆ 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 ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

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

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if successfull. false otherwise
See also
PdfDoc::EmbedFonts

◆ AddTags()

virtual bool PdfDoc::AddTags ( const PdfTagsParams tag_params,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Add tags into document.

Parameters
tag_paramsPdfTagsParams structure definiing the tagattributes or null to use default settings;
cancel_procCallback to check for canceling operations. A CancelProc is typically passed to some method that takes a long time to complete. At frequent intervals, the method calls the CancelProc. If it returns true, then the method cancels its operation; if false, it continues.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if tags were added successfuly, false otherwise.

◆ ApplyRedaction()

virtual bool PdfDoc::ApplyRedaction ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
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 ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

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

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
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.

◆ 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

◆ CreatePdsObject()

virtual PdsObject * PdfDoc::CreatePdsObject ( PdfObjectType  type,
bool  indirect 
)
pure virtual

Creates a new PdsObject associated with the specified document.

Parameters
typeThe type of a new object.
indirectIf true, creates the object as an indirect object. If false, creates the object as a direct object.
Returns
The newly created object.

◆ 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,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
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.
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if pages were deleted succsessfully, false otherwise.

◆ EmbedFont()

virtual bool PdfDoc::EmbedFont ( PdfFont font,
bool  subset,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
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.
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if the was embedded successfully
See also
PdfDoc::AddFontMissingUnicode
PdfDoc::EmbedFonts

◆ EmbedFonts()

virtual bool PdfDoc::EmbedFonts ( bool  subset,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Embeds or subsets fonts used in the document.

Parameters
subsetIf true, embeds each font inside doc with creating a subset.
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if the was embedded successfully
See also
PdfDoc::AddFontMissingUnicode
PdfDoc::EmbedFont

◆ 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

◆ GetPdfStandard()

virtual PdfStandardFlags PdfDoc::GetPdfStandard ( )
pure virtual

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

Returns
PDF compliance level

◆ 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.

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
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,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
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.
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
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

◆ MakeAccessible()

virtual bool PdfDoc::MakeAccessible ( const PdfAccessibleParams params,
const wchar_t *  title,
const wchar_t *  language,
PdfCancelProc  cancel_proc,
void *  cancel_data 
)
pure virtual

Makes a PDF document accessible.

Parameters
paramsPdfAccessibleParams parameters that control process of making PDF accessible.
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.
Returns
true if successfull, 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 ( PdfCancelProc  cancel_proc,
void *  cancel_data 
)
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.

Parameters
cancel_procCallback to check for canceling operations.
cancel_dataPointer to client data for the cancel procedure.

◆ 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

◆ 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

◆ SetPdfStandard()

virtual bool PdfDoc::SetPdfStandard ( PdfStandardFlags  flags)
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.
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