HTML Code to PDF Converter

Converter

Enter HTML code

WYSIWYG: Show Show Hide
Output Settings:

  • Margin Top
  • Margin Bottom
  • Should we load images?
  • Margin Left
  • Margin Right
  • Should we allow javascript to run?

Page breaks

If would like to generate a PDF with multiple pages, it's quite easy. You do this by simply adding "<!-- pagebreak -->" where you'd like a new PDF page to begin. If using the WYSIWYG, page breaks are added by clicking the icon or by clicking on "Insert > Page break" in the editor toolbar. Here is an example:

This is my text for page 1
<!-- pagebreak -->
This is my text for page 2
<!-- pagebreak -->
This is my text for page 3

Using the WYSIWYG, I would do this:
Type my text for page 1
click the icon
Type my text for page 2
click the icon
Type my text for page 3

Both examples would result in a PDF with three pages be generated.

Why are empty pages showing up in my PDF?

This is likely because you added "<!-- pagebreak -->" to your HTML code more than once or because it was added at the beginning or at the end of your code. To fix this, make sure that text and/or images have been added before and after the "<!-- pagebreak -->" comment tag.

Turning HTML code into a PDF file

To generate a professional looking PDF only takes a few minutes and if you have your HTML code ready, it can take less than that. To begin, you will want to make sure that all URLs within your code are formatted using absolute paths. This will help avoid broken images & links, distorted formatting etc.

It is also recommended that you use UTF-8 charsets. If you are using the WYSIWYG on this page, you do not have to worry about this, but if you are pasting your own HTML code, ensure that it is using the UTF-8 encoding or that your code has <html>, <head> and <body> tags in it, and that you have added the meta charset tag in the head section.

FAQs

For more information, see: HTML Code to PDF help

PDF Conversion Tools

In addition to converting HTML code to a PDF, you can also convert HTML files, webpages, Word documents, Powerpoint presentations as well as Excel documents. Below you will find tools available on this site:

URL to PDF converter can be used to convert webpages to PDF.

HTML file to PDF converter can be used to convert HTML files which end in the extension .html, .htm, .xhtml or xht.

XML file to PDF converter can be used to convert XML files which end in the extension .xml.

Word document to PDF converter can convert Word documents which end in the extensions .doc, .docx or .odt.

Powerpoint file to PDF converter can be used to convert presentations to PDFs which end in the extensions .ppt or .pptx.

Excel document to PDF converter can convert spreadsheets which end in the extensions .xls or .xlsx.

Rich text file to PDF converter can be used to convert files which end in the extension .rtf.

Text file to PDF converter can be used to convert plain text files which end in the extension .txt.

CSV file to PDF converter can be used to convert comma-separated text files which end in the extension .csv.

Free PDF Invoice Generator Need to create a PDF invoice? this tool can do it for free and it's online based like our other tools.