HPS::Publish::DocumentKey

class HPS.Publish.DocumentKey : public HPS.Sprocket

The DocumentKey class is a smart pointer to a Publish PDF document. It allows direct interaction with a PDF document.

Public Functions

HPS.Publish.DocumentKey AddAttachment (string in_filename, string in_description)

Adds an attachment to the document. If there is an existing attachment on the document with the given filename, it will get overwritten. This corresponds to the value that will be passed to A3DPDFDocumentAddFileAttachment.

Param in_filename

UTF8-encoded filename of the file to be attached.

Param in_description

UTF8-encoded description of the file to be attached.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey AddAttachments (string[] in_filenames, string[] in_descriptions)

Adds a list of attachments to the document. If there is an existing attachment on the document with a filename which is in the given list, it will get overwritten. These correspond to values that will be passed to A3DPDFDocumentAddFileAttachment.

Param in_filenames

Filenames of the files to be attached.

Param in_descriptions

Descriptions of the files to be attached.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey AddIconImage (string in_name, HPS.Publish.ImageKit in_image)

Adds an icon image to the document. If there is an existing icon image on the document with the given name, it will get overwritten. This corresponds to the value that will be passed to A3DPDFDocumentAddImageAsIcon.

Param in_name

UTF8-encoded name of the icon image to be attached.

Param in_image

Image to be attached as an icon.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey AddIconImages (string[] in_names, HPS.Publish.ImageKit[] in_images)

Adds icon images to the document. If there is an existing icon image on the document with a name which is in the given list, it will get overwritten. These correspond to the values that will be passed to A3DPDFDocumentAddImageAsIcon.

Param in_names

Names of the icon images to be attached.

Param in_images

Images to be attached as icons.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey AddJavaScript (string in_script_name, string in_source)

Adds a named JavaScript source or file to the document. If there is an existing script on the document with the given name, it will get overwritten. This corresponds to the value that will be passed to A3DPDFDocumentAddJavascriptFromString.

Param in_script_name

UTF8-encoded script name to be added to the document.

Param in_source

UTF8-encoded JavaScript source or file (depending on the following argument) to be added to the document.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey AddJavaScript (string in_script_name, string in_source, HPS.Publish.Source.Type in_type)

Adds a named JavaScript source or file to the document. If there is an existing script on the document with the given name, it will get overwritten. This corresponds to the value that will be passed to A3DPDFDocumentAddJavascriptFromString.

Param in_script_name

UTF8-encoded script name to be added to the document.

Param in_source

UTF8-encoded JavaScript source or file (depending on the following argument) to be added to the document.

Param in_type

The types of the preceding argument. Defaults to Source.Type.Code.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey AddJavaScript (string[] in_script_names, string[] in_sources, HPS.Publish.Source.Type[] in_types)

Adds a list of named JavaScript sources or files to the document. If there is an existing script on the document with a name which is in the given list, it will get overwritten. These correspond to values that will be passed to A3DPDFDocumentAddJavascriptFromString.

Param in_script_names

Script names to be added to the document.

Param in_sources

JavaScript sources and/or files (depending on the corresponding entry in the following argument) to be added to the document.

Param in_types

Types for each item in the preceding argument array.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey AddPage (HPS.Publish.PageKit in_page)

Adds the given page to the document. This will append the page after any existing pages on the document. This corresponds to the value that will be passed to A3DPDFDocumentAppendNewPage or A3DPDFDocumentAppendPageFromPDFFileEx.

Param in_page

Page to add to the document.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey AddPages (HPS.Publish.PageKit[] in_pages)

Adds the given pages to the document. This will append the pages after any existing pages on the document. These correspond to values that will be passed to A3DPDFDocumentAppendNewPage or A3DPDFDocumentAppendPageFromPDFFileEx.

Param in_pages

Pages to add to the document.

Return

A reference to this DocumentKey.

void Assign (HPS.Publish.DocumentKey in_that)

Share the underlying smart-pointer of the DocumentKey source.

Param in_that

The DocumentKey source of the assignment.

Return

A reference to this DocumentKey.

void Delete ()

Closes the PDF document underlying this DocumentKey and frees the associated memory in Publish. This will effectively invalidate all references to the underlying PDF document (including other DocumentKey or PageControl objects which refer to the same document). This will not write the underlying PDF document out to disk.

override void Dispose ()
DocumentKey ()

The default constructor creates an uninitialized DocumentKey object. The Type() function will return Type.None.

DocumentKey (HPS.Publish.DocumentKey in_that)

The copy constructor creates a DocumentKey object that shares the underlying smart-pointer of the source DocumentKey.

Param in_that

The source DocumentKey to copy.

bool Equals (HPS.Publish.DocumentKey in_that)

Check if the source DocumentKey points to the same underlying impl as this DocumentKey.

Param in_that

The source DocumentKey to compare to this DocumentKey.

Return

true if the objects reference the same impl, false otherwise.

override bool Equals (Object obj)
override int GetHashCode ()
HPS.Publish.PageControl GetPageControl (ulong in_index)

Returns a control that allows the user to manipulate and query details of a page at the given index in the underlying PDF document.

Param in_index

The index of the page for which to create a PageControl. The index of the first page is 0.

Return

A PageControl object for the specified page.

ulong GetPageCount ()

Gets the number of pages in the underlying PDF document.

override HPS.Type ObjectType ()

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Return

The declared type of the object in question, which may differ from the true, underlying type.

HPS.Publish.DocumentKey RemoveAllPages ()

Removes all pages from the underlying PDF document.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey RemovePage (ulong in_index)

Removes the page at the given index from the underlying PDF document.

Param in_index

The index of the page to remove from the underlying PDF document. The index of the first page is 0.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey RemovePages (ulong in_start, ulong in_count)

Removes the specified number of pages starting at the given index from the underlying PDF document.

Param in_start

The first index at which to start to removing pages from the underlying PDF document. The index of the first page is 0.

Param in_count

The number of pages to remove from the underlying PDF document.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey RemovePages (ulong[] in_indices)

Removes the pages at the given indices from the underlying PDF document.

Param in_indices

The indices of pages to remove from the underlying PDF document. The index of the first page is 0.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey SetInformation (string in_title, string in_author, string in_subject, string in_creator)

Sets the title, author, subject and creator for this document. These corresponds to the values that will be passed to A3DPDFDocumentInformationData::m_pcTitle, A3DPDFDocumentInformationData::m_pcAuthor, A3DPDFDocumentInformationData::m_pcSubject, and A3DPDFDocumentInformationData::m_pcCreator (respectively).

Param in_title

UTF8-encoded title string to set on the document.

Param in_author

UTF8-encoded author string to set on the document.

Param in_subject

UTF8-encoded subject string to set on the document.

Param in_creator

UTF8-encoded creator string to set on the document.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey SetPasswords (string in_user_password, string in_owner_password)

Sets the passwords for this document. This corresponds to the value that will be passed to A3DPDFDocumentSetPassword.

Param in_user_password

UTF8-encoded password string required when opening, modifying or printing the document. If an empty string is specified, no password will be required.

Param in_owner_password

UTF8-encoded password string required when changing security features of document. If an empty string is specified, no password will be required.

Return

A reference to this DocumentKey.

HPS.Publish.DocumentKey SetPermissions (HPS.Publish.Permission.Type[] in_permissions)

Sets document permissions. This correspond to the values that will be passed to A3DPDFDocumentSetDocumentPermissions.

Param in_permissions

The permissions to be set on the document.

Return

A reference to this DocumentKey.

Public Static Functions

bool operator!= (HPS.Publish.DocumentKey a, HPS.Publish.DocumentKey b)
bool operator== (HPS.Publish.DocumentKey a, HPS.Publish.DocumentKey b)