Thursday, February 19, 2009

Creating PDF for free from any program with printer support

This is a short manual how to replace any commercial and/or closed source PDF distilling product. What you need:
Why would you need that?
There were many reasons we decided to replace Adobe Distiller and Acrobat:
  • Programmatic control of these programs!
  • Incompatibility of different versions of Framemaker/Distiller/Acrobat!!!
  • Adobe bugs!!!
  • Price!
  • Page size limits*
  • Different page sizes in one document*
  • Page inserting/removing bugs
  • Language/Font problems*
How to print?
First, install the postscript driver (PPD). Change the PPD file for your needs, we changed limits for maximum paper size (maps). The printer should print into file. When printer is installed, you can print from any program with printing support, just choose this printer and the output will be saved as postscript (ps). Converting postscript to PDF is easy with Ghostscript:

gswin32c.exe -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf

We suggest to set embedding of fonts into postscript/pdf as ghostscript fonts can be buggy.
The same process can be done very easily even programmatically, just use google/msdn how to set printer to use.

No comments: