Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Directly edit PDF Javascript

Community Beginner ,
Dec 30, 2021 Dec 30, 2021

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!

TOPICS
Edit and convert PDFs , JavaScript , PDF forms
792
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 31, 2021 Dec 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 04, 2022 Jan 04, 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)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 04, 2022 Jan 04, 2022

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 06, 2022 Jan 06, 2022
LATEST

I think that you are operating under some bad assumptions about the nature of PDF.

Here are a couple of video tutorials that explain exactly what a PDF is, and it's relationship to JavaScript.

 

https://www.pdfscripting.com/public/FreeStuff/AcroForm_Concepts/Part1g_WhatsPDF_mp4.cfm 

https://www.pdfscripting.com/public/images/Free_Videos/BeginJS_InAcrobat_Free_mp4.cfm

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 31, 2021 Dec 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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines