CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
OdPdfPublish::OdDocument Class Reference

#include <PdfPublishDocument.h>

Inheritance diagram for OdPdfPublish::OdDocument:
OdPdfPublish::OdObject OdRxObject

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdDocument)
 
 ODRX_HEAP_OPERATORS ()
 
virtual ~OdDocument ()
 
void setInformation (const OdString &title, const OdString &author, const OdString &subject, const OdString &creator)
 
void addJavaScript (const OdString &name, const OdString &source, const Source::Type source_type=Source::kCode)
 
void addIconImage (const OdString &name, const OdImagePtr &image)
 
void addPage (const OdPagePtr &page)
 
void addAttachment (const OdString &file_name, const OdString &description)
 
void setUserPassword (const OdString &user_password)
 
void setOwnerPassword (const OdString &owner_password)
 
void setAccessPermissionFlags (const AccessPermissions::AccessPermissionsFlags flags)
 
void getInformation (OdString &title, OdString &author, OdString &subject, OdString &creator) const
 
void getJavaScripts (OdStringArray &names, OdStringArray &sources, OdSourceTypeArray &source_types) const
 
void getIconImages (OdStringArray &names, OdImagePtrArray &images) const
 
void getPages (OdPagePtrArray &pages) const
 
void getAttachments (OdStringArray &file_names, OdStringArray &descriptions)
 
void getUserPassword (OdString &user_password) const
 
void getOwnerPassword (OdString &owner_password) const
 
AccessPermissions::AccessPermissionsFlags getAccessPermissionFlags () const
 
void setHostServices (OdDbBaseHostAppServices *pHostApp)
 
OdDbBaseHostAppServicesappServices () const
 
- Public Member Functions inherited from OdPdfPublish::OdObject
 ODRX_DECLARE_MEMBERS (OdObject)
 
 ODRX_HEAP_OPERATORS ()
 
virtual ~OdObject ()
 
virtual bool isEmpty () const
 
virtual bool isValid () const
 
virtual void clear ()
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Protected Member Functions

 OdDocument ()
 
- Protected Member Functions inherited from OdPdfPublish::OdObject
 OdObject (OdPublishObjectImpl *pImpl)
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

This class implements working with a .pdf document created with Publish SDK. A document is a container for other elements and controls (such as <link OdPdfPublish::OdPage, pages>, <link OdPdfPublish::OdImage, images>, <link OdPdfPublish::OdLink, links>, <link OdPdfPublish::OdAnnotation, annotations>, and so on).

Definition at line 51 of file PdfPublishDocument.h.

Constructor & Destructor Documentation

◆ OdDocument()

OdPdfPublish::OdDocument::OdDocument ( )
protected

◆ ~OdDocument()

virtual OdPdfPublish::OdDocument::~OdDocument ( )
virtual

Destroys the Publish SDK document.

Member Function Documentation

◆ addAttachment()

void OdPdfPublish::OdDocument::addAttachment ( const OdString file_name,
const OdString description 
)

Adds a new attachment file to the ODA Publish document.

Parameters
file_name[in] A string that contains the name of the file to be attached.
description[in] A string that contains the description of the file to be attached.
Remarks
If there is an existing attachment on the document with the given filename, it will get overwritten.

◆ addIconImage()

void OdPdfPublish::OdDocument::addIconImage ( const OdString name,
const OdImagePtr &  image 
)

Adds a new icon <link OdPdfPublish::OdImage, image> to the Publish SDK document.

Parameters
name[in] A name of an icon image.
image[in] A smart pointer to an image object.
See also
<link OdPdfPublish::OdImage, OdImage class>.

◆ addJavaScript()

void OdPdfPublish::OdDocument::addJavaScript ( const OdString name,
const OdString source,
const Source::Type  source_type = Source::kCode 
)

Adds a new JavaScript scenario to the Publish SDK document.

Parameters
name[in] A name of a JavaScript scenario.
source[in] Source code text of a JavaScript scenario.
source_type[in] JavaScript scenario source type.
Remarks
The script name must be unique in the set of document scripts.
See also
<link OdPdfPublish::Source::Type, Source::Type enumeration>.

◆ addPage()

void OdPdfPublish::OdDocument::addPage ( const OdPagePtr &  page)

Adds a new <link OdPdfPublish::OdPage, page> to the Publish SDK document.

Parameters
page[in] A smart pointer to the OdPage object that should be added.
See also
<link OdPdfPublish::OdPage, OdPage class>.

◆ appServices()

OdDbBaseHostAppServices * OdPdfPublish::OdDocument::appServices ( ) const

Gets the current application services object for the document.

Returns
Returns a pointer to the database application services object.

◆ getAccessPermissionFlags()

AccessPermissions::AccessPermissionsFlags OdPdfPublish::OdDocument::getAccessPermissionFlags ( ) const

Retrieves the current access permission flags.

Returns
A value of the AccessPermissionsFlags data type that represents the current value of access permission flags.

◆ getAttachments()

void OdPdfPublish::OdDocument::getAttachments ( OdStringArray file_names,
OdStringArray descriptions 
)

Retrieves names of files currently attached to the Publish document. The method fills passed string arrays with file names and descriptions; then returns them to a calling subroutine.

Parameters
file_names[out] A placeholder for names of attached files.
descriptions[out] A placeholder for descriptions of attached files.

◆ getIconImages()

void OdPdfPublish::OdDocument::getIconImages ( OdStringArray names,
OdImagePtrArray &  images 
) const

Returns a collection of icon <link OdPdfPublish::OdImage, images> from the Publish SDK document. This method fills the passed string array and smart pointer array with image names and pointers to image objects, then returns them to a calling subroutine.

Parameters
names[out] A placeholder for icon image names.
images[out] A placeholder for an array of smart pointers that point to the document icon images.
See also
<link OdPdfPublish::OdImage, OdImage class>.

◆ getInformation()

void OdPdfPublish::OdDocument::getInformation ( OdString title,
OdString author,
OdString subject,
OdString creator 
) const

Returns the current common information about the Publish SDK document. This method fills the passed strings and returns them to a calling subroutine.

Parameters
title[out] A placeholder for the document title.
author[out] A placeholder for the document author.
subject[out] A placeholder for the document subject.
creator[out] A placeholder for the information about the document creator.

◆ getJavaScripts()

void OdPdfPublish::OdDocument::getJavaScripts ( OdStringArray names,
OdStringArray sources,
OdSourceTypeArray source_types 
) const

Returns the collection of JavaScript scenarios encapsulated in the Publish SDK document. This method fills the passed arrays with names, source code text and source code types, then returns them to a calling subroutine.

Parameters
names[out] A placeholder for JavaScript scenario names.
sources[out] A placeholder for JavaScript scenario source code text.
source_types[out] A placeholder for JavaScript scenario source code types.

◆ getOwnerPassword()

void OdPdfPublish::OdDocument::getOwnerPassword ( OdString owner_password) const

Retrieves the current owner password for the output PDF document.

Parameters
owner_password[out] A placeholder for the current PDF document owner password.

◆ getPages()

void OdPdfPublish::OdDocument::getPages ( OdPagePtrArray &  pages) const

Returns the array of <link OdPdfPublish::OdPage, pages> that the Publish SDK document contains. This method fills the passed array with the OdPage object that represents the document pages and returns it to a calling subroutine.

Parameters
pages[out] A placeholder for the document pages array.
See also
<link OdPdfPublish::OdPage, OdPage class>.

◆ getUserPassword()

void OdPdfPublish::OdDocument::getUserPassword ( OdString user_password) const

Retrieves the current user password for the output PDF document.

Parameters
user_password[out] A placeholder for the current PDF document user password.

◆ ODRX_DECLARE_MEMBERS()

OdPdfPublish::OdDocument::ODRX_DECLARE_MEMBERS ( OdDocument  )

◆ ODRX_HEAP_OPERATORS()

OdPdfPublish::OdDocument::ODRX_HEAP_OPERATORS ( )

◆ setAccessPermissionFlags()

void OdPdfPublish::OdDocument::setAccessPermissionFlags ( const AccessPermissions::AccessPermissionsFlags  flags)

Sets a new access permission flags value for the output PDF document.

Parameters
flags[in] An instance of access permission flags to be set.

◆ setHostServices()

void OdPdfPublish::OdDocument::setHostServices ( OdDbBaseHostAppServices pHostApp)

Sets a new application services object for the document.

Parameters
pHostApp[in] A pointer to a database application services object.

◆ setInformation()

void OdPdfPublish::OdDocument::setInformation ( const OdString title,
const OdString author,
const OdString subject,
const OdString creator 
)

Sets common information about the Publish SDK document.

Parameters
title[in] A string that contains the document title.
author[in] A string that contains the document author.
subject[in] A string that contains the document subject.
creator[in] A string that contains information about the document creator.

◆ setOwnerPassword()

void OdPdfPublish::OdDocument::setOwnerPassword ( const OdString owner_password)

Sets a new owner password for the output PDF document.

Parameters
owner_password[in] A new value for the output document's owner password.
Remarks
If only the owner password is set, the password will not be requested when viewing. Access permission flags are taken into account.

◆ setUserPassword()

void OdPdfPublish::OdDocument::setUserPassword ( const OdString user_password)

Sets a new user password for the output PDF document.

Parameters
user_password[in] A new value for the output document's user password.
Remarks
If only a user password is set, Adobe Readers will use that password only as a view password. The access permission flags are ignored in this case. For other applications that read PDF, access permission flags are taken into account. If the owner password is additionally set and it is not equal to the user password, the access permission flags are taken into account.

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