#include <sprk_publish.h>
Public Member Functions | |
DocumentKey & | AddAttachment (char const *in_filename, char const *in_description) |
DocumentKey & | AddAttachments (size_t in_count, UTF8 const in_filenames[], UTF8 const in_descriptions[]) |
DocumentKey & | AddAttachments (UTF8Array const &in_filenames, UTF8Array const &in_descriptions) |
DocumentKey & | AddIconImage (char const *in_name, ImageKit const &in_image) |
DocumentKey & | AddIconImages (size_t in_count, UTF8 const in_names[], ImageKit const in_images[]) |
DocumentKey & | AddIconImages (UTF8Array const &in_names, ImageKitArray const &in_images) |
DocumentKey & | AddJavaScript (char const *in_script_name, char const *in_source, Source::Type in_type=Source::Type::Code) |
DocumentKey & | AddJavaScript (size_t in_count, UTF8 const in_script_names[], UTF8 const in_sources[], Source::Type const in_types[]) |
DocumentKey & | AddJavaScript (UTF8Array const &in_script_names, UTF8Array const &in_sources, SourceTypeArray const &in_types) |
DocumentKey & | AddPage (PageKit const &in_page) |
DocumentKey & | AddPages (size_t in_count, PageKit const in_pages[]) |
DocumentKey & | AddPages (PageKitArray const &in_pages) |
virtual void | Assign (DocumentKey const &in_that) |
void | Delete () |
DocumentKey () | |
DocumentKey (DocumentKey const &in_that) | |
DocumentKey (DocumentKey &&in_that) | |
bool | Equals (DocumentKey const &in_that) const |
PageControl | GetPageControl (size_t in_index) |
PageControl const | GetPageControl (size_t in_index) const |
size_t | GetPageCount () const |
HPS::Type | ObjectType () const |
bool | operator!= (DocumentKey const &in_that) const |
DocumentKey & | operator= (DocumentKey const &in_that) |
DocumentKey & | operator= (DocumentKey &&in_that) |
bool | operator== (DocumentKey const &in_that) const |
DocumentKey & | RemoveAllPages () |
DocumentKey & | RemovePage (size_t in_index) |
DocumentKey & | RemovePages (size_t in_start, size_t in_count) |
DocumentKey & | RemovePages (size_t in_count, size_t const in_indices[]) |
DocumentKey & | RemovePages (SizeTArray const &in_indices) |
DocumentKey & | SetInformation (char const *in_title, char const *in_author, char const *in_subject, char const *in_creator) |
DocumentKey & | SetPasswords (char const *in_user_password, char const *in_owner_password) |
DocumentKey & | SetPermissions (size_t in_count, Permission::Type const in_permissions[]) |
DocumentKey & | SetPermissions (PermissionTypeArray const &in_permissions) |
virtual | ~DocumentKey () |
![]() | |
Sprocket (HPS::Sprocket const &in_that)=default | |
Sprocket (Sprocket &&in_that) | |
![]() | |
virtual bool | Empty () const |
intptr_t | GetClassID () const |
intptr_t | GetInstanceID () const |
bool | HasType (HPS::Type in_mask) const |
Object (Object const &that) | |
Object (Object &&in_that) | |
Object & | operator= (Object const &other_object) |
Object & | operator= (Object &&in_that) |
virtual void | Reset () |
HPS::Type | Type () const |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static intptr_t | ClassID () |
The DocumentKey class is a smart pointer to a Publish PDF document. It allows direct interaction with a PDF document.
HPS::Publish::DocumentKey::DocumentKey | ( | ) |
The default constructor creates an uninitialized DocumentKey object. The Type() function will return Type::None.
HPS::Publish::DocumentKey::DocumentKey | ( | DocumentKey const & | in_that | ) |
The copy constructor creates a DocumentKey object that shares the underlying smart-pointer of the source DocumentKey.
in_that | The source DocumentKey to copy. |
HPS::Publish::DocumentKey::DocumentKey | ( | DocumentKey && | in_that | ) |
The move constructor creates a DocumentKey by transferring the underlying object of the rvalue reference to this DocumentKey.
in_kit | An rvalue reference to a DocumentKey to take the underlying object from. |
|
virtual |
Releases a reference to this DocumentKey. When the last reference goes out of scope, the underlying PDF document will be closed and any associated memory will be released by Publish if necessary. This will not write the underlying PDF document out to disk.
DocumentKey& HPS::Publish::DocumentKey::AddAttachment | ( | char const * | in_filename, |
char const * | 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.
in_filename | UTF8-encoded filename of the file to be attached. |
in_description | UTF8-encoded description of the file to be attached. |
DocumentKey& HPS::Publish::DocumentKey::AddAttachments | ( | size_t | in_count, |
UTF8 const | in_filenames[], | ||
UTF8 const | 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.
in_count | Size of the following arrays. |
in_filenames | Filenames of the files to be attached. |
in_descriptions | Descriptions of the files to be attached. |
DocumentKey& HPS::Publish::DocumentKey::AddAttachments | ( | UTF8Array const & | in_filenames, |
UTF8Array const & | 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.
in_filenames | Filenames of the files to be attached. |
in_descriptions | Descriptions of the files to be attached. |
DocumentKey& HPS::Publish::DocumentKey::AddIconImage | ( | char const * | in_name, |
ImageKit const & | 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.
in_name | UTF8-encoded name of the icon image to be attached. |
in_image | Image to be attached as an icon. |
DocumentKey& HPS::Publish::DocumentKey::AddIconImages | ( | size_t | in_count, |
UTF8 const | in_names[], | ||
ImageKit const | 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.
in_count | Size of the following arrays. |
in_names | Names of the icon images to be attached. |
in_images | Images to be attached as icons. |
DocumentKey& HPS::Publish::DocumentKey::AddIconImages | ( | UTF8Array const & | in_names, |
ImageKitArray const & | 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.
in_names | Names of the icon images to be attached. |
in_images | Images to be attached as icons. |
DocumentKey& HPS::Publish::DocumentKey::AddJavaScript | ( | char const * | in_script_name, |
char const * | in_source, | ||
Source::Type | in_type = Source::Type::Code |
||
) |
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.
in_script_name | UTF8-encoded script name to be added to the document. |
in_source | UTF8-encoded JavaScript source or file (depending on the following argument) to be added to the document. |
in_type | The types of the preceding argument. Defaults to Source::Type::Code. |
DocumentKey& HPS::Publish::DocumentKey::AddJavaScript | ( | size_t | in_count, |
UTF8 const | in_script_names[], | ||
UTF8 const | in_sources[], | ||
Source::Type const | 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.
in_count | Size of the following arrays. |
in_script_names | Script names to be added to the document. |
in_sources | JavaScript sources and/or files (depending on the corresponding entry in the following argument) to be added to the document. |
in_types | Types for each item in the preceding argument array. |
DocumentKey& HPS::Publish::DocumentKey::AddJavaScript | ( | UTF8Array const & | in_script_names, |
UTF8Array const & | in_sources, | ||
SourceTypeArray const & | 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.
in_script_names | Script names to be added to the document. |
in_sources | JavaScript sources and/or files (depending on the corresponding entry in the following argument) to be added to the document. |
in_types | Types for each item in the preceding argument array. |
DocumentKey& HPS::Publish::DocumentKey::AddPage | ( | PageKit const & | 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.
in_page | Page to add to the document. |
DocumentKey& HPS::Publish::DocumentKey::AddPages | ( | size_t | in_count, |
PageKit const | 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.
in_count | Size of the Following array. |
in_pages | Pages to add to the document. |
DocumentKey& HPS::Publish::DocumentKey::AddPages | ( | PageKitArray const & | 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.
in_pages | Pages to add to the document. |
|
virtual |
Share the underlying smart-pointer of the DocumentKey source.
in_that | The DocumentKey source of the assignment. |
void HPS::Publish::DocumentKey::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.
bool HPS::Publish::DocumentKey::Equals | ( | DocumentKey const & | in_that | ) | const |
Check if the source DocumentKey points to the same underlying impl as this DocumentKey.
in_that | The source DocumentKey to compare to this DocumentKey. |
PageControl HPS::Publish::DocumentKey::GetPageControl | ( | size_t | 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.
in_index | The index of the page for which to create a PageControl. The index of the first page is 0. |
PageControl const HPS::Publish::DocumentKey::GetPageControl | ( | size_t | in_index | ) | const |
Returns a control that allows the user to manipulate and query details of a page at the given index in the underlying PDF document.
in_index | The index of the page for which to create a PageControl. The index of the first page is 0. |
size_t HPS::Publish::DocumentKey::GetPageCount | ( | ) | const |
Gets the number of pages in the underlying PDF document.
|
inlinevirtual |
This function returns the type the object, as declared. This does not necessarily give the true type of the underlying object.
Reimplemented from HPS::Object.
bool HPS::Publish::DocumentKey::operator!= | ( | DocumentKey const & | in_that | ) | const |
Check if the source DocumentKey points to a different impl than this DocumentKey.
in_that | The source DocumentKey to compare to this DocumentKey. |
DocumentKey& HPS::Publish::DocumentKey::operator= | ( | DocumentKey const & | in_that | ) |
Share the underlying smart-pointer of the DocumentKey source.
in_that | The DocumentKey source of the assignment. |
DocumentKey& HPS::Publish::DocumentKey::operator= | ( | DocumentKey && | in_that | ) |
The move assignment operator transfers the underlying object of the rvalue reference to this DocumentKey.
in_kit | An rvalue reference to a DocumentKey to take the underlying object from. |
bool HPS::Publish::DocumentKey::operator== | ( | DocumentKey const & | in_that | ) | const |
Check if the source DocumentKey points to the same underlying impl as this DocumentKey.
in_that | The source DocumentKey to compare to this DocumentKey. |
DocumentKey& HPS::Publish::DocumentKey::RemoveAllPages | ( | ) |
Removes all pages from the underlying PDF document.
DocumentKey& HPS::Publish::DocumentKey::RemovePage | ( | size_t | in_index | ) |
Removes the page at the given index from the underlying PDF document.
in_index | The index of the page to remove from the underlying PDF document. The index of the first page is 0. |
DocumentKey& HPS::Publish::DocumentKey::RemovePages | ( | size_t | in_start, |
size_t | in_count | ||
) |
Removes the specified number of pages starting at the given index from the underlying PDF document.
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. |
in_count | The number of pages to remove from the underlying PDF document. |
DocumentKey& HPS::Publish::DocumentKey::RemovePages | ( | size_t | in_count, |
size_t const | in_indices[] | ||
) |
Removes the pages at the given indices from the underlying PDF document.
in_count | Size of the following array. |
in_indices | The indices of pages to remove from the underlying PDF document. The index of the first page is 0. |
DocumentKey& HPS::Publish::DocumentKey::RemovePages | ( | SizeTArray const & | in_indices | ) |
Removes the pages at the given indices from the underlying PDF document.
in_indices | The indices of pages to remove from the underlying PDF document. The index of the first page is 0. |
DocumentKey& HPS::Publish::DocumentKey::SetInformation | ( | char const * | in_title, |
char const * | in_author, | ||
char const * | in_subject, | ||
char const * | 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).
in_title | UTF8-encoded title string to set on the document. |
in_author | UTF8-encoded author string to set on the document. |
in_subject | UTF8-encoded subject string to set on the document. |
in_creator | UTF8-encoded creator string to set on the document. |
DocumentKey& HPS::Publish::DocumentKey::SetPasswords | ( | char const * | in_user_password, |
char const * | in_owner_password | ||
) |
Sets the passwords for this document. This corresponds to the value that will be passed to A3DPDFDocumentSetPassword.
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. |
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. |
DocumentKey& HPS::Publish::DocumentKey::SetPermissions | ( | size_t | in_count, |
Permission::Type const | in_permissions[] | ||
) |
Sets document permissions. This correspond to the values that will be passed to A3DPDFDocumentSetDocumentPermissions.
in_count | Size of the following array. |
in_permissions | The permissions to be set on the document. |
DocumentKey& HPS::Publish::DocumentKey::SetPermissions | ( | PermissionTypeArray const & | in_permissions | ) |
Sets document permissions. This correspond to the values that will be passed to A3DPDFDocumentSetDocumentPermissions.
in_permissions | The permissions to be set on the document. |