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

GetDocumentJavaScriptName Method

Gets the name of a specific document-level JavaScript in the PDF. It can be used to enumerate the names of all scripts.

Function GetDocumentJavaScriptName(InputFileName As String, Index As Long) As String

string GetDocumentJavaScriptName(string InputFileName, int Index)

String GetDocumentJavaScriptName(String InputFileName, int Index) throws PDFProcessorException


Return Values

The name of the script. Note that the name does not affect the functionality of the script in any way. It is only used for organizational and documentation purposes. You can consider the name of the script as a comment. However, each script must have a unique name that may not be empty.


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 enumerates 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")
For index = 0 To scriptsCount - 1
   MsgBox oProcessor.GetDocumentJavaScriptName("C:\test\input.pdf", index)