easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

GetDocumentJavaScriptsCount Method

Gets the number of document-level JavaScripts in the PDF.

int GetDocumentJavaScriptsCount(string InputFileName)

Function GetDocumentJavaScriptsCount(InputFileName As String) As Integer

def GetDocumentJavaScriptsCount(self, InputFileName)

int GetDocumentJavaScriptsCount(String InputFileName) throws PDFProcessorException

function GetDocumentJavaScriptsCount($InputFileName) 

BclPrcResult GetDocumentJavaScriptsCount(const BclPDFProcessorSettings* pSettings,
                                         const wchar_t* InputFileName,
                                         int* poutVal);
Function GetDocumentJavaScriptsCount(InputFileName As String) As Long


Return Values

The number of document-level JavaScripts in the PDF. 0 means no scripts, 1 means a single script, and so on.


Each script is auto-executed upon document open. All JavaScript function definitions are global, and available to be called from other scripts in the PDF. Multiple scripts behave as if they were merged into a single big script.

To enumerate all scripts in a document, use functions GetDocumentJavaScriptsCount, GetDocumentJavaScriptName, GetDocumentJavaScriptContent.

Note: This function only counts the global document-level scripts, and ignores local JavaScript actions in annotations, hyperlinks, form fields, etc.

Example Usage

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
scriptsCount = oProcessor.GetDocumentJavaScriptsCount("C:\test\input.pdf")
MsgBox "The document has " & scriptsCount & " global script(s)."