Hopding / pdf-lib

Create and modify PDF documents in any JavaScript environment
https://pdf-lib.js.org
MIT License
6.6k stars 635 forks source link

Javascript script not showing and not editable in Adobe Acrobat Pro X1 #1557

Open nux1701 opened 8 months ago

nux1701 commented 8 months ago

What were you trying to do?

Look at and edit added Javascript with PDF-Lib

How did you attempt to do it?

Ran the following code : pdf.addJavaScript('start', 'console.show(); console.println("hello");');

What actually happened?

Console showed up with 'hello' message, but Document Javascript dialog in Acrobat Pro lists start as empty, and is not editable. image

What did you expect to happen?

Being able to see the script and edit it in the editor.

How can we reproduce the issue?

  1. Create a PDF or load an existing one.
  2. Add Javascript : pdf.addJavaScript('start', 'console.show(); console.println("hello");');
  3. Save PDF
  4. Open PDF with Acrobat Pro XI
  5. Go to Edit > Other Tasks > Javascript Scripts
  6. Notice your script as empty and not editable

Version

1.17.1

What environment are you running pdf-lib in?

Node

Checklist

Additional Notes

No response