DynaPDF Manual - Page 442

Previous Page 441   Index   Next Page 443

Function Reference
Page 442 of 839
GetJavaScript
Syntax:
char* pdfGetJavaScript(
const PPDF* IPDF,
// Instance pointer
UI32 AHandle,
// Handle of global JavaScript
UI32 ADDR Len,
// String length in characters
LBOOL ADDR Unicode) // If true, the return value is a Unicode string
The function returns a global JavaScript as string. The parameter AHandle must be a valid handle of
a global JavaScript. The parameter Len holds the string length in characters without null-terminator.
If Unicode is true, the return value is a Unicode string. Make a typecast to UI16* in the latter case.
The parameters Len and Unicode must both not be NULL.
The returned string is a pointer to the original value. Do not change or free the string.
To enumerate all JavaScripts of a document use the function GetJavaScriptCount() and use this
value in a simple for statement:
LBOOL unicode;
UI32 len;
char* scriptA;
UI16* scriptW;
SI32 count = pdfGetJavaScriptCount();
for (i = 0; i < count; i++)
{
scriptA = pdfGetJavaScript(i, len, unicode);
if (scriptA)
{
if (unicode)
{
scriptW = (UI16*)scriptA; // String is in Unicode format
}else
{
}
}
}
Remarks:
To get a global JavaScript by using the script's name use the function GetJavaScriptEx().
Return value:
If the function succeeds the return value is the JavaScript as Ansi or Unicode string. If the function
fails the return value is NULL.
 

Previous topic: GetIsFixedPich, GetIsTaggingEnabled, GetItalicAngle

Next topic: GetJavaScriptAction (obsolete), GetJavaScriptAction2 (obsolete)