Skip to main content
Known Participant
April 26, 2023
Question

Acrobat Javascript

  • April 26, 2023
  • 1 reply
  • 3554 views

importDataObject (to attach a pdf file) is not working in Acrobat DC. Also not throwing any errors. I got strucked in that. Someone help me. I need a javascript code to attach a pdf file inside a main pdf file.

Note: importDataObject is woking fine in "Adobe Acrobat X Standard", but not working in "Acrobat DC Pro". Is this a bug in Adobe Javascript?

My Code is - -  this.importDataObject("Checklist", Checklist_Path);

Checklist_Path is a variable having the pdf file path with forward slashes.

Help appriciated. Thanks.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 26, 2023

Where is the code located?

ThuyavanAuthor
Known Participant
April 26, 2023

The code is located in server "C:\Program Files\Adobe\Acrobat DC\Acrobat\Javascripts"

try67
Community Expert
Community Expert
April 26, 2023

That's not enough. You have to run it from a trusted function. See:

https://acrobatusers.com/tutorials/trust-and-privilege-in-acrobat-scripts

https://acrobatusers.com/tutorials/using_trusted_functions

And if you check the JS Console you should see an error message regarding it.