ScreenshotNeo

BlogHTML to image & PDF

How to Capture a URL2PNG Screenshot as a PDF

URL2PNG returns PNG screenshots, not PDFs. Capture the page, convert the image to PDF, or use a separate URL-to-PDF service.

By the ScreenshotNeo team4 October 20267 min read

URL2PNG documents screenshot output as PNG, not PDF. To make a PDF from a URL2PNG screenshot, request and save the PNG, then convert that image to PDF with a separate tool. If you need a webpage rendered as a paginated PDF directly, use a URL-to-PDF service; that is a different workflow.

1. Check access and choose the capture

Before building an integration, check whether you can create a URL2PNG account: its signup page currently says signup is restricted and asks visitors to request a code. Access can change, so confirm on the URL2PNG signup page.

URL2PNG’s v6 quickstart shows PNG requests. The fullpage=true option attempts to capture the entire document canvas; without it, the capture is viewport-only. Choose a viewport that will remain readable when the image is placed on a PDF page. Full-page capture can make a tall page shrink substantially when fitted to one sheet.

2. Request and save the URL2PNG PNG

The v6 request uses an API key, a token generated from the complete query string and secret, and the encoded target URL. Follow URL2PNG’s official signing instructions and use its examples to generate the signature. Keep the secret on a trusted server; do not place it in browser code, a public page, or a distributed application.

Build the request with the required signed query parameters and save the response as a PNG. This shell pattern shows the download step once you have constructed the signed URL:

curl --fail --location "SIGNED_URL_FROM_YOUR_SERVER" --output page.png

SIGNED_URL_FROM_YOUR_SERVER is a placeholder: it must be replaced by the URL2PNG v6 request URL with the correctly signed query. Do not send this placeholder literally. Consult the URL2PNG quickstart and documentation for its current token construction and endpoint details.

Capture options that affect the PDF

Option Effect When to use it
fullpage=true Attempts to capture the entire document canvas instead of only the viewport. Use for a long page when you need one continuous screenshot. Inspect the result for missing or clipped content.
viewport Sets capture dimensions. The docs show a default of 1480×1037 and a maximum of 5000×5000. Set dimensions to suit the page and intended PDF scale. A very wide image can become small on a portrait sheet.
delay Waits a fixed number of seconds after document readiness and asset loading. Use when content appears after initial page load, then choose the shortest delay that reliably includes it.
say_cheese Waits for a designated page element. Prefer a specific element condition when the page exposes a reliable readiness marker.
custom_css_url Applies custom CSS from a URL. Use only when you need to adjust the rendered page before capture.
user_agent, accept_languages Adjust the browser identity and language preferences. Use when the page varies by locale or user agent; verify the resulting page.
unique, ttl Control fresh captures and cache lifetime. The documented default TTL is 30 days. Use a fresh-capture setting when page changes must be reflected; otherwise caching can avoid repeat renders.

3. Convert the PNG to PDF

Once page.png exists, convert it with an image-to-PDF tool available in your environment. The exact command and page sizing depend on that tool. For a GUI workflow, open the PNG in an image viewer or editor with PDF export, choose the paper size and fit or scale setting, and save as PDF.

For a scripted workflow, use your preferred image library or document converter to place the image on a PDF page. Decide explicitly whether to preserve the screenshot’s aspect ratio, fit it within margins, or crop it. Then open the resulting PDF and check for clipping, unreadable text, unexpected whitespace, and page orientation. The PNG-to-PDF step wraps a screenshot image in a PDF; it does not reflow webpage text or create selectable text.

4. Pick the right output workflow

Need Suitable route
A visual record of the page as an image on a PDF page URL2PNG PNG capture, then separate image-to-PDF conversion.
A paginated PDF rendered from a public webpage URL A distinct URL-to-PDF service. HTML2IMG, for example, documents a public-URL screenshot endpoint with format: "pdf"; that capability is not URL2PNG’s PDF export.

Compare the required output type, whether you need a screenshot or paginated document, rendering controls, account access, integration work, and current plan terms. The available documentation does not establish a like-for-like independent quality or price comparison.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. It can return PNG, JPEG, WebP, or PDF from one GET request. Use PDF output when you want a direct URL-to-PDF capture rather than converting a URL2PNG PNG yourself.

cURL example:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.pdf

Python:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com", "format": "pdf"},
    timeout=90,
)
r.raise_for_status()
open("shot.pdf", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://stripe.com',
  format: 'pdf'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`ScreenshotNeo returned ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.pdf', Buffer.from(await res.arrayBuffer()));

See the ScreenshotNeo API documentation for authentication and PDF options. Cookie banners are accepted and removed before capture, along with known newsletter popups and chat widgets; each cleanup step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with page verdict and billing headers in each response. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Every feature is on every plan.

Create a free ScreenshotNeo account for 1,000 screenshots a month, with no card required.

Troubleshooting

Symptom Likely cause What to do
URL2PNG rejects the request or returns an authorization error The token does not match the complete query, a parameter was changed after signing, or the key/secret is wrong. Generate the token from the final query exactly as the official instructions specify. URL-encode values before signing as required by the docs, and keep the secret server-side.
The downloaded file is not a valid PNG The request failed but the response body was saved as though it were an image. Use curl’s fail option, inspect the HTTP status and response body, and confirm the request URL and credentials.
The screenshot is cut off Default viewport capture was used, or the page layout extends beyond the chosen dimensions. Set fullpage=true to attempt the full canvas, or adjust viewport. Inspect the PNG before conversion.
Content is missing from the capture It may load asynchronously after the capture begins. Use a suitable delay or wait for a page element with say_cheese; avoid excessively long waits.
PDF content is tiny A long or wide screenshot was fitted onto a single PDF page. Choose a larger paper size, use landscape, split the source into sections/pages with your converter, or choose a paginated URL-to-PDF renderer.
Output looks stale A cached screenshot may be reused within the TTL. Review unique and ttl behavior in current docs and request a fresh capture when necessary.
Signup cannot proceed URL2PNG currently indicates signup is restricted and requires a code. Check the official signup page for current access instructions before investing in integration.

Performance, reliability, and cost

For URL2PNG, the workflow has two stages: remote page rendering and local image-to-PDF conversion. Large full-page captures take more data to download and may be scaled down in the PDF. A cache can reduce repeat renders, while a fresh-capture option is useful when the page changes. Add a delay only when needed, because it increases waiting time. The official plans page describes month-to-month plans and counts each fresh screenshot generated at a user’s request as a render; check the live page for current prices and availability.

Make the conversion step reliable by checking the HTTP response before accepting the PNG, retaining the source image for debugging, and validating the final PDF. If generating PDFs in a service, use temporary files or streams carefully and clean up artifacts after success or failure. For direct URL-to-PDF rendering, account for pagination and page-break behavior separately from screenshot dimensions.

FAQ

Does URL2PNG have a PDF format parameter?

The reviewed URL2PNG quickstart documents PNG output and does not document a PDF output setting. Convert the PNG separately or use a different URL-to-PDF service.

Will full-page capture always include the whole site?

No. URL2PNG describes fullpage=true as an attempt to capture the entire document canvas. Check the downloaded image for completeness.

Will the PDF contain selectable webpage text?

A PDF made from the screenshot PNG contains the image. Text is generally not selectable as webpage text, and it will not reflow like a document.

Can I use this for a private page behind login?

Only if the capture service can access the page with the authentication and network setup it supports. Do not expose signing secrets or credentials in client-side code; check the current URL2PNG documentation for supported request options.

Can I use Cloudinary instead?

Cloudinary documents a URL2PNG add-on for generating screenshot images through its transformation and delivery flow, with a Cloudinary account and add-on registration as prerequisites. Its documentation describes screenshot images, not PDF export.