Take a survey

Developing Applications Using APIs > Assembling PDF Documents > Setting Other Document Properties > Using document level JavaScript

Using document level JavaScript
The JavaScript element specifies a document-level script to be added to the result PDF document. When the PDF document is opened, all document-level scripts are executed. The NoJavaScripts element may be used to not include any scripts either in the result or from a source. For more information, see Document Description XML Reference.
In the following example, a document level JavaScript named "onOpen" is added to the result PDF document. Even if pdf1 contains a document level JavaScript by the name of "onOpen", it is not included in the result. The input data stream associated with "js1" is included in resultDoc as the JavaScript named "onOpen" instead.
Example: Adding a document level JavaScript to the result PDF document
<PDF result="resultDoc">
	<PDF source="pdf1"/>
	<JavaScript source="js1", name="onOpen"/>
</PDF>
In the next example, the only document level JavaScript that appears in the result PDF document is the one that exists in the base document, pdf1. Any scripts contained in pdf2, pdf3, or pdf4 are excluded from the result. This is accomplished by specifying the NoJavaScripts element.
Example: Including document level JavaScript only from the base document
<PDF result="resultDoc">
	<PDF source="pdf1"/>
	<PDFGroup>
		<NoJavaScripts/>
		<PDF source="pdf2"/>
		<PDF source="pdf3"/>
		<PDF source="pdf4"/>
	</PDFGroup>
</PDF>
 

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/assemblePDFDocument_properties.101.9.html