2

A customer of mine has PDF forms created by Acrobat Pro. Each has a "Print" button on the form. Behind the "Print" button is this JavaScript, which is still the recommended printing approach according to Adobe:

var pp = this.getPrintParams();

pp.printerName = "\\\\server2\\EN100Tiffs";
pp.interactive = pp.constants.interactionLevel.automatic;

this.print(pp);
app.alert("Document sent to printer", 3);

app.alert("Please close window after each use", 3);

The printer specified above is actually a utility that converts whatever's sent to it to a TIFF (Alto Imaging's UltraTIFF driver). The server it's on is Windows 2008. Another process continually scans for TIFF files and sends them to the customer's document imaging system.

This worked until Adobe Reader 10. At that point, the utility stopped generating the TIFF. The customer solved this by staying on Adobe Reader 9, but now they're being forced to upgrade to Reader 11. It doesn't work under Reader 11 either.

Note that the printer is not set up at the client machines. The client machines are all Windows 7.

Also note that users access the PDF directly. It's not inside of a browser window.

If I set up the TIFF driver as a printer on the client machine (through Start / Devices and Printers / Add a Printer), the script works under Adobe Reader 10 and 11. If the printer is not set up, the script works for Reader 9 and earlier, but it doesn't work for 10 or 11. The customer won't set up the printer on the clients because they fear the users could print to it by accident, and everything they print will end up in the document imaging system.

In an attempt to figure out what was wrong, I added error trapping to the print button script:

var pp = this.getPrintParams();

pp.printerName = "\\\\server2\\EN100Tiffs";
pp.interactive = pp.constants.interactionLevel.automatic;

try {
  this.print(pp);
  app.alert("Document sent to printer", 3);
} catch (err) {
  app.alert("Error printing: " + err);
}

app.alert("Please close window after each use", 3);

When I tried to print the document, no error was thrown. I got the "Document sent to printer" message rather than the error message, but the document still wasn't sent to the printer - by that, I mean that no TIFF file was created.

So my questions are:

  1. Has anyone out there experienced similar quirks with printing from Javascript when going from Reader 9 to Reader 10?

  2. Is anything in the code snippets causing the error?

Thanks all for taking a look, especially if you made it this far :)

Kara
  • 6,115
  • 16
  • 50
  • 57
Ed Gibbs
  • 25,924
  • 4
  • 46
  • 69

0 Answers0