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:
- Archiving a page (an article, a listing, terms and conditions) on the day you saw it.
- Attaching an online receipt or confirmation page to an email or a record.
- Sending a client a PDF of a report that lives at a URL.
- Keeping proof of a price or an offer before it changes.
What you need
- A Cofferdock account. The free plan gives you 50 credits a month with no card, plenty to test.
- Your API key, created in your dashboard with "+ Create key". It's shown only once, so copy and save it.
- An HTTP Request node in your n8n workflow.
Step by step in the HTTP Request node
- Method:
POST - URL:
https://api.cofferdock.com/url-to-pdf - Send Query Parameters: on, for example
format=A4. - Send Headers: on, add two headers:
x-api-keywith your key, andContent-Typewith the valuetext/plain. - Send Body: on → Body Content Type
Raw→ Content Typetext/plain→ in Body, the address of the page, for examplehttps://example.com/article. - Under Options → Response → Response Format, choose File.
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:
- A Google Sheets node that reads the rows with the links.
- The HTTP Request node above, with the Body set to an expression such as
{{ $json.link }}. - 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:
- Wider layout: use
landscape=true, orscale=0.7(it fits more on each sheet, and the site uses its desktop layout). - Print stylesheet: by default the PDF looks like the page does on screen (
media=screen). Withmedia=printit uses the site's own print stylesheet, which usually hides menus and ads (some sites print poorly, so try both). - Hide a cookie notice or a menu: a cookie banner is part of the page, so it shows up in the PDF. Send
csswith a rule that hides it, for example.cookie-notice{display:none}. Find the element's class with your browser's inspector.
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:
| Option | Default | What it does |
|---|---|---|
format | A4 | Page size: A4, A3, A5, Letter, Legal or Tabloid. |
landscape | false | true for landscape paper. |
media | screen | screen = as it looks on screen; print = the site's print stylesheet. |
margin | 0 | Margin in millimetres on all four sides (0 to 100). |
scale | 1 | Content scale from 0.1 to 2. |
pages | 1-100 | Which pages of the PDF you want, for example 1-3,5. Only the first 100 pages can be printed. |
wait_ms | 0 | Extra wait before printing, in milliseconds (0 to 5000). |
lazy_load | true | Scrolls the page once before printing. false skips it (faster). |
css | none | Extra CSS applied before printing (up to 20,000 characters). |
output | pdf | pdf returns the file; url returns a temporary download link (15 minutes); json returns it in base64. |
When it can't work
- Pages that need you to sign in, ask you to prove you are a person or block robots: the API returns an error and the credit is not charged.
- URLs that are a file download (a PDF, a zip): they are not web pages, so you get a clear error and no charge. If the URL is already a PDF, download it directly.
- Very long pages: the PDF has at most 100 pages and 25 MB. If
meta.pagesis 100, the page may have been longer.
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 see | Why | Fix |
|---|---|---|
400 Invalid URL | The Body doesn't contain a full address. | It must start with http:// or https://. |
400 This looks like HTML | The Body contains HTML, not an address. | For HTML use the HTML to PDF tool. |
401 Missing x-api-key / Invalid API key | The 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 long | The page is too heavy or never finishes loading. | Try lazy_load = false, fewer pages, or a lighter page. Not charged. |
503 Server busy | A 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 file | Response Format is still on Autodetect/JSON. | Options → Response → Response Format → File. |
429 Too many requests or Monthly limit reached | Per-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
- HTML to PDF in n8n: invoices and reports from your own HTML
- Screenshot of a website in n8n: the same page as an image
Full reference with every option: URL to PDF API. No account yet? Create one for free and save your first page today.