JavaScript is the cross-platform scripting language of the Adobe Acrobat family of products that includes Acrobat Professional, Acrobat Standard, and Adobe Reader. Through JavaScript extensions, the viewer application and its plug-ins expose much of their functionality to document authors, form designers, and plug-in developers.
With VeryPDF Javascript to PDF Embedder Command Line software, you can embed Javascript code into PDF files easily, you can run Javascript code when executing open/close PDF document, before/after PDF printing, before/after PDF saving, etc. actions.
1. Download and install | 2. Command line examples |
---|---|
3. Command options | 4. Acrobat Javascript API Reference Documents |
VeryPDF Javascript to PDF Embedder Command Line is a portable application, and it does not need to install. Download the package, unpack it to the disk, open a command prompt window in Windows system, and then you may run it.
The usage rule of the program is
addjs2pdf.exe [options] <PDF-file> [<PDF-file>]In this command line, "addjs2pdf.exe" is the executable file, field of options is for specifying options, the first "<PDF-file>" indicates an input PDF file, the second "<PDF-file>" indicates an output PDF file. The following command line will insert Javascript codes to document open/close, before/after document printing, before/after document saving six actions, input PDF file is help.pdf and output PDF file is output.pdf file, and show the processing information to console.
addjs2pdf.exe -runatopen js-runat-open.txt -runatclose js-runat-close.txt
-runbfprint js-runat-before-printing.txt -runafprint js-runat-after-printing.txt
-runbfsave js-runat-before-saving.txt -runafsave js-runat-after-saving.txt
help.pdf output.pdf
The following are more command line examples,
addjs2pdf.exe -runatopen js-full.txt help.pdf help_full_js.pdf
addjs2pdf.exe -runatopen js-runat-open-printing-remove-watermark.txt
-runbfprint js-runat-before-printing-add-watermark.txt
-runafprint js-runat-after-printing-remove-watermark.txt
help.pdf print-with-watermark.pdf
addjs2pdf.exe -runatopen js-runat-open-watermark.txt help.pdf show-watermark.pdf addjs2pdf.exe -runatopen CreatePageBookmarks.txt help.pdf create_bookmarks.pdf addjs2pdf.exe -runatopen js-set-expiration-date.txt help.pdf expiration_date.pdf addjs2pdf.exe -runatopen js-hide-buttons.txt help.pdf hide-buttons.pdf
VeryPDF Javascript to PDF Embedder Command Line is easy to use, and it has these options:
D:\>addjs2pdf.exe
VeryPDF Javascript to PDF Embedder Command Line v3.0 (addjs2pdf.exe)
Add Javascript to Existing PDF files.
add-js-to-pdf, use it to add embedded JavaScript to a PDF document that
will execute automatically when the document is opened, printed or saved.
Copyright 1996-2014 VeryPDF.com Inc.
Product Name: VeryPDF Javascript to PDF Embedder Command Line v3.0
http://www.verypdf.com
http://www.verydoc.com
Support: http://support.verypdf.com
Email: support@verypdf.com
Usage: addjs2pdf.exe [options] <PDF-file> [<PDF-file>]
-runatopen <string> : Run javascript code or js file at document opening
-runatclose <string>: Run javascript code or js file at before document closing
-runbfprint <string>: Run javascript code or js file at before printing
-runafprint <string>: Run javascript code or js file at after printing
-runbfsave <string> : Run javascript code or js file at before saving
-runafsave <string> : Run javascript code or js file at after saving
-js <string> : same as -runatopen parameter
-opw <string> : owner password (for encrypted files)
-upw <string> : user password (for encrypted files)
-h : print usage information
-help : print usage information
--help : print usage information
-? : print usage information
-$ <string> : input your license key
Examples:
addjs2pdf.exe -runatopen "app.alert('Test', 1, 0);" D:\test.pdf D:\out.pdf
addjs2pdf.exe -runatopen D:\js.txt D:\test.pdf D:\out.pdf
addjs2pdf.exe -runatopen D:\js.txt -runatclose D:\js.txt D:\test.pdf D:\out.pdf
addjs2pdf.exe -runbfprint D:\addwatermark.js -runafprint removewatermark.js
D:\test.pdf D:\out.pdf
addjs2pdf.exe -runbfsave D:\ad dwatermark.js -runafsave removewatermark.js
D:\test.pdf D:\out.pdf
addjs2pdf.exe -$ XXXX-XXXX-XXXX-XXXX -runatopen D:\js.txt D:\test.pdf D:\out.pdf
addjs2pdf.exe -js D:\js.txt D:\test.pdf D:\out.pdf
addjs2pdf.exe -$ XXXX-XXXX-XXXX-XXXX
http://online.verypdf.com/u/1/Acro6JSGuide.pdf
http://online.verypdf.com/u/1/AcroJS-MM.pdf
http://online.verypdf.com/u/1/AcroJS.pdf
http://online.verypdf.com/u/1/AcroJSGuide.pdf
http://online.verypdf.com/u/1/acrojs_4.pdf
http://online.verypdf.com/u/1/js_api_reference.pdf
http://online.verypdf.com/u/1/js_developer_guide.pdf
http://online.verypdf.com/u/1/VBJavaScript.pdf