Skip to content

PDF of pages behind a login

HTML to PDF API for Pages Behind a Login

SitePDF renders a page that needs a login into a PDF by sending your session cookie or an Authorization header with the render call. The page prints in managed Chromium as your signed in user sees it, and the copy can be archived with a capture time.

  • PDF and archive in one call
  • Plans from $49 a month
  • Your HTML stays yours

Short answer

To convert a page behind a login to PDF, send url together with cookies (an array of cookie objects) or headers (an object such as an Authorization bearer token) in the render call. SitePDF sets them before it opens the page, so the account dashboard, report or invoice view loads as it does for the signed in user.

Starter API is $49 a month for 10,000 renders ($288 billed yearly). Growth is $99 a month for 50,000 renders and Scale is $299 a month for 250,000. The address must be reachable from the public internet.

Written and fact checked by the SitePDF team.

Which way to authenticate the render

Pick the field that matches how your app checks the user. Both are passed to Chromium before the page loads.

Your app uses Send Notes
A session cookie cookies: an array of objects with name, value and domain Use a short lived session made for the render, not a staff login
A bearer token or API key header headers: an object such as {"Authorization": "Bearer ..."} Sent with the page request and with the requests the page makes to the same site
A signed link with an expiry url only No secret leaves your app and the link dies after a minute or two
A page on a private network or VPN Not supported The address must be public, so expose a signed route instead

Plans and prices are from our own pricing page.

A worked example with a customer report

A SaaS product has a usage report at /reports/2026-11 that only the account owner can open. Support wants a PDF of it attached to the monthly email. The backend creates a session for that owner that expires in five minutes and passes it to the render.

{\n  "url": "https://app.example.com/reports/2026-11",\n  "format": "Letter",\n  "wait_for": "#usage-chart",\n  "cookies": [{"name": "session", "value": "abc123", "domain": "app.example.com"}],\n  "archive": true\n}

The chart is drawn by a script, so wait_for holds the render until it exists. With archive set to true the render is also stored with its capture time and a SHA-256 hash, as on the invoice PDF archive page.

Keep the credential small and short lived

Never hand the renderer a long lived staff password or a master key. Create a session or token that can read one account, set it to expire in minutes and revoke it when the render returns. A signed URL is even safer, because there is no secret to leak in the request body. The scheduled PDF reports article shows the signed route pattern.

Cookie and header values are used for that render. Treat the render request like any other call that carries a credential, and keep it out of your logs.

What it does not do

SitePDF does not type a username and password into a login form, solve a captcha or follow a two factor prompt. You supply a session that is already valid. It also cannot reach an address on a private network, because the render address must be public.

Single page apps that call an API with a token kept in browser storage need the token present before the first request. If your page reads it from localStorage, a cookie or header is not enough, and a signed render route in your own app is the cleaner fix.

Where it fits next to capture and archiving

Authenticated render is the same call used for public pages, so it works with batch lists and with the URL to PDF API. Teams that keep dated copies of what a customer saw in their account use it with website archiving. For invoices sent from a SaaS product see the HTML to PDF API for SaaS.

Who it is for and who it is not for

It is for developers who must produce a PDF of an account page, report or invoice view that only a signed in user can open, and want the same layout as the browser.

It is not for anyone who wants a tool to log in on its own, to capture third party sites whose terms forbid it, or to read pages on a private network.

Render a signed in page with a bearer token.
curl -X POST https://api.sitepdf.com/v1/render \
  -H "Authorization: Bearer $SITEPDF_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://app.example.com/reports/2026-11", "format": "Letter", "headers": {"Authorization": "Bearer $USER_TOKEN"}, "archive": true}'

This is the documented API call shape. Full request and response walkthrough.

Questions about this job

How do I convert a page behind a login to PDF?
Send the page url with a cookies array or a headers object in the render call. SitePDF sets them before loading the page, so Chromium prints the signed in view. Use a short lived session made for the render.
Can I pass a bearer token to the HTML to PDF API?
Yes. Put it in the headers object, for example an Authorization header. It is sent with the page request, so a page that checks a token loads as it does for the signed in user.
Can the API log in with a username and password?
No. It does not fill in login forms or handle captcha or two factor prompts. You pass a session cookie or token that is already valid.
Can it render a page on an intranet or VPN?
No. The address must be reachable from the public internet. Expose a signed, expiring route in your app for the render instead.
How much does it cost?
Starter API is $49 a month for 10,000 renders, or $288 billed yearly. Growth is $99 a month for 50,000 renders and Scale is $299 a month for 250,000. Authenticated renders count as ordinary renders.

Index

More PDF and archiving tools

Get started

Render and archive with one API call

A pixel perfect PDF and a dated copy of the page from the same request. Plans from $49 a month, half price billed yearly.

HTML to PDF, in your browser

Buy the plan