Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum. |
XI Action - Print PDF to PDF |
Post Reply ![]() |
Author | |
Lawguy ![]() New Member ![]() Joined: 19 Jul 2012 Location: Denver Points: 5 |
![]() ![]() ![]() ![]() Posted: 21 Apr 2015 at 3:55am |
I have a folder of PDFs to which I have applied Bates numbering. I want to create an Action (Acrobat XI) that will print these PDFs with the Bates back to PDFs (maintaining same name - either overwrite or to a new folder) which has the effect of flattening the Bates into the resulting PDF. I have seen JS "window.print()" which should open the Print dialog . . . but it doesn't. The action would:
Option: Select document(s) or folder (no problem with this) Prints PDFs to PDFs (this is the problem) My default Printer is an HP so the question is whether I need to first set Print to PDF as the default and then run the Action or if within the Action there is JS that would trump my default with Print to PDF while the Action executes. Still searching, but most JS on Print to PDF seems to relate to web pages. Suggestions much appreciated.
|
|
![]() |
|
try67 ![]() Senior Member ![]() Joined: 15 Jul 2011 Points: 634 |
![]() ![]() ![]() ![]() |
Very bad idea, and not technically possible with JS in Acrobat.
You should instead flatten the file, using this command for example: this.flattenPages(); Then just re-save it. |
|
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com |
|
![]() |
|
Lawguy ![]() New Member ![]() Joined: 19 Jul 2012 Location: Denver Points: 5 |
![]() ![]() ![]() ![]() |
I have attempted both:
event.target.flattenPages(); and this.flattenPages(); Neither burns the Bates number into a single layer. After trying both JS the Bates is removable through Tools > Pages > Bates Numbering > Remove Conversely, Print Dialog > Printer: Adobe PDF does burn it thus making it unremovable. Suggestion? Thank you |
|
![]() |
|
Lawguy ![]() New Member ![]() Joined: 19 Jul 2012 Location: Denver Points: 5 |
![]() ![]() ![]() ![]() |
FOLLOW-UP TO QUESTION
I have the first part of my proposed Acrobat XI
Action working, i.e., selecting to Print to PDF is resolved with the following
code: pp = this.getPrintParams(); pp.interactive = pp.constants.interactionLevel.automatic; pp.printerName = "Adobe PDF"; this.print(pp); However it prompts to save. I want to have the save overwrite
the original file (Yes, I am working from a copy, not the original). How can I do a hard save, alternatively to
direct the save to a different folder and then, as the action cycles through
all documents, repeat? This presents a secondary issue inherent in the Print-to-PDF . . . it creates a copy of the document. I have tried to code the Action with a separate script, including some found by the last reply: myDoc.closeDoc(true); doc.closeDoc(true); this.closeDoc(true); [from a try67 post) None work and the “this.closeDoc(true);” crashes What I am trying to do is to: Select document(s) Print to PDF Save the new PDF Clear created new PDF Cycle through the rest of the docs Any help will help. |
|
![]() |
|
try67 ![]() Senior Member ![]() Joined: 15 Jul 2011 Points: 634 |
![]() ![]() ![]() ![]() |
I told you, it's a bad idea. You can't save the file automatically like that.
You'll have to click Save manually for each file that you process... You should instead looking into using a Preflight Profile to flatten the file, or something like that. |
|
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |