Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - XI Action - Print PDF to PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

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 Post Reply
Author
Lawguy View Drop Down
New Member
New Member


Joined: 19 Jul 2012
Location: Denver
Points: 5
Post Options Post Options   Quote Lawguy Quote  Post ReplyReply Direct Link To This Post Topic: XI Action - Print PDF to PDF
    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.
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 629
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 21 Apr 2015 at 10:34am
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
Back to Top
Lawguy View Drop Down
New Member
New Member


Joined: 19 Jul 2012
Location: Denver
Points: 5
Post Options Post Options   Quote Lawguy Quote  Post ReplyReply Direct Link To This Post Posted: 21 Apr 2015 at 3:57pm
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
Back to Top
Lawguy View Drop Down
New Member
New Member


Joined: 19 Jul 2012
Location: Denver
Points: 5
Post Options Post Options   Quote Lawguy Quote  Post ReplyReply Direct Link To This Post Posted: 24 Apr 2015 at 12:16am
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.

Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 629
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 24 Apr 2015 at 9:03am
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.047 seconds.