For better or for worse, Adobe’s Portable Document Format (PDF) is a wildly popular way of exchanging information. On Windows and Mac OS, most people create PDF files by first creating a PostScript file and then using Adobe Acrobat Distiller to generate a PDF. Linux, however, has no version of Distiller. There are a number of ways to create a PDF in Linux, but one of the most popular methods is to use a utility called ps2pdf.
Running ps2pdfLet’s assume that you’ve created a PostScript file and now need to convert it to PDF. If you are in a graphical environment like KDE or GNOME, open a terminal window and change to the directory containing the PostScript file that you want to convert. Then, type ps2pdf followed by the name of your PostScript file. For example: ps2pdf gundam.ps HeavyArms.pdf You don’t need to include the name of the PDF record at the command line. If you leave it out ps2pdf gives the PDF record the call of the PostScript file and a .pdf file type. If all goes well, you’ll have yourself a PDF file that you can view in Acrobat Reader, xpdf, or any other PDF viewer. The PDF may have no navigation features or links, and it may also be quite large, but it can be used for creating proofs, for archiving, or for passing documents to family, friends, and colleagues. If you are using Knopper you may find that ps2pdf doesn’t work. I’ve been told that model 3.2 of the Knopper distribution doesn’t come with the ps2pdf script. Instead, it uses a script called ps2pdfwr, which uses the same syntax as ps2pdf.
Using ps2pdf’s parametersOne way to enhance your PDF files is to use ps2pdf with one of more of the 75 Acrobat Distiller parameters. The Distiller parameters are simply command-line options that enable you to change how your PDFs are produced, and they’re documented in the file ps2pdf.htm in the doc folder where Ghost Script is installed. ps2pdf can use all of the parameters available to Acrobat Distiller, however I have found 4 in particular to be the most useful, as we’ll see in a moment. Using the Distiller parameters with ps2pdf is simple. On the command line, type ps2pdf followed by -d, followed by the parameter call, followed by the name of the PostScript file: ps2pdf -dParameterName myFile.ps
Setting PDF compatibilityAs with many file formats, PDF gains new features with each new version of Acrobat. For example, PDFs created with Adobe Acrobat versions 4.0 and onward support enhanced security, transparency, compression, and annotations. However, you never know what version of a PDF reader someone will be using, or whether or not it will guide the full feature set. To ensure that your PDFs can be viewed in both newer and older versions of PDF readers, you can set a compatibility level for the PDF by using the Compatibility Level=x.x parameter, where x.x is the version of the PDF specification. Note that the specification number does not correspond to the version of the Acrobat software. Rather, there are 3 values you can use with this parameter: 1.2 — equivalent to a PDF created with Acrobat version 3.0. This is the ps2pdf’s default. 1.3 — equivalent to a PDF created with Acrobat version 4.0. 1.4 — equivalent to a PDF created with Acrobat version 5.0.
For example: ps2pdf -dCompatibilityLevel=1.3 ps2pdf.ps If you are unsure of what compatibility degree to apply, stay with the default. If you have version 7.0 or higher of Ghost Script installed for your pc, you can use the ps2pdf13 or ps2pdf14 scripts to automatically set the compatibility level.
Optimizing your PDFsNo matter what size your PDF file is, you probable need to create it so that the record opens and displays as quickly as possible, especially if you plan to host the file on a network or on the Web. Optimizing a PDF tweaks the structure of the file so that a server sends a page only as it is requested, rather than loading the entire PDF file. To optimize your PDFs, use the Optimize=true parameter. For example: ps2pdf -dOptimize=true report.ps
Embedding fontsIn some PDF files the fonts seem fuzzy. I have found that is particularly true of PostScript files created with the Text and Late typesetting systems, which via way of means of default use a unique set of fonts. If you find that the fonts in your PDF file are fuzzy, you can embed the fonts used in the source document with the PDF. Embedding fonts guarantees that:
Embed fonts by adding the EmbedAllFonts=true parameter to the command line:
ps2pdf -dEmbedAllFonts=true WonderDog.ps
The main drawback to using EmbedAllFonts is that your PDF will become noticeably larger.
Compressing the PDFYou can decrease massive PDF documents by as much as half in their authentic length the usage of the UseFlateCompression=true parameter. Flate compression, also referred to as Zip compression, does a terrific activity shrinking textual content and graphics without distorting the content. To use flate compression with ps2pdf, kind the subsequent on the command line: ps2pdf -dUseFlateCompression=true greatNovel.ps
Specifying the target deviceOne of the super matters approximately PDF documents is they may be used for a number of purposes. They may be considered on screen, downloaded as digital books, or printed on a laser, ink jet, or professional printer. You can specify five types of target tool for your PDF the usage of the PDFSETTINGS parameter: /screen — creates a low-decision PDF optimized for analyzing on a display. /ebook — the PDF has a slightly better decision, for higher analyzing of digital books on a monitor or on a smaller tool like a PDA or an electronic book reader. /printer — the PDF is generated for printing on a laser or ink jet printer, or to be distributed on a disk or CD-ROM. /prepress — the PDF is generated for a high-quality printing press. /default — the PDF may be used for all the output listed above. However, the record might be large than it might in case you used a single kind.
To use this parameter with ps2pdf, type the following on the command line: ps2pdf -dPDFSETTINGS=/printer galleyProof.ps