{"id":175176,"date":"2023-09-22T11:51:36","date_gmt":"2023-09-22T11:51:36","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/html-to-pdf-converter\/"},"modified":"2026-06-16T15:47:15","modified_gmt":"2026-06-16T15:47:15","slug":"html-to-pdf-converter","status":"publish","type":"plugin","link":"https:\/\/bho.wordpress.org\/plugins\/html-to-pdf-converter\/","author":20977654,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.1.0","stable_tag":"1.1.0","tested":"7.0","requires":"5.0","requires_php":"7.0","requires_plugins":null,"header_name":"HTML to PDF Converter","header_author":"html2pdf.app <info@html2pdf.app>","header_description":"A plugin that converts WordPress pages or posts to PDF using html2pdf.app API.","assets_banners_color":"","last_updated":"2026-06-16 15:47:15","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/html2pdf.app","header_author_uri":"https:\/\/html2pdf.app","rating":3,"author_block_rating":0,"active_installs":60,"downloads":3177,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.2":{"tag":"1.0.2","author":"html2pdfapp","date":"2023-09-30 07:18:13"},"1.0.3":{"tag":"1.0.3","author":"html2pdfapp","date":"2023-09-30 07:44:43"},"1.0.4":{"tag":"1.0.4","author":"html2pdfapp","date":"2023-10-31 07:13:11"},"1.0.5":{"tag":"1.0.5","author":"html2pdfapp","date":"2023-11-07 10:26:02"},"1.0.6":{"tag":"1.0.6","author":"html2pdfapp","date":"2024-03-12 16:22:12"},"1.0.7":{"tag":"1.0.7","author":"html2pdfapp","date":"2024-09-25 10:45:12"},"1.0.8":{"tag":"1.0.8","author":"html2pdfapp","date":"2024-12-24 11:56:46"},"1.1.0":{"tag":"1.1.0","author":"html2pdfapp","date":"2026-06-16 15:47:15"}},"upgrade_notice":{"1.1.0":"<p>Adds an automatic &quot;Save as PDF&quot; button, a default Media setting, an API key &quot;Test connection&quot; check, and button styling. Confirmed compatible with WordPress 7.0.<\/p>"},"ratings":{"1":1,"2":0,"3":0,"4":0,"5":1},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3157463,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.1.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3574718,"resolution":"1","location":"assets","locale":"","width":2272,"height":1622},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3574718,"resolution":"2","location":"assets","locale":"","width":2880,"height":1624},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3574718,"resolution":"3","location":"assets","locale":"","width":2862,"height":1512}},"screenshots":{"1":"Plugin settings page: API key with \"Test connection\", conversion options, and the automatic button settings.","2":"A \"Save as PDF\" button rendered on a page.","3":"Example of a generated PDF."}},"plugin_section":[],"plugin_tags":[8604,172025,167209,1764,236099],"plugin_category":[50],"plugin_contributors":[222052],"plugin_business_model":[],"class_list":["post-175176","plugin","type-plugin","status-publish","hentry","plugin_tags-convert-to-pdf","plugin_tags-html2pdf","plugin_tags-page-to-pdf","plugin_tags-pdf","plugin_tags-save-to-pdf","plugin_category-media","plugin_contributors-html2pdfapp","plugin_committers-html2pdfapp"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/html-to-pdf-converter\/assets\/icon-128x128.png?rev=3157463","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/html-to-pdf-converter\/assets\/screenshot-1.png?rev=3574718","caption":"Plugin settings page: API key with \"Test connection\", conversion options, and the automatic button settings."},{"src":"https:\/\/ps.w.org\/html-to-pdf-converter\/assets\/screenshot-2.png?rev=3574718","caption":"A \"Save as PDF\" button rendered on a page."},{"src":"https:\/\/ps.w.org\/html-to-pdf-converter\/assets\/screenshot-3.png?rev=3574718","caption":"Example of a generated PDF."}],"raw_content":"<!--section=description-->\n<p>The \"HTML to PDF Converter\" plugin, created by <a href=\"https:\/\/html2pdf.app\">html2pdf.app<\/a>, 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 \u2014 or switch on the automatic button to add a \"Save as PDF\" link to every post and page with no shortcode at all.<\/p>\n\n<p>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.<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li><strong>One shortcode<\/strong> \u2014 add a download button anywhere with <code>[html2pdf text=\"Save as PDF\"]<\/code>.<\/li>\n<li><strong>Automatic button<\/strong> \u2014 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.<\/li>\n<li><strong>Print-ready output<\/strong> \u2014 set the CSS media type to <code>screen<\/code> or <code>print<\/code> (globally or per shortcode) to use your theme's <code>@media print<\/code> styles and hide unwanted sections.<\/li>\n<li><strong>Full conversion control<\/strong> \u2014 page format (A4, Letter, Legal, and more), portrait\/landscape orientation, custom margins, and custom width\/height.<\/li>\n<li><strong>Test your connection<\/strong> \u2014 validate your API key from the settings page in one click before you go live.<\/li>\n<li><strong>Styled, theme-friendly button<\/strong> \u2014 ships with a clean default style that your theme can override, and is hidden automatically in the PDF when converting with print media.<\/li>\n<\/ul>\n\n<h4>Why a PDF plugin?<\/h4>\n\n<p>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.<\/p>\n\n<h3>External services<\/h3>\n\n<p>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 <code>https:\/\/api.html2pdf.app\/v1\/generate<\/code>, which fetches that public URL, renders it, and returns the PDF. Your API key is sent with the request for authentication.<\/p>\n\n<p>Because the API fetches the page itself, the page being converted must be publicly accessible on the internet.<\/p>\n\n<ul>\n<li>Service: html2pdf.app \u2014 https:\/\/html2pdf.app<\/li>\n<li>Terms of Service: https:\/\/html2pdf.app\/terms-of-service\/<\/li>\n<li>Privacy Policy: https:\/\/html2pdf.app\/privacy-policy\/<\/li>\n<\/ul>\n\n<h3>Plugin Settings<\/h3>\n\n<p>Go to <strong>Settings \u2192 HTML to PDF<\/strong> to configure:<\/p>\n\n<ul>\n<li><strong>API Key<\/strong> \u2014 your html2pdf.app key (with a \"Test connection\" button to verify it).<\/li>\n<li><strong>Page Format<\/strong> \u2014 Letter, Legal, Tabloid, Ledger, or A0\u2013A6.<\/li>\n<li><strong>Landscape<\/strong> \u2014 switch orientation to landscape.<\/li>\n<li><strong>Media<\/strong> \u2014 <code>screen<\/code> or <code>print<\/code>. Choose \"print\" to apply your theme's <code>@media print<\/code> styles. This is the default for every button and can be overridden per shortcode.<\/li>\n<li><strong>Margins<\/strong> \u2014 top, right, bottom, and left margins in pixels.<\/li>\n<li><strong>Width \/ Height<\/strong> \u2014 optional custom page size in pixels.<\/li>\n<li><strong>Automatic button<\/strong> \u2014 enable it, choose which post types it appears on, its position, and the button text.<\/li>\n<\/ul>\n\n<h3>Usage<\/h3>\n\n<p><strong>Shortcode<\/strong><\/p>\n\n<p>Add the shortcode to any page or post:<\/p>\n\n<pre><code>[html2pdf text=\"Save as PDF\"]\n<\/code><\/pre>\n\n<p>Supported attributes:<\/p>\n\n<ul>\n<li><code>text<\/code> \u2014 the button label (default: \"Generate PDF\").<\/li>\n<li><code>media<\/code> \u2014 <code>screen<\/code> or <code>print<\/code> (defaults to the Media setting).<\/li>\n<\/ul>\n\n<p>Example: <code>[html2pdf text=\"Download PDF\" media=\"print\"]<\/code><\/p>\n\n<p><strong>Automatic button (no shortcode)<\/strong><\/p>\n\n<p>Under <strong>Settings \u2192 HTML to PDF \u2192 Automatic Save as PDF button<\/strong>, enable the button and pick the post types, position, and label. The button is then added to that content automatically.<\/p>\n\n<h3>Examples<\/h3>\n\n<p><strong>Hide parts of the page from the PDF.<\/strong> Add the <code>html2pdf_hide<\/code> class to any element (header, footer, sidebar, etc.) and it will be excluded from the generated PDF, while still showing normally to your visitors:<\/p>\n\n<pre>\n&lt;div class=\"html2pdf_hide\"&gt; ... not included in the PDF ... &lt;\/div&gt;\n<\/pre>\n\n<p>No extra CSS or print media is required \u2014 the conversion button is hidden automatically too.<\/p>\n\n<p><strong>For full control<\/strong>, the page <code>&lt;body&gt;<\/code> receives a <code>html2pdf-rendering<\/code> class while it is being converted, so you can target anything from your theme's stylesheet:<\/p>\n\n<pre>\n.html2pdf-rendering .site-header,\n.html2pdf-rendering .site-footer {\n    display: none !important;\n}\n<\/pre>\n\n<p>You can also use the \"media\" parameter (or the Media setting) to activate your theme's print styles: <code>[html2pdf text=\"Save as PDF\" media=\"print\"]<\/code>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to <code>\/wp-content\/plugins\/html-to-pdf-converter<\/code>, or install the plugin through the WordPress \"Plugins\" screen directly.<\/li>\n<li>Activate the plugin through the \"Plugins\" screen in WordPress.<\/li>\n<li>Go to <strong>Settings \u2192 HTML to PDF<\/strong> and enter your html2pdf.app API key. You can register for a free API key at https:\/\/dash.html2pdf.app\/registration.<\/li>\n<li>Click <strong>Test connection<\/strong> to confirm your key works.<\/li>\n<li>Add the <code>[html2pdf text=\"Save as PDF\"]<\/code> shortcode to a page or post \u2014 or enable the automatic button under \"Automatic Save as PDF button\".<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"do%20i%20need%20an%20api%20key%3F\"><h3>Do I need an API key?<\/h3><\/dt>\n<dd><p>Yes. The plugin uses the html2pdf.app API to render PDFs. Register for a free API key at https:\/\/dash.html2pdf.app\/registration and paste it into the plugin settings.<\/p><\/dd>\n<dt id=\"my%20page%20won%27t%20convert%20or%20the%20pdf%20is%20empty.%20why%3F\"><h3>My page won't convert or the PDF is empty. Why?<\/h3><\/dt>\n<dd><p>The html2pdf.app API fetches your page over the internet, so the page must be publicly accessible. Conversions will not work on local development sites (e.g. <code>localhost<\/code>), staging behind HTTP authentication, or password-protected\/private posts. Use a publicly reachable URL.<\/p><\/dd>\n<dt id=\"how%20do%20i%20check%20that%20my%20api%20key%20is%20correct%3F\"><h3>How do I check that my API key is correct?<\/h3><\/dt>\n<dd><p>On the settings page, click <strong>Test connection<\/strong> next to the API Key field. You'll get an immediate success or error message.<\/p><\/dd>\n<dt id=\"can%20i%20add%20the%20button%20without%20using%20a%20shortcode%3F\"><h3>Can I add the button without using a shortcode?<\/h3><\/dt>\n<dd><p>Yes. Enable the automatic button under <strong>Settings \u2192 HTML to PDF<\/strong>, choose the post types and position, and the \"Save as PDF\" button is added to your content automatically.<\/p><\/dd>\n<dt id=\"how%20do%20i%20hide%20the%20header%2C%20footer%2C%20or%20other%20parts%20of%20the%20page%20in%20the%20pdf%3F\"><h3>How do I hide the header, footer, or other parts of the page in the PDF?<\/h3><\/dt>\n<dd><p>Add the <code>html2pdf_hide<\/code> class to any element you want to exclude \u2014 it stays visible to visitors but is removed from the PDF. For custom rules, the <code>&lt;body&gt;<\/code> gets a <code>html2pdf-rendering<\/code> class during conversion. See the Examples section.<\/p><\/dd>\n<dt id=\"can%20i%20change%20the%20page%20size%2C%20margins%2C%20or%20orientation%3F\"><h3>Can I change the page size, margins, or orientation?<\/h3><\/dt>\n<dd><p>Yes \u2014 all of these are configurable on the settings page, including A4\/Letter\/Legal and other formats, landscape mode, custom margins, and a custom width\/height.<\/p><\/dd>\n<dt id=\"where%20is%20my%20content%20sent%3F\"><h3>Where is my content sent?<\/h3><\/dt>\n<dd><p>The URL of the page being converted and your conversion settings are sent to the html2pdf.app API. See the \"External services\" section above for details.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Confirm compatibility with WordPress 7.0<\/li>\n<li>Add automatic \"Save as PDF\" button insertion on selected post types (no shortcode required), with position and button text options<\/li>\n<li>Add a default Media (screen\/print) setting, overridable per shortcode<\/li>\n<li>Add a \"Test connection\" button on the settings page to validate the API key<\/li>\n<li>Mask the API key field with a Show\/Hide toggle<\/li>\n<li>Add usage examples directly in the plugin settings page<\/li>\n<li>Ship default button styling, and hide the conversion button in the generated PDF automatically (any media type)<\/li>\n<li>Add an html2pdf_hide class and an html2pdf-rendering body class to exclude any element from the generated PDF<\/li>\n<li>Redesign the settings page with grouped, card-style sections for clearer separation<\/li>\n<li>Restrict conversions to pages on the same site to prevent misuse of the API key<\/li>\n<li>Send API key via the X-API-Key header instead of a request body parameter<\/li>\n<li>Identify plugin requests for monitoring with an X-Source header<\/li>\n<li>Sanitize server-provided URL values<\/li>\n<\/ul>\n\n<h4>1.0.8<\/h4>\n\n<ul>\n<li>Use page URL instead of persisted one, add settings link in a plugins page<\/li>\n<\/ul>\n\n<h4>1.0.7<\/h4>\n\n<ul>\n<li>Update icon, increase compatibility with the latest wordpress version<\/li>\n<\/ul>\n\n<h4>1.0.6<\/h4>\n\n<ul>\n<li>Update readme file with examples<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Add possibility to pass media parameter through the shortcode<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Improve error reporting<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Icon, author URI and support email added<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Initial version<\/li>\n<\/ul>","raw_excerpt":"Convert any WordPress page or post to PDF with the html2pdf.app API \u2014 via a shortcode or an automatic &quot;Save as PDF&quot; button.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/175176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=175176"}],"author":[{"embeddable":true,"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/html2pdfapp"}],"wp:attachment":[{"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=175176"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=175176"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=175176"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=175176"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=175176"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/bho.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=175176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}