Skip to main content
Participating Frequently
December 30, 2021
Question

Directly edit PDF Javascript

  • December 30, 2021
  • 2 replies
  • 1482 views

Hello everyone -- I can code in Java and Javascripting has been fairly simple within the GUI, however for some things (especially repeated changes) I would prefer to directly edit/create a PDF form using javascript.  Is there any way to 'talk to' an acrobat PDF to change it directly? Or to view the full javascript of the PDF object?

 

Thanks!

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
December 31, 2021

If I understand you correctly, you want to use a script to modify scripts in a PDF. If true, then the answer is Yes, but you'll need to learn a bit about programming in JavaScript. 

 

You can start by reading this:

https://www.pdfscripting.com/public/Editing-Fields-Properties.cfm?sd=40#JScript

and watch the videos here on scripting:

https://www.pdfscripting.com/public/Free_Videos.cfm#JSIntro

 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
December 31, 2021

You need to clearly define what you mean by "change it directly". A script within Acrobat is very limited in what it can do to a PDF file.

Participating Frequently
January 4, 2022

I mean that I would be able to write a script to view the underlying JavaScript used to create the entire PDF.  Then I could simply modify from the JavaScript.  (Or a button such as File -> export JavaScript but I don't think that exists)

try67
Community Expert
Community Expert
January 4, 2022

PDF files are not created using JS (in 99% of cases), so no, you can't do that.