Contact information

If you have any questions, comments or suggestions, please don't hesitate to contact me at: alex@kr1st.com

For QSL information, please check my information on QRZ.com.

 

Creating PDF Files from Windows Applications

PDF

Several years ago I needed a way to create PDF files from within Windows applications. There were a few applications available, but I was not willing to pay the price they asked for those applications. Buying the Adobe product was prohibitively expensive, too. Third party developers had to pay a license fee to use Adobe's PDF technology which kept free products off the market for quite a while. Times have changed and now you can download free products. I would certainly try those before trying the method I will describe below.

I wrote this little HowTo document because many people asked me how I was able to create PDF files without having to pay for additional software. This material is dated. However, the method still works and I have adapted the HowTo for MS Windows XP. If you're not satisfied with the products you find on the market today, you can still try this to see if this method will work for you.

One final note. I do not maintain this page. That means that version numbers mentioned in the HowTo may not be current anymore as newer versions may have become available. The method probably still works, but substitute newer version numbers where apprpriate.

PDF File Creation HowTo

This method works by installing a printer driver on your Microsoft Windows computer to which you can print from within any application that runs on MS Windows. When you print to this printer, a dialog box will pop up asking you to which file you would like to print. Once a file name is provided, a PDF file with that name will be created in the directory you specify. On some Windows installations this popup dialog box will be underneath the application window. In case you don't see this box pop up, simply minimize the application window to access this dialog box.

We will be installing a Postscript printer on your computer and then we will install port redirection software that will redirect everything you send to this printer to the Ghostscript software. The Ghostscript software will then translate the postscript files that are being sent to the postscript printer driver into PDF and creates the PDF file. This install script is written for MS Windows XP Pro, but can easily be adapted for other Windows versions.

Step 1. Install the Required Software

Download the following three sofware packages:

gs861w32.exe (Ghostscript)
gsv49w32.exe (GSView)
redmon17.zip (Redirector)

Run the executables for Ghostscript and GSView. Accept the default values for installation. You will now have 2 new directories on your system, C:\Program Files\gs and C:\Program Files\Ghostgum, containing the software. Next, unzip the redmon17.zip file and run the setup.exe executable. It will only ask you if you want to install it and nothing else. You can delete all the installation files if you want to.

A final piece of the puzzle is a small configuration file I made. Right click on the the file name and select "Save Target As..." and save it into the c:\program files\gs directory created by the installation of Ghostscript earlier:

Configuration file: pdfwrite.rsp

Step 2. Add a Postscript Printer Driver

Now we will install a postscript printer driver. We can choose any printer, but if you want to create PDF files containing color, then you will have to install a color printer driver. I choose to install the HP C Laserjet 4500-PS printer driver because it seems to be available on almost all Windows installations and is capable of doing anything you may want to do in a document.

- go to Start -> Settings -> Printers and Faxes
- double click on "Add New Printer"
- click on the "Next" button
- select "Local printer attached to this computer"
- click on the "Next" button
- select "Create a new port"
- select "Redirected port" from the pick list
- click on the "Next" button
- another popup dialog box will pop up, make sure "RPT1:" is given for
  the Port Name and click on the "OK" button
- in the next dialog box select "HP" from the list of manufacturers and
  select the "HP C Laserjet 4500-PS" from the list of printers
- click on the "Next" button
- change the Printer name to something more identifyable like "CreatePDF"
- select "No" for the question of the default printer
- click on the "Next" button
- select "Do not share this printer"
- click on the "Next" button
- select "No" for the question about printing the test page
- click on the "Next" button
- if everything looks ok in the "Complete Add Printer Wizard" dialog
  box, then click on the "Finish" button

You have now installed a printer called "CreatePDF", or whichever name you choose to give it, on your computer and are ready for the final step that will glue everything together.

Step 3. Configure the Port Redirector

We are now ready to tell Windows that instead of printing to an actual printer, it needs to send the output to the Ghostscript and GSView application that will create the PDF file.

- go to Start -> Settings -> Printers and Faxes
- select the printer driver you just installed from the list
- right click on it and select "Properties"
- click on the "Ports" tab
- select the "RPT1:" port and click on the "Configure Port" button
- type or copy and paste the following line into the
"Redirect this port to the program" field:

C:\Program Files\gs\gs8.51\bin\gswin32c.exe

- type or copy and paste the following line into the
"Arguments for this program are:" field:

"@c:\Program Files\gs\pdfwrite.rsp" -sOutputFile="%1" -c .setpdfwrite -f -

(include quotation marks and the dash at the end of the line)

- select "Prompt for filename" from the "Output:" pick list
- select "Hidden" from the "Run:" pick list
- set the "Shut down delay:" to 300 seconds
- DO NOT check "Run as User"
- DO NOT check "Print Errors"
- click on the "OK" button
- click on the "Close" button
- close the "Printers and Faxes" window

Conclusion

You are now ready to create PDF files from within any application that will run on Microsoft Windows. Simply print to the printer created above from within the application and a popup dialog box will appear asking you for a file name and where to put the file. I've created many PDF files with this software and have never run into any problems or limitations.

Even though I don't maintain this page to keep it up to date with the latest version numbers, please do not hesitate to drop me an email if you have any questions or suggestions.

73,

--Alex, KR1ST