How to Convert a Website Page to PDF with Html2Pdf.app from WordPress
Add a PDF button to a WordPress page with Html2Pdf.app, configure print layout, and fix access or rendering problems.
To let visitors download a WordPress page as a PDF with Html2Pdf.app, install and activate the HTML to PDF Converter plugin, add your Html2Pdf.app API key under Settings → HTML to PDF, test the connection, and place the plugin shortcode on a publicly reachable page. The plugin sends the page URL and conversion settings to Html2Pdf.app, which fetches and renders the page. It does not convert the page entirely inside WordPress.
1. Install and configure the plugin
- In the WordPress dashboard, open Plugins → Add New Plugin.
- Search for HTML to PDF Converter, install it from the WordPress plugin directory, and activate it.
- Open Settings → HTML to PDF.
- Enter your Html2Pdf.app API key. Follow the provider’s WordPress plugin instructions to obtain and configure the key.
- Use the settings page’s connection test. Resolve any key or connection issue before publishing the button.
Keep the API key private. The provider advises using it from a backend, server-side script, or trusted job, not in browser JavaScript, public repositories, or client-side templates. The plugin’s settings page is the intended place for the WordPress integration.
2. Add a PDF button
Add this shortcode to the page or post where visitors should see the button:
[html2pdf text="Save as PDF"]
The text attribute sets the button label. To use the page’s print stylesheet for the PDF, specify print media:
[html2pdf text="Download PDF" media="print"]
The plugin also documents an automatic button option for selected post types. Its settings let you choose the button position and label. Use that option if the button should appear on many posts; use the shortcode when you want to place it on particular pages.
3. Choose the PDF layout
Use the plugin settings and shortcode options documented by the plugin to configure the output. Available layout choices include:
- Page format: A4, Letter, Legal, or custom dimensions.
- Orientation: portrait or landscape.
- Margins: set margins to keep text and page furniture away from the paper edge.
- Media mode:
screenorprint. Print mode applies print-specific styles where the theme defines them. The shortcode’smediaattribute can override the plugin default. - Excluded content: add the
html2pdf_hideCSS class to elements that should remain visible on the website but not appear in the generated PDF.
For example, put the html2pdf_hide class on a share bar, related-posts block, or on-page PDF button if you do not want it in the document. Use the actual class on the relevant element; print media alone depends on the theme’s CSS and may not remove every unwanted section.
4. Make the page reachable by the converter
Html2Pdf.app fetches the page itself. The URL must be publicly accessible from the internet, as stated in the WordPress.org plugin listing. A local development URL, HTTP-authenticated staging site, password-protected page, or private post will not be reachable as a public visitor would see it.
Before relying on the button, open the target URL in a private browser window where you are signed out. Check that the intended content appears without a login prompt, access challenge, or redirect to a private area.
5. Test the result before publishing widely
- Run the plugin’s API connection test.
- Add the shortcode to a representative page and generate a PDF.
- Check page breaks, margins, orientation, images, fonts, and whether headers or footers should be present.
- Try
media="print"if the site has print styles, then addhtml2pdf_hideto individual elements that should be excluded. - Repeat with pages that use different templates or content types. CSS, available fonts and image resources, and JavaScript load timing can change the rendered output.
6. cURL, Python, and Node.js alternatives
The WordPress plugin is the most direct route when the button belongs in a WordPress page. If you are building a server-side integration instead, Html2Pdf.app’s API accepts conversion requests; consult its API documentation for the current request fields and response handling. Keep the API key on the server. Do not put it in browser code.
The research sources for this article do not specify a complete API request schema or runnable cURL, Python, or Node.js request examples. Do not guess the endpoint, authentication parameter, or payload: use the provider’s current documentation for those details. The plugin’s documented WordPress workflow above requires no custom API client.
Or skip the browser setup
If you need a screenshot of a public page rather than a PDF, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns a PNG, JPEG, or WebP screenshot, or a PDF. The API can capture full pages, but it does not add a WordPress download button for visitors.
cURL example:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for options. Cookie banners, popups, and chat widgets are removed before the shot; each step can be turned off. Bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| PDF is empty or conversion fails | The service cannot fetch the page, or the API key is not configured correctly. | Confirm the page opens publicly while signed out and without HTTP authentication. Run the plugin’s connection test and check the key in Settings → HTML to PDF. |
| Works on the live site but not staging | Staging may require a password or be reachable only inside a private network. | Make the target page publicly reachable for conversion, or test on the public deployment. A local or access-protected URL cannot be fetched as a public page. |
| Navigation or footer appears in the PDF | The selected media mode or theme print styles do not hide those elements. | Try media="print" and inspect the theme’s print CSS. Add html2pdf_hide to specific elements that should be omitted. |
| Layout differs from the webpage | Print styles, page dimensions, margins, fonts, or external resources affect rendering. | Choose the intended paper format and orientation, tune margins, verify required resources are available, and test representative pages. |
| Some content or images are missing | A resource may not be reachable or JavaScript content may not be ready when rendering occurs. | Check that the page and its resources are publicly accessible and review the provider’s rendering documentation for media, fonts, resources, and JavaScript timing. |
| PDF button is absent | The shortcode may not be on the rendered page, or the automatic button is not enabled for that post type. | Confirm the shortcode is in the page content, or check the plugin’s automatic button settings, selected post types, position, and label. |
| API key is exposed | The key was placed in client-side code or a public repository. | Remove it from public locations and follow the provider’s key-management guidance to replace or secure it. Keep requests server-side. |
Performance, reliability, and cost
Conversion is a hosted fetch-and-render operation, so the result depends on the target page being reachable and its CSS, fonts, images, and scripts loading in a form the renderer can use. Check representative page templates before enabling the feature across a large site. The provider documentation says generated PDFs are processed temporarily rather than permanently stored on its servers; it also says raw HTML or text submitted through the html parameter is not stored in conversion logs, while selected request metadata and a source URL may be retained. Review the current provider documentation for data handling that applies to your implementation.
Html2Pdf.app’s published pricing, accessed in 2026, lists a free plan with 100 credits per month, one parallel conversion, and a 1 MB maximum PDF size. Paid plans list $9/month for 1,000 credits and 3 parallel conversions, $25/month for 5,000 credits and 10 parallel conversions, and $39/month for 10,000 credits and 20 parallel conversions. The pricing page says one credit covers each 5 MB chunk of generated PDF, credits reset on the first day of each month, and paid plans have unlimited PDF size. These are provider-published terms and can change; verify the current pricing page before choosing a plan.
FAQ
Can I add the button without a shortcode?
Yes. The plugin listing describes an automatic button setting for selected post types, with configurable position and label.
Can visitors convert a private WordPress page?
Not through the documented fetch flow if the page requires a login or other access. The service needs to reach the URL as a public visitor.
Does the plugin convert the page on my WordPress server?
No. It is a front end to Html2Pdf.app’s hosted conversion API, which fetches and renders the page.
Can I remove the website header only from the PDF?
Use print CSS or add the html2pdf_hide class to the header element if you want it omitted from the PDF while remaining on the webpage.
Does ScreenshotNeo replace this WordPress PDF button?
No. ScreenshotNeo can return a PDF from an API request, but the facts provided here do not describe a WordPress plugin or a visitor-facing button. Use the WordPress plugin workflow when visitors need a button on a page.


