DynaPDF Manual - Page 675

Previous Page 674   Index   Next Page 676

Function Reference
Page 675 of 839
Set3DAnnotScript
Syntax:
LBOOL pdfSet3DAnnotScript(
const PPDF* IPDF,
// Instance pointer
UI32 Annot,
// Handle of a 3D annotation
const char* Value, // JavaScript that should be executed
UI32 Len)
// Length of the script
The function assigns a JavaScript to a 3D annotation. JavaScripts which are assigned with a 3D
annotation have direct access to the 3D context. Global JavaScripts have only limited access to the
3D context of a 3D annotation but it is possible to execute a script that is assigned with the
annotation. Note that such JavaScripts must be accessed over the annotation:
annot = getAnnots3D(0)[0].context3D; // Get the annotation context
// This function must be defined in the JavaScript of the 3D annotation.
annot.Test();
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetAllocBy
Syntax:
LBOOL pdfSetAllocBy(
const PPDF* IPDF, // Instance pointer
SI32 Value)
// Value in KB
The function sets the size of the memory blocks in kilo bytes, which will be allocated if memory
must be allocated for page content streams. Memory allocation is slow, especially re-allocation of
memory by using realloc(). Because of this all content streams are buffered by DynaPDF to avoid too
much memory allocation calls. The property AllocBy defines the size of memory that is allocated
each time when more memory must be allocated.
The processing speed depends heavily on memory allocation. The default size of pre-allocated
memory for content streams is 16 KB. It can be set to a larger value if necessary to improve
processing speed.
However, if too much memory is allocated at runtime, processing speed will be slower and an out of
memory exception can occur. If the size is too small, processing speed is slower too because of the
many memory allocation calls.
In most cases, it is not required to change the property AllocBy.
 

Previous topic: SelfTest, Set3DAnnotProps

Next topic: SetAltFonts