PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
PDF::Document Class Reference

Represents a PDF document. More...

#include <pdfsdk/cxx/document.h>

Inheritance diagram for PDF::Document:

Public Member Functions

bool IsCompressed () const
 Checks if the document is compressed.
 
bool IsModified () const
 Checks if the document has been modified.
 
void SetModified (bool modified)
 Sets the state of the document to modified.
 
std::filesystem::path GetFilePath () const
 Gets the file path of the document.
 
void Save (const std::filesystem::path &path, PDDocSaveFlags flags=kPDDocSaveFull|kPDDocSaveCompressed, ProgressMonitor *progmon=nullptr, const PDOptSaveSettings *optSettings=nullptr, const PDVersion *version=nullptr)
 A function to save a PDF file.
 
size_t GetNumPages () const
 Gets the number of pages in the document.
 
Page GetPage (size_t index) const
 Gets the page at the specified index.
 
Page CreatePage (size_t insertAt, const RectF &mediaBox)
 Creates a new page at the specified index with the given media box.
 
void CreatePages (size_t insertAt, size_t count, const RectF &mediaBox)
 Creates multiple pages starting at the specified index with the given media box.
 
void DeletePages (const PDPageRange &range, ProgressMonitor *mon=nullptr)
 Deletes the pages within the specified range.
 
void DeletePage (size_t index)
 Deletes the page at the specified index.
 
void InsertPages (size_t insertAt, const Document &sourceDoc, const PDPageRange &sourceRange, ProgressMonitor *mon=nullptr)
 Inserts pages from another document into the current document.
 
void InsertPage (const Page &page, size_t insertAt)
 Inserts a page at the specified index.
 
void MovePages (size_t insertAt, const PDPageRange &range, ProgressMonitor *mon=nullptr)
 Moves pages within the document to a new position.
 
std::wstring GetInfoString (PDAtom infoStringAtom) const
 Gets the information string associated with the specified info string atom.
 
void SetInfoString (PDAtom infoStringAtom, const std::wstring &string)
 Sets the information string associated with the specified info string atom.
 
PDDateTime GetCreationDate () const
 Gets the creation date of the document.
 
void SetCreationDate (const PDDateTime &date)
 Sets the creation date of the document.
 
PDDateTime GetModDate () const
 Gets the modification date of the document.
 
void SetModDate (const PDDateTime &date)
 Sets the modification date of the document.
 
void SetPageLayout (PDAtom layout)
 Sets the page layout of the document.
 
PDAtom GetPageLayout () const
 Gets the page layout of the document.
 
void SetPageMode (PDAtom mode)
 Sets the page mode of the document.
 
PDAtom GetPageMode () const
 Gets the page mode of the document.
 
void SetPageDirection (PDPageDirection direction)
 Sets the page direction of the document.
 
PDPageDirection GetPageDirection () const
 Gets the page direction of the document.
 
XObject CreateFormXObject (const Content &content)
 Creates a form XObject from the specified content stream.
 
Pattern CreatePatternTiling (PDETilingPatternPaintType paintType, PDETilingPatternTilingType tilingType, const RectF &bbox, float xStep, float yStep, const Content &content)
 Creates a pattern object in the document using the specified pattern paint type.
 
Pattern CreatePatternShading (const Shading &shading)
 Creates a pattern object in the document using the specified pattern shading. A shading pattern object is a PDF object that defines a smooth transition between colors.
 
Font CreateFontInDoc (const PDFontInfo &fontInfo, bool needSubset=true, bool forceSysFont=true)
 Creates a font in the document using the specified font information.
 
size_t GetNumFormFields () const
 Gets the number of form fields in the document.
 
FormField GetField (size_t index) const
 Gets the form field at the specified index.
 
void AppendField (FormField field)
 Appends a form field to the document.
 
void RemoveField (FormField field)
 Removes the specified form field from the document.
 
FormField CreateField (const std::wstring &fullname, PDAtom type, PDFieldFlags flags)
 Creates a new form field with the specified name, type, and flags.
 
FormField FindField (const std::wstring &fullname) const
 Finds a form field with the specified full name.
 
void RenameField (FormField field, const std::wstring &fullname)
 Renames a specified form field.
 
bool IsSigned () const
 Checks if the document is signed.
 
void SaveSignedVersion (FormField sigField, const std::filesystem::path &path) const
 Writes to a file the version of the document as it was at the time of signing.
 
Action CreateActionURI (const std::string &uri)
 Creates a URI action with the specified URI.
 
Action CreateActionGoTo (Dest dest)
 Creates a GoTo action with the specified destination.
 
Action CreateActionJavaScript (const std::wstring &jscode)
 Creates a JavaScript action with the specified JavaScript code.
 
Action CreateActionSubmitForm (const std::string &serverUri)
 Creates a SubmitForm action with the specified server URI.
 
Action CreateActionResetForm ()
 Creates a ResetForm action.
 
Action CreateActionHide ()
 Creates a Hide action.
 
Action CreateActionNamed (PDAtom name)
 Creates a Named action with the specified name.
 
void SetOpenAction (Action action)
 Sets the open action for the document.
 
Action GetOpenAction () const
 Gets the open action of the document.
 
Dest CreateDestXYZ (size_t pageIndex, const PointF &xy, float zoom, bool isRemote=false)
 Creates a destination with XYZ coordinates and zoom level.
 
Dest CreateDestFit (size_t pageIndex, bool isRemote=false)
 Creates a destination that fits the entire page.
 
Dest CreateDestFitH (size_t pageIndex, float top, bool isRemote=false)
 Creates a destination that fits the width of the page.
 
Dest CreateDestFitV (size_t pageIndex, float left, bool isRemote=false)
 Creates a destination that fits the height of the page.
 
Dest CreateDestFitR (size_t pageIndex, const RectF &rect, bool isRemote=false)
 Creates a destination that fits the specified rectangle on the page.
 
Dest CreateDestFitB (size_t pageIndex, bool isRemote=false)
 Creates a destination that fits the bounding box of the page.
 
Dest CreateDestFitBH (size_t pageIndex, float top, bool isRemote=false)
 Creates a destination that fits the width of the bounding box of the page.
 
Dest CreateDestFitBV (size_t pageIndex, float left, bool isRemote=false)
 Creates a destination that fits the height of the bounding box of the page.
 
void SetOpenDestination (Dest dest)
 Sets the open destination for the document.
 
Dest GetOpenDestination () const
 Gets the open destination of the document.
 
template<class EnumProc >
void EnumDocLevelJSActions (EnumProc enumProc) const
 Enumerates the document-level JavaScript actions.
 
Action GetDocLevelJSAction (const std::wstring &name) const
 Gets the document-level JavaScript action with the specified name.
 
void RemoveDocLevelJS ()
 Removes the document-level JavaScript actions.
 
FileSpec GetAttachment (const std::wstring &name) const
 Gets the attachment with the specified name.
 
template<class EnumProc >
void EnumAttachments (EnumProc enumProc) const
 Enumerates the attachments in the document.
 
void AddAttachment (const std::wstring &name, FileSpec filespec)
 Adds an attachment to the document.
 
void RemoveAttachment (const std::wstring &name)
 Removes the attachment with the specified name.
 
size_t GetNumAttachments () const
 Gets the number of attachments in the document.
 
std::wstring GetAttachmentNameByIndex (size_t index) const
 Gets the name of the attachment at the specified index.
 
FileSpec CreateFileSpec (PDAtom fileSys, const std::wstring &path)
 Creates a FileSpec with the specified file system and path.
 
FileSpec CreateEmbeddedFile (const std::wstring &path)
 Creates an embedded file with the specified path.
 
Bookmark GetRootBookmark () const
 Gets the root bookmark of the document.
 
Bookmark CreateRootBookmark ()
 Creates a root bookmark for the document.
 
OCConfig GetOCConfig () const
 Gets the optional content (OC) configuration of the document.
 
OCGroup CreateOCGroup (const std::wstring &name)
 Creates an optional content (OC) group with the specified name.
 
size_t GetNumOCGroups () const
 Gets the number of optional content (OC) groups in the document.
 
OCGroup GetOCGroup (size_t index) const
 Gets the optional content (OC) group at the specified index.
 
Annot CreateTextAnnot (const RectF &rect)
 Creates a text annotation with the specified dimensions.
 
Annot CreateTextMarkupAnnot (PDAtom type, PDColorValue color, const QuadPoints &quads)
 Creates a text markup annotation with the specified type, color, and quad points.
 
Annot CreateInkAnnot (PDColorValue color, float lineWidth, const std::vector< std::vector< PointF > > &points)
 Creates an ink annotation with the specified color, line width, and points.
 
Annot CreateFreeTextAnnot (const RectF &rect)
 Creates a free text annotation with the specified rectangle.
 
Annot CreateStampAnnot (const RectF &rect, const XObject &appearance)
 Creates a (rubber) stamp annotation with the specified rectangle and appearance.
 
Annot CreateButtonWidget (const FormField &field, const RectF &rect)
 
Annot CreateTextWidget (const FormField &field, const RectF &rect)
 
Annot CreateChoiceWidget (const FormField &field, const RectF &rect)
 
Annot CreateSignWidget (const FormField &field, const RectF &rect)
 
Object GetObjectByID (uint32_t id) const
 Gets the indirect object with the specified ID.
 
Object GetRootObject () const
 Gets the root object of the document.
 
Object GetInfoObject () const
 Gets the info object of the document.
 
Object CreateBoolObject (bool value, bool indirect=false)
 Creates a boolean value object.
 
Object CreateIntObject (int64_t value, bool indirect=false)
 Creates an integer value object.
 
Object CreateRealObject (float value, bool indirect=false)
 Creates a real number object.
 
Object CreateStringObjectUnicode (const std::wstring &unicode, bool indirect=false)
 Creates a literal string object from a Unicode string.
 
Object CreateStringObject (const std::string &bytes, bool hex=false, bool indirect=false)
 Creates a string object from a byte string.
 
Object CreateNameObject (PDAtom value, bool indirect=false)
 Creates a name object.
 
Object CreateArrayObject (bool indirect)
 Creates an array object.
 
Object CreateDictObject (bool indirect)
 Creates a dictionary object.
 
Object CreateStreamObject (const void *buffer, size_t bufSize, const Object &attributesDict, const Object &encodeParms, bool encodeSource)
 Creates a stream object.
 
Object CopyObject (const Object &source)
 Copies an object.
 
ReadStream OpenXfaStream () const
 Opens an XFA (XML Forms Architecture) stream.
 
StdSecurityParams GetStandardSecurityParams () const
 Gets the standard security parameters of the document.
 
void SetStandardSecurityParams (const StdSecurityParams &requestedParams)
 Sets the standard security parameters of the document.
 
bool RequestPermission (PDPermReqObj object, PDPermReqOp operation, const std::wstring &password=std::wstring()) const
 Requests permission to perform an operation on the document. Permissions can be set either by the document's security handler or by the DocMDP.
 
XObject ImportIcon (const Document &source, size_t pageIndex=0)
 Imports an icon from another document.
 
void CreatePageFromIcon (size_t insertAt, const Document &iconDoc, const XObject &icon)
 Creates a page from an icon.
 
 Document (PDDoc handle, bool adopt=false) noexcept
 
 Document (const Document &rhs) noexcept
 
Documentoperator= (const Document &rhs) noexcept
 
 Document (Document &&rhs) noexcept
 
Documentoperator= (Document &&rhs) noexcept
 

Static Public Member Functions

static Document NewDocument ()
 A function to create an empty PDF file.
 
static Document OpenDocument (const std::filesystem::path &path, const std::wstring &password=std::wstring())
 A function to open a PDF file.
 
static Document OpenDocument (const void *data, size_t size, bool copy=false, const std::wstring &password=std::wstring())
 A function to open a PDF file from a memory buffer.
 

Detailed Description

Represents a PDF document.

Member Function Documentation

◆ AddAttachment()

void PDF::Document::AddAttachment ( const std::wstring & name,
FileSpec filespec )

Adds an attachment to the document.

Parameters
[in]nameA reference to the name of the attachment in wide character string format (i.e. L"FileAttachmentName").
[in]filespecThe FileSpec of the attachment.

◆ AppendField()

void PDF::Document::AppendField ( FormField field)

Appends a form field to the document.

For more information refer to section 12.7 Forms from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]fieldThe form field to append.

◆ CopyObject()

Object PDF::Document::CopyObject ( const Object & source)

Copies an object.

Parameters
[in]sourceA reference to the source object to copy.
Returns
The new copy of the source object.

◆ CreateActionGoTo()

Action PDF::Document::CreateActionGoTo ( Dest dest)

Creates a GoTo action with the specified destination.

A go-to action changes the view to a specified destination (page, location, and magnification factor). For more information refer to section 12.6.4.2 Go-To actions from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]destThe destination for the action. The destination can be within the same document, another document or in an embedded file.
Returns
The created Action object.

◆ CreateActionHide()

Action PDF::Document::CreateActionHide ( )

Creates a Hide action.

This action hides or shows one or more annotations on the screen by setting or clearing their hidden flags. For more information refer to section 12.6.4.11 Hide actions from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The created Action object.

◆ CreateActionJavaScript()

Action PDF::Document::CreateActionJavaScript ( const std::wstring & jscode)

Creates a JavaScript action with the specified JavaScript code.

For more information refer to section 2.6.4.17 ECMAScript actions from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]jscodeA reference to the JavaScript code for the action in wide character string format (i.e. L"some javascript code to execute").
Returns
The created Action object.

◆ CreateActionNamed()

Action PDF::Document::CreateActionNamed ( PDAtom name)

Creates a Named action with the specified name.

Some common named actions are NextPage, PrevPage, FirstPage, LastPage, which do what their names suggest. For more information refer to section 12.6.4.12 Named actions from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]nameThe name of the action.
Returns
The created Action object.

◆ CreateActionResetForm()

Action PDF::Document::CreateActionResetForm ( )

Creates a ResetForm action.

This action resets selected interactive form fields to their default values. For more information refer to section 12.7.6.3 Reset-form action from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The created Action object.

◆ CreateActionSubmitForm()

Action PDF::Document::CreateActionSubmitForm ( const std::string & serverUri)

Creates a SubmitForm action with the specified server URI.

This action can be to transmit the names and values of selected interactive form fields to a specified uniform resource locator. For more information refer to section 12.7.6.2 Submit-form action from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]serverUriA reference to the server URI for the action in wide character string format.
Returns
The created Action object.

◆ CreateActionURI()

Action PDF::Document::CreateActionURI ( const std::string & uri)

Creates a URI action with the specified URI.

This action causes the URI to be resolved. For more information refer to section 12.6.4.8 URI actions from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]uriA reference to the URI for the action in wide character string format. (i.e. L"https://example.com")
Returns
The created Action object.

◆ CreateArrayObject()

Object PDF::Document::CreateArrayObject ( bool indirect)

Creates an array object.

An array object is a one-dimensional collection of objects arranged sequentially. The array elements may be any combination of numbers, strings, dictionaries, or any other objects, including other arrays. For more information refer to section 7.3.6 Array objects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]indirectIndicates whether the object is indirect.
Returns
The created array object.

◆ CreateBoolObject()

Object PDF::Document::CreateBoolObject ( bool value,
bool indirect = false )

Creates a boolean value object.

For more information refer to section 7.3.2 Boolean objects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]valueThe value of the boolean object.
[in]indirectIndicates whether the object is indirect.
Returns
The created boolean value object.

◆ CreateDestFit()

Dest PDF::Document::CreateDestFit ( size_t pageIndex,
bool isRemote = false )

Creates a destination that fits the entire page.

Fits the entire page within the window both horizontally and vertically. For more information refer to section 12.3.2.2 Explicit destinations, Table 149 — Destination syntax, /Fit

Parameters
[in]pageIndexThe specific page to be displayed.
[in]isRemote[Optional] Indicates whether the destination is at the current document.
Returns
The created destination object.

◆ CreateDestFitB()

Dest PDF::Document::CreateDestFitB ( size_t pageIndex,
bool isRemote = false )

Creates a destination that fits the bounding box of the page.

For more information refer to section 12.3.2.2 Explicit destinations, Table 149 — Destination syntax, /FitB

Parameters
[in]pageIndexThe specific page to be displayed.
[in]isRemote[Optional] Indicates whether the destination is at the current document.
Returns
The created destination object.

◆ CreateDestFitBH()

Dest PDF::Document::CreateDestFitBH ( size_t pageIndex,
float top,
bool isRemote = false )

Creates a destination that fits the width of the bounding box of the page.

For more information refer to section 12.3.2.2 Explicit destinations, Table 149 — Destination syntax, /FitBH

Parameters
[in]pageIndexThe specific page to be displayed.
[in]topThe vertical coordinate positioned at the top edge of the window.
[in]isRemote[Optional] Indicates whether the destination is at the current document.
Returns
The created destination object.

◆ CreateDestFitBV()

Dest PDF::Document::CreateDestFitBV ( size_t pageIndex,
float left,
bool isRemote = false )

Creates a destination that fits the height of the bounding box of the page.

For more information refer to section 12.3.2.2 Explicit destinations, Table 149 — Destination syntax, /FitBV

Parameters
[in]pageIndexThe specific page to be displayed.
[in]leftThe horizontal coordinate positioned at the left edge of the window.
[in]isRemote[Optional] Indicates whether the destination is at the current document.
Returns
The created destination object.

◆ CreateDestFitH()

Dest PDF::Document::CreateDestFitH ( size_t pageIndex,
float top,
bool isRemote = false )

Creates a destination that fits the width of the page.

For more information refer to section 12.3.2.2 Explicit destinations, Table 149 — Destination syntax, /FitH

Parameters
[in]pageIndexThe specific page to be displayed.
[in]topThe vertical coordinate positioned at the top edge of the window.
[in]isRemote[Optional] Indicates whether the destination is at the current document.
Returns
The created destination object.

◆ CreateDestFitR()

Dest PDF::Document::CreateDestFitR ( size_t pageIndex,
const RectF & rect,
bool isRemote = false )

Creates a destination that fits the specified rectangle on the page.

For more information refer to section 12.3.2.2 Explicit destinations, Table 149 — Destination syntax, /FitR

Parameters
[in]pageIndexThe specific page to be displayed.
[in]rectA reference to the rectangle to fit inside of.
[in]isRemote[Optional] Indicates whether the destination is at the current document.
Returns
The created destination object.

◆ CreateDestFitV()

Dest PDF::Document::CreateDestFitV ( size_t pageIndex,
float left,
bool isRemote = false )

Creates a destination that fits the height of the page.

For more information refer to section 12.3.2.2 Explicit destinations, Table 149 — Destination syntax, /FitV

Parameters
[in]pageIndexThe specific page to be displayed.
[in]leftThe horizontal coordinate positioned at the left edge of the window.
[in]isRemote[Optional] Indicates whether the destination is at the current document.
Returns
The created destination object.

◆ CreateDestXYZ()

Dest PDF::Document::CreateDestXYZ ( size_t pageIndex,
const PointF & xy,
float zoom,
bool isRemote = false )

Creates a destination with XYZ coordinates and zoom level.

A destination defines a particular view of a document. For more information refer to section 12.3.2 Destinations and Table 149 — Destination syntax, /XYZ from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]pageIndexThe specific page to be displayed.
[in]xyA reference to the location of the document window.
[in]zoomThe magnification factor.
[in]isRemote[Optional] Indicates whether the destination is at the current document.
Returns
The created destination object.

◆ CreateDictObject()

Object PDF::Document::CreateDictObject ( bool indirect)

Creates a dictionary object.

The keys shall be direct objects, the values may be any kind of object, including another dictionary. A dictionary entry whose value is null shall be treated the same as if the entry does not exist. For more information refer to section 7.3.7 Dictionary objects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]indirectIndicates whether the object is indirect.
Returns
The created dictionary object.

◆ CreateEmbeddedFile()

FileSpec PDF::Document::CreateEmbeddedFile ( const std::wstring & path)

Creates an embedded file with the specified path.

Parameters
[in]pathA reference to the path of the embedded file in wide character string format (i.e. L"path/to/embedded/file")
Returns
The created FileSpec.

◆ CreateField()

FormField PDF::Document::CreateField ( const std::wstring & fullname,
PDAtom type,
PDFieldFlags flags )

Creates a new form field with the specified name, type, and flags.

Parameters
[in]fullnameA reference to the name of the form field in wide character string format. (i.e. L"email address")
[in]typeThe type of the form field. This can be a Button, Text, Choice or Signature. For more information refer to section 12.7.4 Field dictionaries, Table 226 — Entries common to all field dictionaries, key FT (Field Type).
[in]flagsThe flags defining the form field. Specifies the control, behavior and appearance of th form field.
See also
PDFieldFlags
Returns
The created form field object.

◆ CreateFileSpec()

FileSpec PDF::Document::CreateFileSpec ( PDAtom fileSys,
const std::wstring & path )

Creates a FileSpec with the specified file system and path.

Parameters
[in]fileSysThe file system of the FileSpec.
[in]pathA reference to the path of the FileSpec in wide character string format.
Returns
The created FileSpec.

◆ CreateFontInDoc()

Font PDF::Document::CreateFontInDoc ( const PDFontInfo & fontInfo,
bool needSubset = true,
bool forceSysFont = true )

Creates a font in the document using the specified font information.

Parameters
[in]fontInfoA reference to the font information. This includes the font family (Times New Roman, Arial etc.), format (i.e. TrueType TTF) and style (regular, bold, italic) For information on font formats refer to section 9.5 Introduction to font data structures and Table 108 — Font types from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.
[in]needSubset[Optional] Indicates whether the font needs to be subsetted (default: true). Subsetting includes only the glyphs (characters) that are actually used in the document, rather than embedding the entire font. This can significantly reduce the file size of the PDF. For more information refer to section 9.9.2 Font subsets from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.
[in]forceSysFont[Optional] Indicates whether to force using system fonts (default: true). A flag used to determine whether to use a font that is installed on the system processing the PDF document. This maintains a uniform appearance across different documents and applications on the same system.
Returns
The created font object.

◆ CreateFormXObject()

XObject PDF::Document::CreateFormXObject ( const Content & content)

Creates a form XObject from the specified content stream.

A form XObject is a PDF content stream that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). For more information refer to sections 8.8 External objects and 8.10 Form XObjects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]contentThe content stream used to create the form XObject. It is a sequence of instructions describing the graphical elements to be painted on a page. For more information refer to section 7.8.2 Content streams from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.
Returns
The created form XObject object.

◆ CreateFreeTextAnnot()

Annot PDF::Document::CreateFreeTextAnnot ( const RectF & rect)

Creates a free text annotation with the specified rectangle.

A free text annotation is always visible, because it has no open or closed state. It is not displayed in a popup window like an ordinary text annotation. For more information refer to section 12.5.6.6 Free text annotations from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]rectA reference to the inner rectangle where the annotation’s text will be displayed.
Returns
The created free text annotation object.

◆ CreateInkAnnot()

Annot PDF::Document::CreateInkAnnot ( PDColorValue color,
float lineWidth,
const std::vector< std::vector< PointF > > & points )

Creates an ink annotation with the specified color, line width, and points.

For more information refer to section 12.5.6.13 Ink annotations ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]colorThe color of the ink annotation.
[in]lineWidthThe line width of the ink annotation.
[in]pointsA reference to the coordinates that define the path of the ink annotation on the page.
Returns
The created ink annotation object.

◆ CreateIntObject()

Object PDF::Document::CreateIntObject ( int64_t value,
bool indirect = false )

Creates an integer value object.

For more information refer to section 7.3.3 Numeric objects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]valueThe value of the integer object.
[in]indirectIndicates whether the object is indirect.
Returns
The created integer object.

◆ CreateNameObject()

Object PDF::Document::CreateNameObject ( PDAtom value,
bool indirect = false )

Creates a name object.

A name object is an atomic symbol uniquely defined by a sequence of any characters (8-bit values) except null (character code 0). For more information refer to section 7.3.5 Name objects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]valueThe value of the name object.
[in]indirectIndicates whether the object is indirect.
Returns
The created name object.

◆ CreateOCGroup()

OCGroup PDF::Document::CreateOCGroup ( const std::wstring & name)

Creates an optional content (OC) group with the specified name.

An OC group is a dictionary representing a collection of graphics that can be made visible or invisible dynamically. For more information refer to section 8.11.2 Optional content groups and 8.11.4 Configuring optional content from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]nameA reference to the name of the optional content group in wide character string format (i.e. L"OCGroupName")
Returns
The created optional content group object.

◆ CreatePage()

Page PDF::Document::CreatePage ( size_t insertAt,
const RectF & mediaBox )

Creates a new page at the specified index with the given media box.

Parameters
[in]insertAtThe index at which to insert the new page.
[in]mediaBoxThe media box of the new page. For more information refer to section 14.11.2 Page boundaries from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.
Returns
The newly created page object.

◆ CreatePageFromIcon()

void PDF::Document::CreatePageFromIcon ( size_t insertAt,
const Document & iconDoc,
const XObject & icon )

Creates a page from an icon.

Parameters
[in]insertAtThe location at which to insert the page at.
[in]iconDocA reference to the document containing the icon.
[in]iconA reference to the icon to create the page from. A form XObject is a PDF content stream that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). For more information refer to sections 8.8 External objects and 8.10 Form XObjects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

◆ CreatePages()

void PDF::Document::CreatePages ( size_t insertAt,
size_t count,
const RectF & mediaBox )

Creates multiple pages starting at the specified index with the given media box.

Parameters
[in]insertAtThe index at which to insert the new pages.
[in]countThe number of pages to create.
[in]mediaBoxThe media box of the new pages. For more information refer to section 14.11.2 Page boundaries from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

◆ CreatePatternShading()

Pattern PDF::Document::CreatePatternShading ( const Shading & shading)

Creates a pattern object in the document using the specified pattern shading. A shading pattern object is a PDF object that defines a smooth transition between colors.

Parameters
[in]shadingThe shading object used to create the pattern.
Returns
The created pattern object.

◆ CreatePatternTiling()

Pattern PDF::Document::CreatePatternTiling ( PDETilingPatternPaintType paintType,
PDETilingPatternTilingType tilingType,
const RectF & bbox,
float xStep,
float yStep,
const Content & content )

Creates a pattern object in the document using the specified pattern paint type.

A tiling pattern object is a PDF object that defines a repeating graphical element.

Parameters
[in]paintTypeThe type of pattern paint to create.
[in]tilingTypeThe type of tiling pattern to create.
[in]bboxThe bounding box of the pattern.
[in]xStepThe horizontal spacing between pattern cells. Shall not be zero.
[in]yStepThe vertical spacing between pattern cells. Shall not be zero.
[in]contentThe content stream used to create the pattern.
Returns
The created pattern object.

◆ CreateRealObject()

Object PDF::Document::CreateRealObject ( float value,
bool indirect = false )

Creates a real number object.

For more information refer to section 7.3.3 Numeric objects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]valueThe value of the real object.
[in]indirectIndicates whether the object is indirect.
Returns
The created real object.

◆ CreateRootBookmark()

Bookmark PDF::Document::CreateRootBookmark ( )

Creates a root bookmark for the document.

For more information see section 12.3.3 Document outline from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The created root bookmark.

◆ CreateStampAnnot()

Annot PDF::Document::CreateStampAnnot ( const RectF & rect,
const XObject & appearance )

Creates a (rubber) stamp annotation with the specified rectangle and appearance.

For more information refer to section 12.5.6.12 Rubber stamp annotations from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]rectA reference to the inner rectangle where the annotation’s text will be displayed.
[in]appearanceA reference to the external graphics object specifying the visual representation of the stamp annotation.
Returns
The created stamp annotation object.

◆ CreateStreamObject()

Object PDF::Document::CreateStreamObject ( const void * buffer,
size_t bufSize,
const Object & attributesDict,
const Object & encodeParms,
bool encodeSource )

Creates a stream object.

For more information refer to section 7.3.8 Stream objects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]bufferA pointer to the buffer that contains the stream data.
[in]bufSizeThe size of the buffer. This is the Length key inside the stream dictionary, For more information refer to Table 5 — Entries common to all stream dictionaries.
[in]attributesDictA reference to the dictionary object containing the stream attributes.
[in]encodeParmsA reference to the dictionary object containing the encoding parameters.
[in]encodeSourceIndicates whether to encode the source data.
Returns
The created stream object.

◆ CreateStringObject()

Object PDF::Document::CreateStringObject ( const std::string & bytes,
bool hex = false,
bool indirect = false )

Creates a string object from a byte string.

For more information refer to section 7.3.4 String objects and section 7.3.4.3 Hexadecimal strings from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]bytesA reference to the byte string.
[in]hex[Optional] Indicates whether the byte string is in hexadecimal format
[in]indirectIndicates whether the object is indirect.
Returns
The created string object.

◆ CreateStringObjectUnicode()

Object PDF::Document::CreateStringObjectUnicode ( const std::wstring & unicode,
bool indirect = false )

Creates a literal string object from a Unicode string.

For more information refer to section 7.3.4 String objects and section 7.3.4.2 Literal strings from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]unicodeA reference to the Unicode string in wide character string format.
[in]indirectIndicates whether the object is indirect.
Returns
The created literal string object.

◆ CreateTextAnnot()

Annot PDF::Document::CreateTextAnnot ( const RectF & rect)

Creates a text annotation with the specified dimensions.

For more information refer to section 12.5 Annotations from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]rectA reference to the rectangle surrounding the text annotation.
Returns
The created text annotation object.

◆ CreateTextMarkupAnnot()

Annot PDF::Document::CreateTextMarkupAnnot ( PDAtom type,
PDColorValue color,
const QuadPoints & quads )

Creates a text markup annotation with the specified type, color, and quad points.

For more information refer to section 12.5.6.2 Markup annotations ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]typeThe type of the text markup annotation.
[in]colorThe color of the text markup annotation.
[in]quadsA reference to the corners of the text markup annotation boundary.
Returns
The created text markup annotation object.

◆ DeletePage()

void PDF::Document::DeletePage ( size_t index)

Deletes the page at the specified index.

Parameters
[in]indexThe index of the page to delete.

◆ DeletePages()

void PDF::Document::DeletePages ( const PDPageRange & range,
ProgressMonitor * mon = nullptr )

Deletes the pages within the specified range.

Parameters
[in]rangeThe range of pages to delete.
[out]mon[Optional] A pointer to the progress monitor handle that displays the progress/state of the operation. If not provided, defaults to a null pointer. ProgressMonitor

◆ EnumAttachments()

template<class EnumProc >
void PDF::Document::EnumAttachments ( EnumProc enumProc) const

Enumerates the attachments in the document.

Template Parameters
EnumProcThe type of the enumeration procedure.
Parameters
[in]enumProcThe enumeration procedure to be called for each attachment.

◆ EnumDocLevelJSActions()

template<class EnumProc >
void PDF::Document::EnumDocLevelJSActions ( EnumProc enumProc) const

Enumerates the document-level JavaScript actions.

Template Parameters
EnumProcThe type of the enumeration procedure.
Parameters
[in]enumProcThe enumeration procedure to be called for each JavaScript action.

◆ FindField()

FormField PDF::Document::FindField ( const std::wstring & fullname) const

Finds a form field with the specified full name.

Parameters
[in]fullnameA reference to the name of the form field to retrieve, in wide character string format (i.e. L"email address").
Returns
The found form field object, or an empty form field object if not found.

◆ GetAttachment()

FileSpec PDF::Document::GetAttachment ( const std::wstring & name) const

Gets the attachment with the specified name.

Parameters
[in]nameA reference to the name of the attachment in wide character string format (i.e. L"FileAttachmentName")
Returns
The attachment object with the specified name, or an empty FileSpec object if not found.

◆ GetAttachmentNameByIndex()

std::wstring PDF::Document::GetAttachmentNameByIndex ( size_t index) const

Gets the name of the attachment at the specified index.

Parameters
[in]indexThe index of the attachment.
Returns
The name of the attachment at the specified index.

◆ GetCreationDate()

PDDateTime PDF::Document::GetCreationDate ( ) const

Gets the creation date of the document.

Retrieved from the document's information dictionary CreationDate entry. For more information refer to section 14.3.3 Document information dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The creation date in human readable form. For format details refer to section 7.9.4 Dates from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

◆ GetDocLevelJSAction()

Action PDF::Document::GetDocLevelJSAction ( const std::wstring & name) const

Gets the document-level JavaScript action with the specified name.

Parameters
[in]nameA reference to the name of the JavaScript action.
Returns
The JavaScript action object associated with the specified name, or an empty action object if not found.

◆ GetField()

FormField PDF::Document::GetField ( size_t index) const

Gets the form field at the specified index.

For more information refer to section 12.7 Forms from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]indexThe index of the form field.
Returns
The form field object at the specified index.

◆ GetFilePath()

std::filesystem::path PDF::Document::GetFilePath ( ) const

Gets the file path of the document.

Returns
The file path of the document.

◆ GetInfoObject()

Object PDF::Document::GetInfoObject ( ) const

Gets the info object of the document.

This is the document information dictionary, which is used to represent document level metadata. It is located in the Info entry of the file trailer. For more information refer to section 14.3.3 Document information dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The info object of the document.

◆ GetInfoString()

std::wstring PDF::Document::GetInfoString ( PDAtom infoStringAtom) const

Gets the information string associated with the specified info string atom.

Parameters
[in]infoStringAtomThe Atom specifies what information string to retrieve from the document's information dictionary. The supported atoms: Author, Title, Subject, Keywords, Creator, Producer. For more information refer to section 14.3.3 Document information dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.
Returns
The wide character information string.

◆ GetModDate()

PDDateTime PDF::Document::GetModDate ( ) const

Gets the modification date of the document.

Retrieved from the document's information dictionary ModDate entry. For more information refer to section 14.3.3 Document information dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The modification date. For format details refer to section 7.9.4 Dates from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

◆ GetNumAttachments()

size_t PDF::Document::GetNumAttachments ( ) const

Gets the number of attachments in the document.

Returns
The number of attachments in the document.

◆ GetNumFormFields()

size_t PDF::Document::GetNumFormFields ( ) const

Gets the number of form fields in the document.

For more information refer to section 12.7 Forms from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The number of form fields.

◆ GetNumOCGroups()

size_t PDF::Document::GetNumOCGroups ( ) const

Gets the number of optional content (OC) groups in the document.

An OC group is a dictionary representing a collection of graphics that can be made visible or invisible dynamically. For more information refer to section 8.11.2 Optional content groups from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The number of optional content groups in the document.

◆ GetNumPages()

size_t PDF::Document::GetNumPages ( ) const

Gets the number of pages in the document.

Returns
The number of pages in the document.

◆ GetObjectByID()

Object PDF::Document::GetObjectByID ( uint32_t id) const

Gets the indirect object with the specified ID.

For more information refer to section 7.3 Objects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]idThe ID of the object.
Returns
The object with the specified ID.

◆ GetOCConfig()

OCConfig PDF::Document::GetOCConfig ( ) const

Gets the optional content (OC) configuration of the document.

Optional content refers to sections of content in a PDF document that can be selectively viewed or hidden by document authors or consumers. For more information refer to section 8.11 Optional content from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The optional content configuration object of the document.

◆ GetOCGroup()

OCGroup PDF::Document::GetOCGroup ( size_t index) const

Gets the optional content (OC) group at the specified index.

An OC group is a dictionary representing a collection of graphics that can be made visible or invisible dynamically. For more information refer to section 8.11.2 Optional content groups from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]indexThe index of the optional content group.
Returns
The optional content group object at the specified index.

◆ GetOpenAction()

Action PDF::Document::GetOpenAction ( ) const

Gets the open action of the document.

Returns
The open action object of the document.

◆ GetOpenDestination()

Dest PDF::Document::GetOpenDestination ( ) const

Gets the open destination of the document.

Returns
The open destination of the document.

◆ GetPage()

Page PDF::Document::GetPage ( size_t index) const

Gets the page at the specified index.

Parameters
[in]indexThe index of the page.
Returns
The page object at the specified index.

◆ GetPageDirection()

PDPageDirection PDF::Document::GetPageDirection ( ) const

Gets the page direction of the document.

Retrieves the reading and writing order of text on a page. It can be either left to right (i.e. for English) or right to left (i.e. for Arabic). For more information refer to section 12.2 Viewer preferences Table 147 — Entries in a viewer preferences dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The page direction object.
See also
PDPageDirection

◆ GetPageLayout()

PDAtom PDF::Document::GetPageLayout ( ) const

Gets the page layout of the document.

Retrieves the details about how a document's pages are displayed, when first opened. There are six possible layouts - one page at a time, pages in a column etc. For more information refer to section 7.7.2 Document catalog dictionary table Table 29 — Entries in the catalog dictionary, key PageLayout from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The page layout object.

◆ GetPageMode()

PDAtom PDF::Document::GetPageMode ( ) const

Gets the page mode of the document.

This retrieves what a document's menu bar/sidebar is set to display, when a document is first opened. This could be the document's outline, thumbnails or attachments panel etc. For more information refer to section 7.7.2 Document catalog dictionary table Table 29 — Entries in the catalog dictionary, key PageMode from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The page mode object.

◆ GetRootBookmark()

Bookmark PDF::Document::GetRootBookmark ( ) const

Gets the root bookmark of the document.

This is the root of the tree-structured hierarchy of the document's outline items (bookmarks). For more information see section 12.3.3 Document outline from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The root bookmark object of the document.

◆ GetRootObject()

Object PDF::Document::GetRootObject ( ) const

Gets the root object of the document.

This is the document catalogue dictionary, which is the root of a document's object heirarchy. It is located in the Root entry of the file trailer. For more information refer to section 7.7.2 Document catalog dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The root object of the document.

◆ GetStandardSecurityParams()

StdSecurityParams PDF::Document::GetStandardSecurityParams ( ) const

Gets the standard security parameters of the document.

These include the editing, printing and data extraction permissions as well as owner and user password properties. For more information on Security Parameters refer to section 7.6.4 Standard security handler from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The standard security parameters object of the document.

◆ ImportIcon()

XObject PDF::Document::ImportIcon ( const Document & source,
size_t pageIndex = 0 )

Imports an icon from another document.

An icon is the visual representation of any of the annotation types when they are not interacted with. It represents the existence and location for an annotation and contains clues as to the type of annotation (i.e. a sound annotation will have a speaker displayed).

Parameters
[in]sourceA reference to the source document.
[in]pageIndex[Optional] The index of the page containing the icon (Default is 0).
Returns
The imported icon object. A form XObject is a PDF content stream that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). For more information refer to sections 8.8 External objects and 8.10 Form XObjects from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

◆ InsertPage()

void PDF::Document::InsertPage ( const Page & page,
size_t insertAt )

Inserts a page at the specified index.

Parameters
[in]pageA reference to the page to insert.
[in]insertAtThe index at which to insert the page.

◆ InsertPages()

void PDF::Document::InsertPages ( size_t insertAt,
const Document & sourceDoc,
const PDPageRange & sourceRange,
ProgressMonitor * mon = nullptr )

Inserts pages from another document into the current document.

Parameters
[in]insertAtThe index at which to insert the pages.
[in]sourceDocA reference to the source document from which to insert the pages.
[in]sourceRangeA reference to the range of pages to insert from the source document.
[out]mon[Optional] A pointer to the progress monitor handle that displays the progress/state of the operation. If not provided, defaults to a null pointer. ProgressMonitor

◆ IsCompressed()

bool PDF::Document::IsCompressed ( ) const

Checks if the document is compressed.

Returns
True if the document is compressed, false otherwise.

◆ IsModified()

bool PDF::Document::IsModified ( ) const

Checks if the document has been modified.

Returns
True if the document has been modified, false otherwise.

◆ IsSigned()

bool PDF::Document::IsSigned ( ) const

Checks if the document is signed.

For further information refer to section 12.7.5.5 Signature fields from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
True if the document is signed, false otherwise.

◆ MovePages()

void PDF::Document::MovePages ( size_t insertAt,
const PDPageRange & range,
ProgressMonitor * mon = nullptr )

Moves pages within the document to a new position.

Parameters
[in]insertAtThe index at which to insert the moved pages.
[in]rangeThe range of pages to move.
[out]mon[Optional] A pointer to the progress monitor handle that displays the progress/state of the operation. If not provided, defaults to a null pointer. ProgressMonitor

◆ NewDocument()

static Document PDF::Document::NewDocument ( )
static

A function to create an empty PDF file.

Returns
A newly created PDF document object.

◆ OpenDocument() [1/2]

static Document PDF::Document::OpenDocument ( const std::filesystem::path & path,
const std::wstring & password = std::wstring() )
static

A function to open a PDF file.

Parameters
[in]pathThe full or relative path to an existing PDF file, including the file extension.
[in]password[Optional] Password for the PDF file to open. If the file is not password protected it defaults to an empty string. Supports Unicode.
Returns
The opened PDF document.

◆ OpenDocument() [2/2]

static Document PDF::Document::OpenDocument ( const void * data,
size_t size,
bool copy = false,
const std::wstring & password = std::wstring() )
static

A function to open a PDF file from a memory buffer.

Parameters
[in]dataThe memory buffer containing the PDF file.
[in]sizeThe size of the memory buffer.
[in]copyA flag to indicate if the data should be copied. If set to false, the buffer must remain valid until the document is closed.
[in]passwordPassword for the PDF file to open. If the file is not password protected it defaults to an empty string. Supports Unicode.
Returns
The opened PDF document.

◆ OpenXfaStream()

ReadStream PDF::Document::OpenXfaStream ( ) const

Opens an XFA (XML Forms Architecture) stream.

An XFA stream is the object that contains the XML data describing an XFA form. For more information refer to Annex K (normative) XFA Forms from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Returns
The opened XFA stream object.

◆ RemoveAttachment()

void PDF::Document::RemoveAttachment ( const std::wstring & name)

Removes the attachment with the specified name.

Parameters
[in]nameA reference to the name of the attachment to remove in wide character string format (i.e. L"FileAttachmentName").

◆ RemoveField()

void PDF::Document::RemoveField ( FormField field)

Removes the specified form field from the document.

For more information refer to section 12.7 Forms from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]fieldThe form field to remove.

◆ RenameField()

void PDF::Document::RenameField ( FormField field,
const std::wstring & fullname )

Renames a specified form field.

Parameters
[in]fieldThe form field to retrieve and rename.
[in]fullnameA reference to the new name of the form field, in wide character string format. (i.e. L"email address")

◆ RequestPermission()

bool PDF::Document::RequestPermission ( PDPermReqObj object,
PDPermReqOp operation,
const std::wstring & password = std::wstring() ) const

Requests permission to perform an operation on the document. Permissions can be set either by the document's security handler or by the DocMDP.

Parameters
[in]objectThe object to request permission for.
[in]operationThe operation to request permission for.
[in]passwordThe password to use for the authorization.
Returns
True if permission is granted, false otherwise.

◆ Save()

void PDF::Document::Save ( const std::filesystem::path & path,
PDDocSaveFlags flags = kPDDocSaveFull|kPDDocSaveCompressed,
ProgressMonitor * progmon = nullptr,
const PDOptSaveSettings * optSettings = nullptr,
const PDVersion * version = nullptr )

A function to save a PDF file.

Parameters
[in]pathThe full or relative path to the location where you want the PDF file saved.
[in]flags[Optional] An integer that specifies the type of save. For more information refer to the PDF Standard ISO 32000-2:2020 (PDF 2.0) sections: 12.8 - Digital Signatures p.575, Annex F - Linearized PDF and 7.5 File Structure respectively. PDDocSaveFlagsBits
[out]progmon[Optional] A pointer to the progress monitor handle that displays the progress/state of the operation. If not provided, defaults to a null pointer. ProgressMonitor
[in]optSettings[Optional] Options for level of PDF image quality and saving/removing of PDF structure internals. If not provided, defaults to a null pointer. PDOptSaveSettings
[in]version[Optional] Major and Minor version of the PDF file type. The convention being Major.Minor i.e. PDF 2.0 For more information refer to the PDF Standard ISO 32000-2:2020 (PDF 2.0) Annex I - PDF versions and compatibility. If not provided, defaults to a null pointer.

◆ SaveSignedVersion()

void PDF::Document::SaveSignedVersion ( FormField sigField,
const std::filesystem::path & path ) const

Writes to a file the version of the document as it was at the time of signing.

Parameters
[in]sigFieldThe signature field that was used to sign the document.
[in]pathThe path to the location where you want the signed version of the document saved.

◆ SetCreationDate()

void PDF::Document::SetCreationDate ( const PDDateTime & date)

Sets the creation date of the document.

Set into the document's information dictionary CreationDate entry. For more information refer to section 14.3.3 Document information dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]dateA reference to the creation date to set. For format details refer to section 7.9.4 Dates from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

◆ SetInfoString()

void PDF::Document::SetInfoString ( PDAtom infoStringAtom,
const std::wstring & string )

Sets the information string associated with the specified info string atom.

Parameters
[in]infoStringAtomThe Atom specifies what information string to set inside the document's information dictionary. The supported atoms: Author, Title, Subject, Keywords, Creator, Producer. For more information refer to section 14.3.3 Document information dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.
[in]stringA reference to the information string to set. (i.e. set infoStringAtom = Author to string = L"Author Name")

◆ SetModDate()

void PDF::Document::SetModDate ( const PDDateTime & date)

Sets the modification date of the document.

Set into the document's information dictionary ModDate entry. For more information refer to section 14.3.3 Document information dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]dateThe modification date to set. For format details refer to section 7.9.4 Dates from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

◆ SetModified()

void PDF::Document::SetModified ( bool modified)

Sets the state of the document to modified.

Parameters
[in]modifiedThe modified flag to set the state.

◆ SetOpenAction()

void PDF::Document::SetOpenAction ( Action action)

Sets the open action for the document.

This defines an action that should be executed automatically when the PDF document is opened

Parameters
[in]actionThe action executed at document opening.

◆ SetOpenDestination()

void PDF::Document::SetOpenDestination ( Dest dest)

Sets the open destination for the document.

Parameters
[in]destThe destination to set as the open destination.

◆ SetPageDirection()

void PDF::Document::SetPageDirection ( PDPageDirection direction)

Sets the page direction of the document.

This specifies reading and writing order of text on a page. The two possible directions are left to right for English, Spanish, Chinese, and most Western languages and right to left for Arabic, Hebrew, Persian etc. For more information refer to section 12.2 Viewer preferences Table 147 — Entries in a viewer preferences dictionary from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]directionThe page direction to set.
See also
PDPageDirection

◆ SetPageLayout()

void PDF::Document::SetPageLayout ( PDAtom layout)

Sets the page layout of the document.

This defines how a document's pages are displayed, when first opened. There are six possible layouts - one page at a time, pages in a column etc. For more information refer to section 7.7.2 Document catalog dictionary table Table 29 — Entries in the catalog dictionary, key PageLayout from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]layoutThe page layout to set.

◆ SetPageMode()

void PDF::Document::SetPageMode ( PDAtom mode)

Sets the page mode of the document.

This defines what a document's menu bar/sidebar displays, when a document is first opened. The document's outline, thumbnails or attachments panel can be made visible among others. For more information refer to section 7.7.2 Document catalog dictionary table Table 29 — Entries in the catalog dictionary, key PageMode from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]modeThe page mode to set.

◆ SetStandardSecurityParams()

void PDF::Document::SetStandardSecurityParams ( const StdSecurityParams & requestedParams)

Sets the standard security parameters of the document.

These include the editing, printing and data extraction permissions as well as owner and user password properties. For more information on Security Parameters refer to section 7.6.4 Standard security handler from the ISO 32000-2:2020 (PDF 2.0) PDF Standard.

Parameters
[in]requestedParamsA reference to the standard security parameters to set.

The documentation for this class was generated from the following file: