Via java code i add this javascript to my document
"pp.interactive = " +getInteractiveType() + ";" + | // | |
// Always print to a printer (not to a file) | // | |
"pp.printerName = \"" + StringEscapeUtils.escapeJavaScript(printerName) + "\";" + | // | |
// Never print to a file. | // | |
"pp.fileName = \"\";" + | // | |
// Print images using 600 DPI. This option MUST be set or some barcodes cannot // | ||
// be scanned anymore. | // | |
"pp.bitmapDPI = 600;" + | // | |
// Do not perform any page scaling | // | |
"pp.pageHandling = pp.constants.handling.none;" + | // | |
// Always print all pages | // | |
"pp.pageSubset = pp.constants.subsets.all;" + | // | |
// Do not autocenter | // | |
"pp.flags |= pp.constants.flagValues.suppressCenter;" + | // | |
// Do not autorotate | // | |
"pp.flags |= pp.constants.flagValues.suppressRotate;" + | // | |
// Disable setPageSize i.e. do not choose paper tray by PDF page size | // | |
"pp.flags &= ~pp.constants.flagValues.setPageSize;" + | // | |
// Emit the document contents. Document comments are not printed | // | |
"pp.printContent = pp.constants.printContents.doc;" + | // | |
// printing duplex mode to simplex, duplex long edge, or duplex short edge feed // | ||
"pp.DuplexType = "+ getDuplexType() + ";" + | ||
// Print pages in the normal order. | // | |
"pp.reversePages = false;" + | // | |
// Do the actual printing | // | |
"this.print(pp);"; |
I have "pp.interactive set to pp.constants.interactionLevel.silent". But I still get a message from acrobat reader This document is trying to print. Do you want to allow this? i work on windows 7. Clients that work on windows XP doesn't have this message.
I also read something about bUI param. Do we need to set that? But i do not know how to combine params and the bUI param is the this.print call.