Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Convert a PDF to Postscript on the fly

> What we do have working is using Ghostscript in a round about way.
> using gs in BATCH mode. convert the PS to PDF and the open stream and
> delete.

You don't need an intermediate file, have a look at the "gs" options.

> The problem is that GS is pixelating the FONT's in the PDF created.
> It prints okay, just looks horrible.

Make sure you are running the latest version of AFPL GhostScript.  You may
need to send someone money to do this.  Only use Type 1 or TrueType fonts,
make sure GhostScript can find them.  Embed those fonts in the output PDF.

For example:

gs -q -dNOPAUSE -d BATCH -dSAFER \
   -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 \
   -dEmbedAllFonts=true -sPAPERSIZE=a4 -sDEVICE=pdfwrite \
   -sOutputFile=- -c .setpdfwrite - \
   < inputfile.ps > outputfile.pdf

Make sure that GhostScript can find all the fonts you use.  You may need
to say -sNOPLATFONTS and -I/usr/local/fonts. Put a Fontmap in the
/usr/local/fonts directory using ttfontmap.

Double byte fonts still end up as bitmaps.  The "-r" parameter can
change the resolution of these.

Glen Turner                                 Network Engineer
 (08) 8303 3936      Australian Academic and Research Network
 glen.turner@xxxxxxxxxxxxx          http://www.aarnet.edu.au/
 The revolution will not be televised, it will be digitised