How to Convert HTML to PDF

Before we look at specific ways to convert HTML to PDF, lets consider the task in more detail. HTML is the programming language that is used to create websites. Obviously, HTML is more versatile — it supports Flash, animated images, embedded video, background music (this is thankfully rare) and other dynamic page elements. These and some other features of HTML pages can’t be converted to HTML, so when choosing a html-to-pdf converter it’s important to take into account what HTML features it can handle.

Another factor is how you want to use the converter:

  • Do you simply need to convert a single page?
  • Or do you want to make an application that lets other people convert certain HTML documents to PDF?
  • Would you prefer something you can download and install, or an online service?
  • How much are you willing to pay for the HTML converter?

The third and final issue is whether the page that needs to be transformed to PDF was created specifically for that purpose, or is it just some arbitrary webpage. This is important because if you want the resulting PDF to be easy to use, with fulltext search and clickable links, the source HTML should be built appropriately. Some HTML pages uses images to represent text, which means that text won’t be searchable. Also, menus and navigation links that rely on JavaScript won’t be clickable in PDF format. As a rule of thumb, if a webpage has good accessibility, it will work well when converted to PDF. On the other hand, pages that rely or browser-specific feature or flash-based sites usually aren’t suitable for PDF conversion.

Finally, lets look at specific HTML to PDF converters. For the average user, PDFonFly is likely the best choice. It’s a free online service that takes a webpage URL and creates a matching PDF file for you to download. The only annoyance is having to enter a captcha, but that’s a small price to pay for a quick and painless HTML to PDF service. The conversion quality is very good – the colors and fonts look nearly as good as in a web browser, with a few minor layout glitches for some webpages. If you want to convert a lot of HTML documents to .pdf, take a look at html2pdf (a commercial online service, average quality) or XHTML2PDF (an open source Python library).

Want to learn more about PDF converters? Check out my article about a free pdf to Word converter to find out how to convert PDF to Word online. This article was created by Janis Elsts, a techy blogger and hobbyist tutorial writer.

How to Print to PDF From Any Application

PDF (Portable Document Format) is one of the most popular and widely accepted file formats. It’s used mainly for distributing various documents – when you send someone a PDF file you can be certain they’ll be able to view it, as multiple PDF viewers are available for every platform and OS. But first, you need to create the .pdf. There are several ways you could go about that – using a converter tool, a PDF-specific document editor, or printing a document to the PDF format. The latter approach, i.e. printing to PDF, is arguably the easiest one, so that’s the one I’ll explain in this article.

To print something to a PDF file, you will need to install a virtual “PDF printer”. There’s a number of freeware applications available – PrimoPDF, CutePDF, Pdf995 and so on. At their core, most of these are very similar – each installs a virtual printer driver that intercepts the specially formatted, printing-ready data that word processors and other applications send to the printer. The virtual printer then converts the data to the PDF format using a third party library (called Ghostscript) and saves the result in the location you specify.

So if all those print-to-pdf tools are so similar, which one should you pick? I recommend doPDF – a lightweight application that doesn’t require any additional software. Unlike most other PDF converters, with doPDF you only need to download & install one program and you’re set.

To create a PDF file from any document, first download and install doPDF. It’s very simple – there’s practically no configuration to worry about. Then open the source file in any editor that supports printing. Lets take Microsoft Word for this example (the procedure is nearly the same in any application). In Word, select “File — Print…” to open the “Print” dialog and choose “doPDF v6” from the printer name dropdown. doPDF will ask you where you want to save the .pdf file. Choose a location and let the virtual printer do it’s job. After the PDF has been created it will be automatically opened in your default PDF viewer.

Using a virtual PDF printer is the easiest way to convert files to PDF as it works with almost any file format. Now you’ve learned how to print to PDF from Word or any other application, and it probably took you less than 10 minutes – congratulations.

This article about printing to PDF was written by Janis Elsts, a techy blogger and web programmer. As a bonus tip, check out my tutorial about free PDF to Word converters – see how you turn a read-only PDF file back into an editable document.