created: 2003-02-25
modified: 2007-03-23

Stefan.Huberdoc.at

(obsolete) Create PDF documents with free tools and Windows

Since PDFCreator was introduced, you can save yourself the hassle of installing Ghostscript and friends because PDFCreator bundles all these pieces of software and offers a neat installer package.

I'll describe a free way to create PDF documents from any application (that can print) in Windows with free tools. Basically, there are a few steps to perform:

  1. Install Ghostscript (Postscript for Windows)
  2. Install a Postscript Printer (any colour laser printer with PS capabilities will do) on the FILE: interface.
  3. Either…

The proceudre

Ghostscript

Go to www.ghostscript.com and download the latest version of Ghostscript (I am using AFPL Ghostscript myself).
You don't need GSView if you don't care for Postscript files. But I recommend downloading it as well. GSView can also view PDF files, if you are tired of Acrobat Reader.

Install Ghostscript. Normally, it will reside in %PROGRAMFILES%\ghostscript.

PostScript printer

Install a PostScript capable printer. I chose the Apple Color LW 12/660 PS driver. Have it use the FILE: interface, not LPT1: or something.
I also named it PS Fileprinter to avoid confusion when printing. But this is optional.

Your PS printer is now ready. If you print something with it, you will be prompted for a filename. I suggest using something like c:\temp\test.ps as filename. At least, that's what I always do: Print to a file in c:\temp.

Right now, it is quite hard to actually use your Postscript printer to create PDF documents. You still have a PostScript file lingering around on your harddisk. You've got to convert it, and a small batch script is best suited for this task:

Alternative 1: The batch script

Create a small batch script anywhere you like. I named it create_pdf.bat.

@echo off
if %1a == a GOTO err
set PATH=%PATH%;%ProgramFiles%\ghostscript\gs7.04\bin
set PATH=%PATH%;%ProgramFiles%\ghostscript\gs7.04\lib
echo Converting PostScript to PDF...
call ps2pdf "%1" "%1.pdf"
GOTO fin
:err
pause
:fin

Depending on your Ghostscript version and installation, you have to adjust the path, especially the gs7.04-part, which reflects the Ghostscript version. And you might not need the line that adds …\lib to the PATH variable.

Now create a shortcut to this batch file in your SendTo folder. On Win9x, you can usually find it in C:\WINDOWS\SENDTO. In NT and later, it is located in your profile directory. Rename the shortcut to Create PDF, for instance.

You might change the properties of this shortcut for it should automatically close when the script is finished.

Of course, you can add other lines to the batch script. You might for instance compress the original PostScript file and send this one instead of the PDF.

You can now easily create a PDF by just printing the desired document to the PostScript printer and then rightclick the resulting file, select Send To and choose Create PDF.


Alternative 2: Use RedMon

RedMon is a driver that can be installed to take the PostScript output and create PDF files on the fly. Refer to the documentation on their website for details about how to install RedMon. Or read an excellent step-by-step guide to install RedMon by Henrik Schmiediche. I'll just give you a quick overview:

  1. Install a new printer (I recommend an Apple Color LW 12/660 PS). Don't print anything, don't make it the default printer
  2. After installing, go to the printer's properties and add a new redirected port. It will be RPT1:. Configure this one.
  3. These are the settings I use:

    1. redirect this port to program: C:\Programme\gs\gs8.10\bin\gswin32c.exe
    2. Arguments for this program: @C:\Programme\gs\pdfprinter.txt -sOutputFile="C:\temp\%d.pdf" -
    3. Output: Program handles output
    4. Run: minimized

    Note the arguments: @C:\Programme\gs\pdfprinter.txt -sOutputFile="C:\temp\%u.pdf" -
    Be careful to include the dash at the end.

    Of course, you will have different paths. And the output file might not be in C:\temp\ for you. I didn't yet figure out how to automatically hand over a file name that can vary, like print-YYYYMMDD-HHNN.pdf.
    Update: I received a message from Roy the other day, where he pointed me to the redmon help file. It's there that he found the %d variable that I am currently using. Go and have a drink for Roy!

  4. Create the file referenced in the arguments for the programme (here: C:\Programme\gs\pdfprinter.txt). I have these lines in that file:
    -IC:\Programme\gs\gs8.10;C:\Programme\gs\gs8.10\fonts
    -sDEVICE=pdfwrite
    -r600x600
    -dNOPAUSE
    -dSAFER
    -sPAPERSIZE=a4
    -dPDFSETTINGS=/default

    The -dPDFSETTINGS options is vital: If you want to produce pretty PDFs, set this to /printer or /prepress. If you need them for screen reading only, use /default or /screen. The file sizes vary considerably, when pictures are used.

    Refer to The ps2pdf converter documentation for details.

I hope, this small guide contains some useful information for you.

Contact & ImprintKontakt & Impressum
Created: 2003-02-25 — last modified: 2007-03-23 — last update of web site: 2012-01-25
Follow me: RSS Follow StefanMHuber on Twitter