Showing posts with label Distiller. Show all posts
Showing posts with label Distiller. Show all posts

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.

Monday, February 9, 2009

Ghostscript Font alignment problems

We use Ghostscript for creating PDF documents, it is a much cheaper solution than buying special printer drivers, Adobe Distiller or any other. We changed Distiller for Ghostscript because of many reasons, but first of all bugs and control problems from other soft. But this is a different story.

Ghostscript uses free URW fonts for PDF creating and as we found out, theese fonts are buggy! As there won't be soon any update, we had to find another solution. We convert postscript (ps) files to PDF, so the solution was to embed the used font in the postscript instead of using the built in fonts.

In windows: printer preferences -> TrueType font: Download as SoftFont

From C/C++ set PRINTER_INFO_2 pDevMode->dmTTOption = DMTT_DOWNLOAD;

Good luck