Guide Mar 28, 2026

Convert Any URL to PDF With One API Call: The 2026 Way

You need to convert a webpage to PDF. No browser management, no infrastructure — just a REST call. Public pages, internal dashboards, authenticated reports.

You need to convert a webpage to PDF. The traditional approach: spin up Puppeteer, manage Chromium, write 20+ lines of code, wait for the browser to start. There's a better way.

PageBolt's /pdf endpoint converts any URL to PDF in one HTTP call. Public websites, internal pages, authenticated dashboards — all work the same way. No browser management, no infrastructure, just REST.

Real-World Use Cases

All of these are one HTTP call away.

Basic URL-to-PDF

Convert any publicly accessible URL to PDF:

curl -X POST https://pagebolt.dev/api/v1/pdf \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/invoice/12345",
    "format": "A4",
    "margin": "1cm"
  }' \
  -o invoice.pdf

That's it. The PDF is saved locally. One request, one PDF.

JavaScript: Generate and Download

const response = await fetch('https://pagebolt.dev/api/v1/pdf', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.PAGEBOLT_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://my-app.com/report/2026-Q1',
    format: 'A4',
    margin: '1.5cm',
    displayHeaderFooter: true,
    footerTemplate: '<div style="font-size:10px;text-align:center;width:100%">Page <span class="pageNumber"></span> of <span class="totalPages"></span></div>',
  }),
});

const pdfBuffer = await response.arrayBuffer();

// Trigger download in the browser
const blob = new Blob([pdfBuffer], { type: 'application/pdf' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'report-q1-2026.pdf';
a.click();

Users click a button, the PDF downloads instantly. No waiting for Chromium startup.

Python: Server-Side PDF Generation

import requests, os

response = requests.post(
    'https://pagebolt.dev/api/v1/pdf',
    headers={
        'x-api-key': os.environ['PAGEBOLT_API_KEY'],
        'Content-Type': 'application/json',
    },
    json={
        'url': 'https://my-saas.com/invoice/INV-2026-5678',
        'format': 'A4',
        'margin': '1cm',
        'displayHeaderFooter': True,
        'headerTemplate': '<div style="font-size:12px;text-align:center;width:100%">CONFIDENTIAL</div>',
        'footerTemplate': '<div style="font-size:10px;text-align:center;width:100%">Page <span class="pageNumber"></span></div>',
    }
)

with open('invoice.pdf', 'wb') as f:
    f.write(response.content)

# Then upload to S3
upload_to_s3('invoice.pdf', bucket='invoices', key='INV-2026-5678.pdf')

Advanced Options: Headers, Footers, Orientation

curl -X POST https://pagebolt.dev/api/v1/pdf \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://my-app.com/report/2026-annual",
    "format": "A4",
    "landscape": true,
    "margin": "1.5cm",
    "displayHeaderFooter": true,
    "headerTemplate": "<div style=\"font-size:14px;text-align:center;width:100%;color:#666\">Annual Report 2026</div>",
    "footerTemplate": "<div style=\"font-size:10px;text-align:center;width:100%;color:#999\">Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span></div>",
    "printBackground": true,
    "scale": 1.0
  }' \
  -o annual-report.pdf

Key parameters:

Batch PDF Export

Your SaaS has 500 reports. Users need them all as PDFs. Generate on-demand instead of storing 500 PDF files:

#!/bin/bash
for report_id in $(get_all_report_ids); do
  curl -X POST https://pagebolt.dev/api/v1/pdf \
    -H "x-api-key: $PAGEBOLT_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"url\": \"https://my-app.com/reports/$report_id\", \"format\": \"A4\", \"printBackground\": true}" \
    -o "pdfs/report-$report_id.pdf"

  aws s3 cp "pdfs/report-$report_id.pdf" "s3://reports/report-$report_id.pdf"
done

Cost analysis: 500 PDFs = 500 API requests ≈ $5–15/month at PageBolt pricing. Compare to Puppeteer infrastructure: $200–500/month plus 40+ developer hours to build a custom pipeline.

Authenticated Pages

Need to convert a page behind a login? Pass cookies:

const response = await fetch('https://pagebolt.dev/api/v1/pdf', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.PAGEBOLT_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://my-saas.com/dashboard',
    cookies: [
      { name: 'session_id', value: 'abc123xyz', domain: 'my-saas.com' },
    ],
    format: 'A4',
    margin: '1cm',
  }),
});

const pdf = await response.arrayBuffer();
fs.writeFileSync('dashboard.pdf', Buffer.from(pdf));

The page renders with your session cookie. Authentication handled automatically.

URL-to-PDF vs HTML-to-PDF

ScenarioURL-to-PDFHTML-to-PDF
Convert a live webpage
Generate from custom HTML string
Server-side invoice generation
Authenticated pages
Simple string-based template
Render dynamic content

Getting Started

  1. Sign upFree tier: 100 requests/month, no credit card
  2. Get your API key — Available immediately from the dashboard
  3. Test it — Copy the curl example above and convert any public URL
  4. Integrate — Use the JavaScript or Python examples to add PDF export to your app
  5. Scale — Monitor usage in the dashboard; upgrade if needed

URL-to-PDF doesn't require infrastructure. Try PageBolt free — 100 requests/month, no credit card needed.

Convert URLs to PDF without managing a browser — free

100 requests/month, no credit card. Any URL to PDF in one API call — public pages, internal reports, authenticated dashboards.

Get API key free →