Index

C/C++ Functions

pdDocIni

DT_SWORD pdDocIni(DT_PDDOC* power_doc, DT_PDENGINE engine)

Short Description: Create and initialize document

The pdDocIni function creates and initializes a new Power Engine document (also called PowerDoc document). A Power Engine document initialized in this way is blank, i.e. it does not contain any PowerDoc objects or PowerDoc images.

Parameters

ParameterDescription

power_doc

Pointer to the handle of the newly created Power Engine document.

engine

Handle of the Power Engine instance to be associated with the newly created Power Engine document. The associated Power Engine will then be responsible for handling and rendering the document. It is important to note that many Power Engine documents can be associated with the same Power Engine. This means that a single Power Engine can handle and render many Power Engine documents.

Return Value

If the initialization was successful, the return value is 1. Otherwise, the function returns 0.

Comments

In Power Engine API, a new empty Power Engine document is created by calling the pdDocIni function. To create a new empty Power Engine document, an application must specify the Power Engine instance that will handle and render this document. In a typical application, a single Power Engine instance will handle and render all Power Engine documents that are created during its execution. This means that most applications will use the same engine in every call to pdDocIni. This is also the recommended approach. Exceptions are certain types of multi-threaded applications in which Power Engine documents must be accessed and rendered simultaneously. In those cases, it is possible to have a pool of Power Engine instances set up in a way that allows each Power Engine instance to handle one (or a certain number) of Power Engine documents.

Each Power Engine document is created dynamically and must be destroyed by calling the pdDocExt function before its Power Engine instance is destroyed.

Related Functions

pdDocExt

 

Index