Skip to main content
Participating Frequently
October 14, 2024
Question

Javascript for inserting a certain file before another to form a unit

  • October 14, 2024
  • 1 reply
  • 652 views

Hi, 

I look for a Javascript. A PDF file called x, located in a specific place, is to be inserted before a PDF document called y. It should be possible to link this to a button so that the process is carried out when the button is pressed. The file should then be called like the file y with a suplement like versioning.  I would like you to provide and explain how I insert the code into Adobe Acrobat. Thanks for your help. 

 

Regards, Franz

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
October 14, 2024

You can insert pages to a file using the insertPages command, but you can't just call this command from a button. It requires a privileged context, which usually means a script that runs from a local file on the computer, not just within the PDF file itself. Also, it will only work in Acrobat, of course, not the free Reader.

Not sure what you mean about "versioning".

Franz5C1DAuthor
Participating Frequently
October 15, 2024

Hi, thanks for the answer. Versioning means that the file is named otherwise after the inserting of the  document like a new date in the document name.  It would be no problem if there a local file must be installed. 

Is this much effort to create such a file ?

 

Regards, Franz

try67
Community Expert
Community Expert
October 15, 2024

OK, that is possible, but would also require installing a script file locally.

 

If you're interested in hiring a professional to create it for you, feel free to contact me privately by clicking my user-name and then on the blue "Message" button.