GET /v1/pdf-from-htmlConvert HTML to PDF
VPS Browser lf-vps-browser
Turns a web page or an HTML snippet into a PDF file. Converts HTML content to PDF using a browser-based rendering service. Accepts inline HTML or a URL to fetch from.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | No | Raw HTML content |
url | string | No | URL to fetch HTML from |
Response Schema
success (boolean): Operation success
pdf_url (string): Temporary PDF URL
pages (integer): Number of pages
size_bytes (integer): PDF file size
cURL Example
curl 'https://lf-vps-browser.laminarforge.dev/v1/pdf-from-html?html=%3Ch1%3EHello%3C/h1%3E' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-vps-browser.laminarforge.dev/v1/pdf-from-html'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'html': '<h1>Hello</h1>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())