Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 598

Previous Page 597   Index   Next Page 599

Function Reference
Page 598 of 750
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.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
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: Set3DAnnotProps

Next topic: SetAnnotBorderStyle