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

GetDocumentJavaScriptContent Method

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

string GetDocumentJavaScriptContent(string InputFileName,
                                    NameOrIndex IndexOrName)
public class NameOrIndex {
   public NameOrIndex(string name);
   public NameOrIndex(int index);
}
Function GetDocumentJavaScriptContent(InputFileName As String, _
                                      IndexOrName As NameOrIndex) As String
Public Class NameOrIndex
   Public Sub New(name As String)
   Public Sub New(index As Integer)
End Class
def GetDocumentJavaScriptContent(self, InputFileName, IndexOrName)





String GetDocumentJavaScriptContent(String InputFileName,
                                    NameOrIndex IndexOrName) throws PDFProcessorException
public class NameOrIndex {
   public NameOrIndex(String name);
   public NameOrIndex(int index);
}
function GetDocumentJavaScriptContent($InputFileName, $IndexOrName) 





BclPrcResult GetDocumentJavaScriptContent(const BclPDFProcessorSettings* pSettings,
                                          const wchar_t* InputFileName,
                                          const wchar_t* Name,
                                          int Index,
                                          wchar_t** poutVal);

Function GetDocumentJavaScriptContent(InputFileName As String, IndexOrName As Variant) As String





Parameters

Return Values

The content of the script.

Remarks

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 that the name of a script does not affect its functionality 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.

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.GetDocumentJavaScriptContent("C:\test\input.pdf", index)
Next