Copy link to clipboard
Copied
Hello,
I'm trying to deletePags and I believe I followed the API reference correctly. I have a script in the Javascripts folder of Acrobat. On launch, I get this syntax error: this.deletePages is not a function.
For refrence, this.deletePages(2, 4); is what I am trying to use.
I will also note, that this.insertPages does not throw any error. I believe 'this', is a Doc object according to the api refrence guide.
If I open a document and manually do the deletePages from the console, it does work. For some reason it is just a parsing error on Acrobat startup. But, because of this the scripts are not available for user to use on PDFs.
Any assitance is greatly appreciated.
Copy link to clipboard
Copied
If you try to put this.deletePages(2,4) in your startup scripts, just that by itself, it CANNOT work. No files are open when the startup scripts are read. You are not the first to assume (if this is what you are assuming) that you can create a script, put it in the startup folder, and double click on a file to run the script on the file. No, nothing like that can work.
Copy link to clipboard
Copied
Every user with Acrobat Standard or Pro can use the console.
Copy link to clipboard
Copied
Sounds like you want to automate removing pages from a PDF?
Do do this you can write an automation (folder level) script that sets up a menu item or button for it.
Or just run the code from the console window.
See these links for more information (watch the video in the first one):
https://www.pdfscripting.com/public/Automating-Acrobat.cfm
https://acrobatusers.com/tutorials/add_custom_menu_items/
https://acrobatusers.com/tutorials/folder_level_scripts/
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more