Independent Articles and Advice
Login | Register
Finance | Life | Recreation | Technology | Travel | Shopping | Odds & Ends
Top Writers | Write For Us


PRINT |  FULL TEXT PAGES:  1 2 3 4 5
Creating PDFs in Linux 
 
by Scott Nesbitt July 11, 2005

You don't have to be a geek or a techie to create PDFs in Linux. Creating PDFs in Linux is now as easy as doing it in Windows or on a Mac.

The Portable Document Format (PDF) is a popular way to distribute and exchange documents. And with good reason: PDF files retain all the formatting -- fonts, layout, graphics, and more -- of the original document. In Windows and on the MacOS, Adobe Acrobat is the most popular software for creating PDFs, but there's no version of Acrobat for Linux.

But that doesn't mean you can't create PDFs in Linux. Geeky and techie users of Linux know literally dozens of ways to create PDFs. But what about the rest of us? There are some excellent Linux alternatives to Acrobat available, and they're easy to use and master.

About PDFs

So, what are PDFs? They're snapshots of documents that you create in a word processor, desktop publishing application, or similar software. PDFs retain all the formatting, fonts, layout, graphics, and more,of the original document. You can create PDFs directly, or by first creating a Postscript file and then converting that file to PDF. Postscript is a programming language that describes how a printer or typesetter should interpret the look of a printed page,the positioning of text and graphics, the fonts used, and so on. You can create Postscript files with any number of specialized applications, or by just printing to a file from within your favorite word processor.

ps2pdf

ps2pdf is a script that comes bundled with the popular Ghostscript software that's used to interpret and manipulate Postscript files. ps2pdf is a command-line tool that runs a Postscript file through Ghostscript and produces a PDF.

Ghostscript comes with most distributions of Linux. To find out whether or not you have Ghostscript and ps2pdf installed, type either ps2pdf or ps2pdfwr at the command line. To use ps2pdf, type the command ps2pdf, followed by the name of the Postscript file that you want to convert, like this:

ps2pdf myFile.ps

The PDFs that are produced by ps2pdf vary in quality from production-level to fuzzy. The quality of the output really depends on the source Postscript file and the fonts you use. You can improve the quality of the resulting PDFs by using one of the many ps2pdf options. You can use the options to embed fonts, compress your PDFs to make them smaller, or specify the resolution that determines the clarity of the PDF by setting the number of dots per inch at which the file is displayed.

There are about 75 options, so explaining them all in this article is impossible. For more information on these options, check the documentation for Ghostscript.

GSView

While ps2pdf an excellent tool for working with Postscript files, it's a command-line application. To use it, you need to type long strings at the command line. You can get around this by using GSView.

GSView is an excellent graphical user interface for viewing, manipulating, and printing both Postscript and PDF files. You can also use it to create PDF files. In a lot of ways, GSView is a graphical interface to ps2pdf.

Converting a Postscript file to PDF with GSView is simple. First, open the Postscript file that you want to convert in GSView. Next, select Convert from the File menu. On the Convert dialog box, select Pdfwrite from the Devices list. Then, click OK.

And what about those ps2pdf options that I mentioned earlier? Just click the Properties button on the Convert dialog box. The Properties dialog box lists all of the available options. Play around with them to discover those that suit your needs.

PStill

PStill is a powerful command-line tool that does an excellent job converting a Postscript file to PDF. PStill is a program along the same lines as Adobe Acrobat. While PStill doesn't do everything that Acrobat does, it gets the job done quite nicely, doesn't eat up that much in the way of system resources, and is a lot cheaper than Acrobat. If you're going to use PStill for personal or educational projects, the program is free. If you want to use PStill for commercial purposes, you have to pay a registration fee of $43 (U.S.).

Like ps2pdf, PStill has a number of command-line options, which are detailed in the program's documentation. However, you will find that you need to use only a few of these options.

To use PStill, type a command like the following:

pstill -o newFile.pdf myFile.ps

If you're wondering about what the -o does, it tells PStill that the filename that comes after it is the name of the PDF that you want to create.

While PStill is a powerful program, some non-techies might shy away from it because it's a command-line program. Also, configuring PStill can be a bit tricky.

KDE

KDE is arguably the most popular window manager for Linux. One of the features of KDE is a built-in PDF writer. To use it, select Print from the File menu. On the Print dialog box, select Print to File (PDF/Acrobat) from the list of printers. You can choose where you want to print the PDF in the Output File field. From there, click Print and you have a PDF. You can also select Mail PDF File from the list of printers. This will not only create a PDF from your document, but also open a new message in KMail (the KDE mail client) with your PDF as an attachment.

On top of that, you can change the resolution and the color settings for the PDF by clicking Properties on the Print dialog box. From there, click the Device Settings tab and change the settings as necessary.

The main drawback of KDE's PDF writer is that it works only with applications that were specifically developed for use with KDE, for example, the KOffice suite.

OpenOffice.org

OpenOffice.org is a free office suite, sort of like Microsoft Office, that runs on Linux and Windows. One my favorite features of OpenOffice.org its built-in PDF writer. To create a PDF, all you have to do is open a document and select Export to PDF from the File menu. You'll be asked to give the PDF file a name, and you can even tell OpenOffice.org where to save the PDF. Then, you just click the Export button and you get an instant PDF of your document.

The PDFs that it exports are plain vanilla: no bookmarks, no links, and minimal compression. Thanks to an OpenOffice.org macro called extendedPDF, you gain more control over the PDF files that you create. Not only do your PDFs contain links and bookmarks, but you can also specify colors for the links; the quality of the PDFs that you're creating, for on-screen viewing, printing, for use as e-books, or for pre-press work; and even the version of the PDF specification with which the resulting file is compatible. This setting ensures that your PDFs can be viewed in newer and/or older versions of a PDF reader.

There are two versions of extendedPDF: Basic and Universal. The Basic version has all the features that are listed in the preceding paragraph. The Universal version, which costs around $40 (U.S.), enables you to add security to your PDFs. Using the Universal version you can, for example, prevent people from copying text from your PDFs or printing them.

TextMaker

TextMaker is a relatively new word processor that runs on Linux, Windows, as well as on several flavours of handheld PC. I won't debate the merits of TextMaker here -- suffice it to say that I'm an enthusiastic user of this application and think that it is the best standalone word processor available for Linux. It's well worth its $49.95 (U.S.) price tag.

One aspect of TextMaker that I really like is its integrated print to PDF function. To use this function, you must have GhostScript installed on your system.

To print PDFs from TextMaker, you first have to set up the printer to use. Do this by selecting Print from the File menu to open the Print dialog box. On the Print dialog box, click Setup to open the Printer Setup dialog box, as shown below.

On the Printer Setup dialog box, select GhostView[System] from the Options list. Then, select PDF (via ps2pdf) from the Output list. If you want to set a resolution for the PDFs, select a value from the Resolution drop-down list. Remember that the higher the resolution, the larger your PDF file will be.

Click Close on the Printer Setup dialog box, and then click Yes when you are asked if you want to save the changes. Now, you are ready to print document to PDF.

Open a document, or create a new one. When you are ready to create the PDF, click the Print icon to open the Print dialog box. Click the Print to File option, and then click OK. TextMaker asks where you want to save the PDF.

Type a path and filename in the dialog box (for example, /home/scott/Conversions/doc1.pdf) and then click OK. After a few seconds, you get a PDF.

The PDF you get is similar to the PDFs generated by OpenOffice.org. The PDF has no navigation or external links, and is larger than one that you can produce using ps2pdf and its various options. Still, using the print to PDF function in TextMaker can produce usable proofs, documents to e-mail to friends or colleagues, or even for archival purposes.

Conclusion

Linux isn't just for geeks anymore. And neither is the Linux software for creating PDFs. There are a number of ways to create PDFs in Linux. They're quick and (fairly) easy to use, and the PDFs that come out are often comparable to those produced by Adobe Acrobat. Best of all, most of the tools are free -- a price you definitely can't beat!


 

External Links:


 




Home  |  Write For Us  |  FAQ  |  Copyright Policy  |  Disclaimer  |  Link to Us  |  About  |  Contact

© 2005 GoogoBits.com. All Rights Reserved.