Go to example tasks

Convert HTML to PDF

Turn an HTML string into a PDF. Paste your markup, such as an invoice, report or certificate, and get a downloadable PDF back. Set the paper size and a base URL for relative links and images, and add a watermark or password. Call it from the API to generate documents from your own templates.

Try for free
HTML to PDF & URL to PDF API - Website Screenshots
HTML to PDF & URL to PDF API - Website Screenshotsautofacts/universal-web-printer
URL
Format
Mode
File
+3 fields
Text
Number
Boolean
List
Object

Input

Source Type(required):html
HTML Content:<html><body style="font-family:sans-serif"><h1>Invoice #1042</h1><p>Billed to: Example Ltd</p><table border="1" cellpadding="6"><tr><th>Item</th><th>Amount</th></tr><tr><td>Consulting</td><td>$1,200.00</td></tr><tr><td>Hosting</td><td>$80.00</td></tr></table><p><b>Total: $1,280.00</b></p></body></html>
Output Format:pdf

Output fields

URL
Format
Mode
File
Download
Size (bytes)
Captured

How it works

Sign up on Apify or log in

The HTML to PDF & URL to PDF API - Website Screenshots Actor is ready to run with the inputs already set for "Convert HTML to PDF". Sign up or log in and you'll land in Apify Console with a copy of this exact task.

Start the "Convert HTML to PDF" task

The HTML to PDF & URL to PDF API - Website Screenshots Actor will start running based on the input automatically. You can also change all the input fields, like source type, HTML Content, and more, to match your specific use case.

Receive the "Convert HTML to PDF" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as URL, format, mode, and more.

Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also run the "Convert HTML to PDF" task via API.

Image

Integrate "Convert HTML to PDF" into your workflow

Connect "Convert HTML to PDF" with 100+ integrations, or run it via API or MCP.

Webhook

Webhook

n8n

n8n

Make

Make

Zapier

Zapier

Airbyte

Airbyte

Keboola

Keboola

IFTTT

IFTTT

Hubspot

Hubspot

GDrive

GDrive

Gmail

Gmail

Apify MCP

Apify MCP

GitHub

GitHub

Slack

Slack

LangChain

LangChain

LlamaIndex

LlamaIndex

Flowise

Flowise

Pinecone

Pinecone

OpenAI

OpenAI

Mastra

Mastra

Clay

Clay

Frequently asked questions

Yes, as long as they are reachable by URL. Set the base URL so relative links in your HTML resolve.

Yes. Set the output format to PNG, JPEG or WebP.

Call the Actor through the Apify API with your HTML in the input, then fetch the file from the download link in the result.

Each result has a download link. The files are also in the run’s key-value store, and you can fetch them through the Apify API.

You pay per page rendered, plus a small extra for options such as watermarks, passwords or merging. Pages that fail to render are not charged. See the Pricing tab for current rates.