HTML Code to PDF Converter


Enter HTML code and choose output preferences

WYSIWYG: Show Show Hide
  • 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.