
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.
[html2pdf text="Save as PDF"].screen or print (globally or per shortcode) to use your theme’s @media print styles and hide unwanted sections.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.
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.
Go to Settings HTML to PDF to configure:
screen 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.Shortcode
Add the shortcode to any page or post:
[html2pdf text="Save as PDF"]
Supported attributes:
text — the button label (default: “Generate PDF”).media — screen 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.
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"].