URL to PDF

Operationalv2.0.1 • Updated 1 day ago

API Overview

Capture any public webpage as a high-quality PDF document. Perfect for archiving web content, generating reports, or creating offline documentation. Supports full CSS/JavaScript rendering with configurable options.

language

Web Capture

Render any public URL with full fidelity.

settings

Flexible Options

Custom page size, orientation, and margins.

Endpoints

POST/api/html-to-pdf/convert-url

Body Parameters

ParameterTypeRequiredDescription
urlstringYesThe URL of the webpage to convert to PDF.
formatstringNoPage format: A4, A3, A5, Letter, Legal, Tabloid (default: A4).
orientationstringNoPage orientation: portrait, landscape (default: portrait).
printBackgroundbooleanNoPrint background graphics (default: true).
scalenumberNoPage scale factor 0.1-2.0 (default: 1.0).
authobjectNoHTTP Basic Auth credentials for protected pages.

terminalAPI Playground

Live Simulation
import requests

url = "https://pdf.picopayd.codefission.co.uk/api/html-to-pdf/convert-url"
payload = {
    "url": "https://example.com/page-to-convert",
    "format": "A4",
    "orientation": "portrait",
    "printBackground": True,
    "scale": 1.0
}
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)

# Save the PDF
with open('webpage.pdf', 'wb') as f:
    f.write(response.content)

Response Body

200 OK
{
  "success": true,
  "pdf": "base64_encoded_pdf_content",
  "metadata": {
    "size": 124567,
    "format": "A4",
    "orientation": "portrait",
    "renderTimeMs": 1850,
    "url": "https://example.com/page-to-convert",
    "title": "Example Page Title"
  }
}