HTML to PDF Converter

HTML to PDF Converter

3/5 (2 ratings) 60 active installs Updated Jun 16, 2026
Plugin settings page: API key with "Test connection", conversion options, and the automatic button settings.

Plugin settings page: API key with "Test connection", conversion options, and the automatic button settings.

The “HTML to PDF Converter” plugin, created by html2pdf.app, lets your visitors save any WordPress page or post as a PDF. Install the plugin, add your API key, and either drop a shortcode where you want the download link — or switch on the automatic button to add a “Save as PDF” link to every post and page with no shortcode at all.

Conversions are handled by the html2pdf.app cloud API, the same engine used by the standalone service, so PDFs render with full CSS, web fonts, and images.

Features

  • One shortcode — add a download button anywhere with [html2pdf text="Save as PDF"].
  • Automatic button — show a “Save as PDF” button on chosen post types automatically, with no shortcode. Choose the position (before, after, or both) and the button text.
  • Print-ready output — set the CSS media type to screen or print (globally or per shortcode) to use your theme’s @media print styles and hide unwanted sections.
  • Full conversion control — page format (A4, Letter, Legal, and more), portrait/landscape orientation, custom margins, and custom width/height.
  • Test your connection — validate your API key from the settings page in one click before you go live.
  • Styled, theme-friendly button — ships with a clean default style that your theme can override, and is hidden automatically in the PDF when converting with print media.

Why a PDF plugin?

PDF downloads are useful for invoices, receipts, documentation, recipes, event tickets, knowledge-base articles, and any content your visitors want to save or print. This plugin gives them a one-click way to do it.

External services

This plugin relies on the third-party html2pdf.app API to generate PDFs. When a visitor clicks a conversion link, the URL of the page being converted (together with your conversion settings) is sent to https://api.html2pdf.app/v1/generate, which fetches that public URL, renders it, and returns the PDF. Your API key is sent with the request for authentication.

Because the API fetches the page itself, the page being converted must be publicly accessible on the internet.

  • Service: html2pdf.app — https://html2pdf.app
  • Terms of Service: https://html2pdf.app/terms-of-service/
  • Privacy Policy: https://html2pdf.app/privacy-policy/

Plugin Settings

Go to Settings HTML to PDF to configure:

  • API Key — your html2pdf.app key (with a “Test connection” button to verify it).
  • Page Format — Letter, Legal, Tabloid, Ledger, or A0–A6.
  • Landscape — switch orientation to landscape.
  • Mediascreen or print. Choose “print” to apply your theme’s @media print styles. This is the default for every button and can be overridden per shortcode.
  • Margins — top, right, bottom, and left margins in pixels.
  • Width / Height — optional custom page size in pixels.
  • Automatic button — enable it, choose which post types it appears on, its position, and the button text.

Usage

Shortcode

Add the shortcode to any page or post:

[html2pdf text="Save as PDF"]

Supported attributes:

  • text — the button label (default: “Generate PDF”).
  • mediascreen or print (defaults to the Media setting).

Example: [html2pdf text="Download PDF" media="print"]

Automatic button (no shortcode)

Under Settings HTML to PDF Automatic Save as PDF button, enable the button and pick the post types, position, and label. The button is then added to that content automatically.

Examples

Hide parts of the page from the PDF. Add the html2pdf_hide class to any element (header, footer, sidebar, etc.) and it will be excluded from the generated PDF, while still showing normally to your visitors:

<div class="html2pdf_hide"> ... not included in the PDF ... </div>

No extra CSS or print media is required — the conversion button is hidden automatically too.

For full control, the page <body> receives a html2pdf-rendering class while it is being converted, so you can target anything from your theme’s stylesheet:

.html2pdf-rendering .site-header,
.html2pdf-rendering .site-footer {
    display: none !important;
}

You can also use the “media” parameter (or the Media setting) to activate your theme’s print styles: [html2pdf text="Save as PDF" media="print"].