HPS::Publish::DocumentKit

class HPS.Publish.DocumentKit : public HPS.SprocketKit

The DocumentKit class is a user space object. It acts as the root container for all pages in a Publish PDF.

Public Functions

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit AddDataTable (HPS.Publish.DataTableKit in_data_table)

Adds an data table to the document.

Param in_data_table

Data Table to be added into the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit AddDataTables (HPS.Publish.DataTableKit[] in_data_table)

Adds data tables to the document.

Param in_data_table

Data Tables to be added into the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

override void Dispose ()
DocumentKit ()

The default constructor creates an empty DocumentKit object.

DocumentKit (HPS.Publish.DocumentKit in_kit)

The copy constructor creates a new DocumentKit object that contains the same settings as the source DocumentKit.

Param in_kit

The source DocumentKit to copy.

override bool Empty ()

Indicates whether this DocumentKit has any values set on it.

Return

true if no values are set on this DocumentKit, false otherwise.

bool Equals (HPS.Publish.DocumentKit in_kit)

Check if the source DocumentKit is equivalent to this DocumentKit.

Param in_kit

The source DocumentKit to compare to this DocumentKit.

Return

true if the objects are equivalent, false otherwise.

override bool Equals (Object obj)
override int GetHashCode ()
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.

void Set (HPS.Publish.DocumentKit in_kit)

Copies the source DocumentKit into this DocumentKit.

Param in_kit

The source DocumentKit to copy.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit SetPage (HPS.Publish.PageKit in_page)

Adds the given page to the document. This will replace all pages (if any) which are already 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 DocumentKit.

HPS.Publish.DocumentKit SetPages (HPS.Publish.PageKit[] in_pages)

Adds the given pages to the document. This will replace all pages (if any) which are already 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

HPS.Publish.DocumentKit 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 DocumentKit.

void Show (out HPS.Publish.DocumentKit out_kit)

Copies this DocumentKit into the given DocumentKit.

Param out_kit

The DocumentKit to populate with the contents of this DocumentKit.

bool ShowAttachments (out string[] out_filenames, out string[] out_descriptions)
bool ShowDataTables (out HPS.Publish.DataTableKit[] out_data_tables)

Shows data tables on the document

Param out_data_tables

Data tables on the document.

Return

true if data tables were set, false otherwise.

bool ShowIconImages (out string[] out_names, out HPS.Publish.ImageKit[] out_images)
bool ShowInformation (out string out_title, out string out_author, out string out_subject, out string out_creator)

Shows the document title, author, subject and creator.

Param out_title

Title of the document

Param out_author

Author of the document

Param out_subject

Subject of the document

Param out_creator

Creator of the document

Return

true if a title, author, subject and creator were specified, false otherwise.

bool ShowJavaScript (out string[] out_script_names, out string[] out_sources, out HPS.Publish.Source.Type[] out_types)
bool ShowPages (out HPS.Publish.PageKit[] out_pages)

Shows the pages on the document.

Param out_pages

Pages on the document.

Return

true if pages were specified, false otherwise.

bool ShowPasswords (out string out_user_password, out string out_owner_password)

Shows the document passwords.

Param out_user_password

User password of the document.

Param out_owner_password

Owner password of the document.

Return

true if passwords were specified, false otherwise.

bool ShowPermissions (out HPS.Publish.Permission.Type[] out_permissions)

Shows permissions on the document

Param out_permissions

Permissions on the document.

Return

true if permissions were specified, false otherwise.

HPS.Publish.DocumentKit UnsetAttachment (string in_filename)

Removes the attachment with a given filename from the document.

Param in_filename

UTF8-encoded filename of attachment to remove from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetAttachments ()

Removes all attachments from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetAttachments (string[] in_filenames)

Removes the attachments with the given filenames from the document.

Param in_filenames

Filenames of attachments to remove from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetDatatables ()

Removes Data Table settings from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetEverything ()

Removes all data from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetIconImage (string in_name)

Removes the icon image with a given name from the document.

Param in_name

UTF8-encoded name of icon image to remove from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetIconImages ()

Removes all icon images from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetIconImages (string[] in_names)

Removes the icon images with the given names from the document.

Param in_names

Names of icon images to remove from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetInformation ()

Removes the document title, author, subject and creator.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetJavaScript ()

Removes all scripts from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetJavaScript (string in_script_name)

Removes the script with a given name from the document.

Param in_script_name

UTF8-encoded script name to remove from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetJavaScript (string[] in_script_names)

Removes the scripts with the given names from the document.

Param in_script_names

Script names to remove from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetPage (ulong in_index)

Removes the page at the given index from the document.

Param in_index

Index of the page to remove from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetPages ()

Removes all pages from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetPages (ulong[] in_indices)

Removes the pages at the given indices from the document.

Param in_indices

Indices of the pages to remove from the document.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetPasswords ()

Removes the document passwords.

Return

A reference to this DocumentKit.

HPS.Publish.DocumentKit UnsetPermissions ()

Removes permission settings from the document.

Return

A reference to this DocumentKit.

Public Static Functions

HPS.Publish.DocumentKit GetDefault ()

Creates a DocumentKit which contains the default settings. The returned object will not necessarily have values for every setting, but it will have them where it is reasonable to have a default. These values will be used for export unless a setting is overridden by the DocumentKit passed to File.Export.

Return

A DocumentKit with the default settings.

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