1

I would like to silently print different pages with embedded javascript in PDFs. I looked into adobe's JS guide. This is what i got:

pp = {
printerName: "BrotherA",
bUI: false,
bSilent: true,
nStart: 0,
nEnd: 2};

this.print(pp);

pp = {
printerName: "BrotherB",
bUI: false,
bSilent: true,
nStart: 3,
nEnd: 4};

this.print(pp);

Error message: "There was a problem reading this document (14)."

If i set the param bUI to true, or uncomment it, the code works. But then i got the UI, which i don't want to see.

Anyone some ideas? thx

1 Answer 1

1

This (strangely) appears to be possible - I don't want to copy the complete blog post this is explained in here - here is the link: http://blogs.adobe.com/acdc/2011/03/silent-print-in-acrobat-using-javascript.html

The essence seems to be that they request the printer parameters first and then only modify one field in it:

try
{
  // get the printer params
  var pp = this.getPrintParams();

  // don't show the print dialog window
  pp.interactive = pp.constants.interactionLevel.silent;
}
catch(err)
{
  app.alert("Error setting up printing parameters.\n\n" + err);
}

However, be aware that silently printing could considered to be a nuisance up to a security risk. See this security advisory from Adobe for example: http://www.adobe.com/support/security/bulletins/apsb08-13.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.