Español

Lee este artículo en español.

URL to PDF in n8n: Save Any Web Page as a PDF with One Node

If you automate with n8n, sooner or later you need a web page as a PDF: an online receipt to attach to an expense, an article to archive, a product page to keep as proof, a report that only exists as a URL. You don't need to run a browser of your own. One HTTP Request node calling the Cofferdock API opens the page, prints it and gives you the PDF file.

One thing up front, because people search for it: n8n has no node that prints a web page to PDF. The Convert to File node writes CSV, HTML, ICS, JSON, ODS, RTF, text, XLS and XLSX files, but not PDF (n8n docs), and the only built-in node we found that creates PDFs, APITemplate.io, fills templates from that service: it has no field for a web address (checked in n8n's source code on 19 October 2026). The usual way is exactly this: an HTTP Request to an API that opens the page in a real browser.

What you get

You send the address of any public web page and the API returns a PDF of it, with its images, fonts and styles. The page runs its JavaScript like in a normal browser, and it is scrolled once from top to bottom so the images that only load when you reach them are in the PDF too.

Common uses in n8n:

What you need

Step by step in the HTTP Request node

The output is the PDF in the data binary property, ready for Gmail (attachment), Google Drive → Upload or Telegram.

A quick example

Say you keep a list of article links in Google Sheets and want a PDF copy of each one:

  1. A Google Sheets node that reads the rows with the links.
  2. The HTTP Request node above, with the Body set to an expression such as {{ $json.link }}.
  3. A Google Drive node that stores each PDF.

n8n runs the HTTP Request once per row, so you get one PDF per link with nothing done by hand.

Make the PDF look like the website

The PDF is as wide as the paper: an A4 sheet is about 800 pixels wide, so many sites come out with their tablet or mobile layout. Three options change that:

If part of the page appears late, add wait_ms (up to 5000 milliseconds).

Options you can tweak

Add them as Query Parameters in the same node:

OptionDefaultWhat it does
formatA4Page size: A4, A3, A5, Letter, Legal or Tabloid.
landscapefalsetrue for landscape paper.
mediascreenscreen = as it looks on screen; print = the site's print stylesheet.
margin0Margin in millimetres on all four sides (0 to 100).
scale1Content scale from 0.1 to 2.
pages1-100Which pages of the PDF you want, for example 1-3,5. Only the first 100 pages can be printed.
wait_ms0Extra wait before printing, in milliseconds (0 to 5000).
lazy_loadtrueScrolls the page once before printing. false skips it (faster).
cssnoneExtra CSS applied before printing (up to 20,000 characters).
outputpdfpdf returns the file; url returns a temporary download link (15 minutes); json returns it in base64.

When it can't work

Use it only on pages you have the right to save or copy, respecting each site's terms and copyright.

Common errors and how to fix them

What you seeWhyFix
400 Invalid URLThe Body doesn't contain a full address.It must start with http:// or https://.
400 This looks like HTMLThe Body contains HTML, not an address.For HTML use the HTML to PDF tool.
401 Missing x-api-key / Invalid API keyThe header is missing, misspelled or the key was revoked.Header name exactly x-api-key.
502 The page answered with HTTP 403 (or 404)The site blocks robots, or the page doesn't exist.Open the address in a private browser window to check it. Not charged.
422 The page took too longThe page is too heavy or never finishes loading.Try lazy_load = false, fewer pages, or a lighter page. Not charged.
503 Server busyA traffic spike.Wait a few seconds and try again (the Retry-After header says how many). Not charged.
The node returns text instead of a fileResponse Format is still on Autodetect/JSON.Options → Response → Response Format → File.
429 Too many requests or Monthly limit reachedPer-minute limit of your plan, or no credits left this month.Add a Wait node in big loops, or upgrade / buy extra credits.

Prefer to see it in code?

curl -X POST "https://api.cofferdock.com/url-to-pdf?format=A4&landscape=true" \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: text/plain" \
  --data-binary "https://example.com/article" \
  -o page.pdf

How much does it cost?

Each PDF uses 1 credit, whatever its number of pages. Every Cofferdock tool draws from the same credit pool: merging, watermarking, password-protecting or numbering the PDF afterwards uses the same subscription.

FAQ

Does n8n have a native node to turn a URL into a PDF? No. You do it with the HTTP Request node calling the Cofferdock API, which opens the page and generates the PDF.

Do I need to know how to code? No. You fill in the HTTP Request node fields following this guide. The code example is optional.

Does it run the page's JavaScript? Yes. Unlike HTML to PDF (made for your own HTML, without JavaScript), here the page is opened like in a real browser.

Can I use it on a page that needs a login? No. It opens the page as a visitor with no account, so a page behind a login returns an error and is not charged.

Can I convert several pages in a loop? Yes. If the previous node returns several rows with links, n8n runs the HTTP Request once per row and you get one PDF per item.

Related guides

Full reference with every option: URL to PDF API. No account yet? Create one for free and save your first page today.