How to Save a Full-Page Website Screenshot as a PDF with Html2Pdf.app
Use Html2Pdf.app to convert a public webpage to PDF, or automate it with the API. Learn the settings, limits, and how PDF output differs from a screenshot.
Html2Pdf.app can convert a publicly reachable webpage to a PDF, either in its browser-based converter or through its API. The result is a rendered document, not necessarily a pixel-perfect full-page screenshot: the official materials reviewed describe URL or HTML conversion to PDF, but do not document a dedicated full-page screenshot mode or guarantee an exact reproduction of every visual detail. Html2Pdf.app describes its online converter as a no-code tool. Its API documentation explains URL and raw HTML conversion.
1. Convert a webpage with the online tool
- Open the official Html2Pdf.app converter.
- Enter the webpage’s publicly reachable URL. A page that requires a login, blocks the service, or otherwise cannot be reached may not convert through this route.
- Generate the PDF and save it using the controls presented by the converter. The official information reviewed confirms the browser converter but does not establish its current button labels or exact screen sequence.
- Open the downloaded PDF and inspect the page content, breaks, and resource loading. Rendering can be affected by CSS media mode, fonts, externally loaded resources, and JavaScript timing.
This workflow produces a PDF representation of the page. If you need one long image of the page, a PDF does not automatically meet that requirement; PDF pages may paginate content and may not preserve every dynamic visual detail.
2. Generate a PDF with the Html2Pdf.app API
The documented synchronous API uses POST https://api.html2pdf.app/v1/generate, an X-API-Key header, and an html request field containing either a publicly reachable URL or raw HTML. A successful response is PDF binary data. Check the HTTP status and save the bytes directly; do not parse a successful response as JSON or text.
cURL
curl --fail-with-body \
-X POST "https://api.html2pdf.app/v1/generate" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"html":"https://example.com"}' \
-o document.pdf
The API’s documented cURL workflow writes the response to a PDF file. Keep the API key private; avoid committing it to source control or embedding it in client-side code.
Python
import requests
url = "https://api.html2pdf.app/v1/generate"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {"html": "https://example.com"}
response = requests.post(url, headers=headers, json=payload, timeout=90)
if not response.ok:
raise RuntimeError(
f"Html2Pdf.app returned HTTP {response.status_code}: {response.text}"
)
with open("document.pdf", "wb") as pdf_file:
pdf_file.write(response.content)
Node.js
const response = await fetch("https://api.html2pdf.app/v1/generate", {
method: "POST",
headers: {
"X-API-Key": process.env.HTML2PDF_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ html: "https://example.com" }),
});
if (!response.ok) {
throw new Error(`Html2Pdf.app returned HTTP ${response.status}: ${await response.text()}`);
}
const pdf = Buffer.from(await response.arrayBuffer());
await import("node:fs/promises").then(({ writeFile }) => writeFile("document.pdf", pdf));
Set HTML2PDF_API_KEY in the environment before running the Node.js example. In both code examples, replace the sample URL with the public page you want converted. The API also accepts raw HTML in the html field.
3. Choose PDF rendering options
The API documentation lists these rendering controls. Check the current documentation for request syntax and any plan-specific limits before relying on a setting.
| Option | What it controls | Practical guidance |
|---|---|---|
| Orientation | Portrait or landscape page orientation | Use landscape when wide tables or layouts would otherwise be reduced or clipped. |
| Paper size | Standard formats such as A4 and Letter, or custom width and height | Choose the format expected by the people printing or archiving the file. |
| Margins | Space around the rendered page content | Use explicit margins when readability or printer-safe space matters. |
| CSS media | screen or print styles |
Try screen for the browser-like presentation or print when the site provides print-specific styles. |
| Scale | Render scale from 0.1 to 2 | Adjust carefully: shrinking can fit wide content but makes text smaller; enlarging can increase clipping or pagination. |
| Wait | Wait from 0 to 10 seconds for JavaScript or asynchronous resources | Increase it if charts or client-rendered content appear late, while accounting for longer request time. |
| Filename | Suggested output filename | Choose a stable, descriptive name for automated workflows. |
| Page breaks | CSS rules can make selected elements begin new PDF pages | Use page-break styling for reports where sections should stay organized. |
Documented defaults are A4, portrait, zero margins, screen media, scale 1, and no wait. Defaults can be suitable for a quick conversion, but inspect the output rather than assuming it will suit every website.
4. Check output quality and handle edge cases
- Long pages: Review every page for unexpected breaks, clipped sections, and repeated or missing content. Use CSS page-break rules for content you control.
- Lazy images and charts: A page may load visual content after its initial document response. Allow time for JavaScript and asynchronous resources, then inspect the PDF. The documented wait setting is limited to 0–10 seconds.
- Fonts or images missing: Check that external resources are publicly reachable by the rendering service and that the page does not require an authenticated browser session to fetch them.
- Responsive layouts: Screen and print CSS can produce different layouts. Try the relevant media mode and verify text size, columns, and page breaks.
- Login-only pages: The documented URL route requires a publicly reachable URL. Do not assume the converter can access a page that depends on your personal login session.
- Dynamic or changing content: The PDF records what rendered during the conversion request; content that changes later or loads after the wait may be absent.
- Need an image instead of a document: PDF output is not proof of a full-page screenshot image. If the deliverable must be PNG, JPEG, or WebP, use a screenshot capture workflow.
5. Troubleshooting API errors
| Response | Likely cause | What to do |
|---|---|---|
| 400 | Invalid parameter or the source URL is not publicly reachable | Check the request fields and confirm the URL can be reached without a login or private network. |
| 401 | Missing or invalid API key | Check the X-API-Key header and use the key associated with the account. |
| 403 | Plan limit or access restriction | Review the account limit and plan before retrying. |
| 500 | Unhandled server error | Retry later if appropriate; do not treat repeated retries as a fix for invalid input or account limits. |
| PDF is empty or incomplete | Page resources were unavailable, or JavaScript had not finished rendering | Check public access to resources, adjust the wait within the documented range, and review the saved PDF. |
| Response is saved but file is invalid | An error response may have been written as though it were PDF bytes | Check the HTTP status before writing the response body to a .pdf file. |
For automated jobs, log the status code and a safe summary of the error while keeping API keys and sensitive page content out of logs.
6. Async requests, reliability, and privacy
Html2Pdf.app also documents asynchronous requests using callBackUrl; the callback includes the PDF encoded in a document field. That approach can fit a workflow where the caller should not wait on a synchronous conversion. A one-off manual conversion generally does not need a callback. Validate callback handling and decode the returned document according to the current API documentation.
For synchronous automation, set a client timeout appropriate to the page, check status before saving, and make retries bounded. Retrying an invalid URL, bad key, or plan-limit response will not correct its cause. Because pages may change and resources may load inconsistently, review important generated documents.
The documentation says generated PDFs are processed temporarily and not permanently stored on the service’s servers. It also says raw HTML or text sent in html is not stored in conversion logs, while selected request metadata and a source URL may be retained. For sensitive pages, read the service’s privacy policy and data processing agreement before sending content.
7. Performance and cost considerations
Conversion time depends on the source page and the resources it loads. Waiting longer for JavaScript can improve completeness for delayed content, but adds latency. Large pages, remote images, and font downloads can also affect output readiness. Keep the PDF binary response as bytes, avoid unnecessary repeat conversions when the source has not changed, and use the asynchronous callback option when the documented workflow better fits a longer-running job.
Html2Pdf.app’s product materials advertise free-account credits and paid plans, but quotas and prices can change. Check the current plan page before estimating recurring costs. The documentation reviewed does not establish that a particular conversion is a pixel-exact screenshot or provide a universal rendering-time guarantee.
Or skip the browser setup
If the goal is a clean screenshot image or PDF through a screenshot API, ScreenshotNeo provides a single GET request. This example saves a screenshot response; use the API documentation for PDF capture options and other parameters.
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 supported formats and options. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000 shots. Sign up free for ScreenshotNeo.
FAQ
Does Html2Pdf.app create a literal full-page screenshot?
The official material reviewed documents URL or HTML to PDF conversion. It does not establish a dedicated full-page screenshot mode or promise pixel-perfect image capture.
Can I convert a page behind a login?
The documented URL input must be publicly reachable. The URL workflow should not be assumed to carry your personal browser login session.
Does the API return JSON?
On success it returns PDF bytes. Check the HTTP status and save the body as binary data.
Can I use raw HTML instead of a URL?
Yes. The API documentation lists a raw HTML value as a supported input in the html field.
How do I decide whether I need PDF or a screenshot image?
Choose PDF for a document with paper sizes and pagination. Choose an image capture workflow when the required output is a PNG, JPEG, or WebP image of the rendered page.


