Skip to main content
Participant
November 2, 2020
Question

I need to open a PDF in browser and have it print automatically

  • November 2, 2020
  • 1 reply
  • 378 views

Hello, it looks like this is possible, as i've found numerous examples of how to do this, but it seems like Acrobat DC makes this prohibitively difficult compared to all the tutorials I've found. So far, i've tried to open the document, open the action wizard, create a new action to execute javascript, and added a javascript file with the following code:

 

function printOnOpen() {
  this.print({bUI: false, bSilent: true, bShrinkToFit: true});
}
printOnOpen();

 

But when I click "Start" acrobat fails on me. Any tips?

 

Thanks

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
November 2, 2020

Do you want the Action Wizard to print the files, or do you want it to embed the code to print them when opened?

If the latter, that's not how you do it. You need to use the addScript method.