This is one approach to print files to PDF format without having to use a commercial program such as Adobe Acrobat and its associated API.
The technique uses Ghostscript and Redirection Port Monitor - two free programs for creating PDF documents provided free by Russell Lang.
SETTING UP THE PDF PRINTER: Here are detailed instructions for installing and configuring the virtual PDF printer - cribbed from: < http://masterdev.dyndns.dk/know/freepdf.html >
1. Install Ghostscript to C:\ <http://www.ghostscript.com/doc/AFPL/index.htm>
2. Create a text file (c:\gs\pdfconf.txt) and add the following text:
-Ic:\gs\gs8.11\lib;c:\gs\fonts -sDEVICE=pdfwrite -dNOPAUSE -dSAFER
Note that the first line points to version 8.11 of Ghostscript. If you have a different version or installed it to a different location, make the appropriate changes.
3. Download, unpack, and Install RedMon (Redirection PortMonitor) <http://www.cs.wisc.edu/~ghost/redmon/index.htm> * When you run setup.exe you will only see a message box.
4. Go to Printers/Faxes menu under the Start button in Windows and add a new printer. * The driver for the printer must be for a /color postscript/ printer. I chose HP Color Laserjet 4550 PS * Set the printer port to RPT1: (the redirected port)
5. Configure the port Redirect Port to: "C:\gs\gs8.11\bin\gswin32c.exe" (Update this line to reflect your version and location of Ghostscript, if different)
Arguments for this program are: @c:\gs\pdfconf.txt -sOutputFile="%1" -c .setpdfwrite -f -
Output: "Prompt for filename" Run: "Normal"
6. Try printing something in color to this printer. If everything works right, you will be prompted for a filename that the PDF file will be saved under (Don't forget to add the .PDF extension).
|