Skip to content
MyLovePDFdeSign in

Convert HTML to PDF

With MyLovePDF you convert HTML code to a PDF for free and without signing up. You paste the code or load an HTML file, choose page size and orientation, and get the PDF. The conversion runs in a browser without internet access on our server in Frankfurt am Main. That is why images, fonts and scripts from the internet are not loaded: everything that should appear in the PDF has to be inside the code itself. The code is deleted after 60 minutes at the latest.

File up to 2 MB. The content appears in the box and can be edited.

How to convert HTML to a PDF

  1. 1

    Paste HTML or load a file

    Paste the HTML code into the box or click “Load HTML file”. Up to 2 MB are allowed.

  2. 2

    Choose the format

    Choose A4 or Letter and portrait or landscape. Your own @page rules in the code take precedence.

  3. 3

    Convert to PDF

    Click “Convert to PDF”. The code is transferred to the server and printed to a PDF there.

  4. 4

    Download and check the PDF

    Download the PDF and check layout, umlauts and images.

What you can expect from the conversion

Modern rendering
The PDF is printed with a current browser. CSS such as flexbox, grid and @page rules is taken into account.
Safe through isolation
The browser has no internet, runs no scripts and may only open your document. Foreign addresses are never called.
Images inside the code
Images and fonts have to be data: addresses in the code. That makes the result independent of other servers.
Server in Frankfurt, quick deletion
Your code is processed in Germany and deleted after 60 minutes at the latest. No account is needed.

Typical uses

  • Invoices and offers: An HTML template from your system becomes a PDF to send.
  • Reports and résumés: Documents styled with CSS get a fixed page layout.
  • Documentation: Single pages or manuals as a PDF to pass on.

What the conversion can and cannot do

Topic Note
HTML and CSS Printed with a current browser, including flexbox, grid and @page
Images Only as data: addresses in the code
Fonts System fonts of the server, embedded fonts as data:
JavaScript Switched off
Internet addresses Are not called
Size Up to 2 MB of code
Retention The code is deleted from the server after 60 minutes at the latest

Tips

  1. Control page breaks: With page-break-before or break-after in your CSS you decide where a new page starts.
  2. Use print CSS: Rules in @media print apply during the conversion.
  3. Embed images: Convert images to data: addresses so that they appear in the PDF.
  4. Shrink or protect afterwards: With Compress PDF or Protect PDF you process the result further.

Frequently asked questions about HTML to PDF

How do I convert HTML to a PDF?

Paste the HTML code or load a file, choose the format and click “Convert to PDF”. Then download the PDF.

Can I convert a web page by its address?

No. For security reasons we only accept HTML code, not addresses. Save the page in your browser as an HTML file or copy the code, and load it here.

Why are my images and fonts missing?

The conversion has no access to the internet. Images and fonts from other sources are not loaded. Embed images as data: addresses directly in the code.

Are scripts executed?

No. JavaScript is switched off. Content that is only created by scripts does not appear in the PDF.

Which page sizes are available?

A4 and Letter, each in portrait or landscape. With an @page rule in your CSS you can set the format yourself.

How large can the code be?

Up to 2 MB. That is enough for text, tables and embedded images of usual size.

Is my code uploaded?

Yes. The conversion does not run in the browser, so we transfer the code to our server in Frankfurt am Main. It is deleted after 60 minutes at the latest.

Is HTML to PDF free?

Yes. The conversion is free, with no sign-up and no watermark.

Also searched as

  • HTML to PDF
  • convert HTML code to PDF
  • HTML file to PDF
  • web page to PDF
  • HTML PDF converter
  • HTML invoice to PDF

Updated on