Previous | Next | (P-PDF) Acrobat 6.0
Topic: Internet/Intranet PDF Batch Printing, 1 Attachments
Conf: (P-PDF) Acrobat 6.0, Msg: 110829
From: chicks
Date: 5/4/2004 04:00 AM
Attached file is installer and "c" source code for a very simple method to batch print PDF files over the internet or intranet. Dozens of files can be batch printed using Adobe Reader.
Requires Reader 6.x installed (Win2K, XP only) on the client side.
Clients simply download and run "setup.exe" from your server, which will install pdphelper, and associate the ".pdp" extension and mime type with pdphelper.
On the server side, simply create a ".pdp" file or stream, and set "Content Type" to "application/x-pdfprint". If serving from stream, make sure to create a dummy file name with ".pdp" extension.
The .pdp file requires two keys per line (see test.pdp):
url=
printer=
PdpHelper will parse each line of the .pdp, download the PDF from the url, and launch Adobe Reader with the "print" or "printto" verbs. If the value after the "printer=" key is empty, it will print to the default printer.
A simple servlet doGet usage example:
[CODE]
public void doGet ( ... ) {
ByteArrayOutputStream myPdp;
// Build the .pdp stream here from user-selected files
...
// Let the browser know the content type
response.setContentType("application/x-pdfprint");
// Set a dummy file name
String pdpFileName = "pdpTest.pdp";
response.setHeader("Content-Disposition", "filename=\"" + pdpFileName + "\";
// Let the browser know the file's length
response.setContentLength(myPdp.size());
ServletOutputStream out = response.getOutputStream();
myPdp.writeTo(out);
out.flush();
}
[/CODE]
PdpHelper(3).zip
(293,556 bytes)