Poor mans PDF

From RSWiki
Revision as of 12:25, 5 April 2016 by Robert (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

This is intended to be a quick tutorial to creating PDF documents on the cheap. Although there are many freeware PDF printers many are quite limited in functionality or add a really annoying watermark. If you are running Linux or one of the BSD's as your operating system then you have a myriad of options available, however it is a different story if you are running Windows. Hopefully this tutorial will have you up and running with creating PDF documents in no time and it only requires the downloading and installation of a single package.

Prerequesites

  • Download and install MikTeX
  • Install a Postscript capable printer driver

nstallation and configuration

First go to miktex.org and download the latest package available. The windows installer is a no brainer however it is worth examining the installation options carefully to ensure that you enable it to use windows truetype fonts.

Next we need to install a postscript printer driver. Luckily this is easy as a default installation of Windows XP includes many of them. Simply go to the Printer and Faxes control panel and use the add printer wizard. Personally I find that the driver for the HP laserjet 8100 Series PS suits my needs perfectly. When asked which port you wish to install the printer choose 'Print to File'

Creating your first document

Create or open a document, spreadsheet, webpage or whatever you wish to convert to PDF. Once the document is open, print the document to the newly installed printer and save it when prompted and give the new file an extension of .ps

Now browse to the location where you saved the postscript output and open the file using your favourite text editor.

Unfortunately the HP printer drivers add a few lines of non-standard code at the top of the output so we must remove these before converting to PDF. Luckily this is a simple process, just delete the first line in its entirety and then delete any line that begins with @PJL

With this done you are now ready to convert your document to PDF.

Open a command prompt and change directory to the location of the saved postscript file and issue the following command:

ps2pdf ''filename.ps''

This will now create a PDF document with the same filename as the postscript without any watermarks etc.

However it is also worth noting that this method lacks some of the advanced options of commercial applications such as protecting the document and encryption.