HTML to PDF API — Batch HTML & Website Printing avatar

HTML to PDF API — Batch HTML & Website Printing

Pricing

from $1.50 / 1,000 pdf documents

Go to Apify Store
HTML to PDF API — Batch HTML & Website Printing

HTML to PDF API — Batch HTML & Website Printing

Turn HTML strings or public website URLs into downloadable PDFs. A4 or Letter, landscape, backgrounds and per-document error rows. No separate rendering API key required.

Pricing

from $1.50 / 1,000 pdf documents

Rating

0.0

(0)

Developer

Bhojraj Pilaniya

Bhojraj Pilaniya

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

8 days ago

Last modified

Features

Limited permissions

Share

What does this Actor do?

Print invoices, reports and static HTML documents as browser-generated PDFs. Inline CSS, print backgrounds and public images/fonts are supported. Use HTML input for predictable printing; URL input is best for static public pages.

How to use it

  1. Enter your input in the form or JSON editor.
  2. Set Maximum cost per run in the run options.
  3. Start the Actor, then open Files and errors in Output.
  4. Download each file from its fileUrl. The dataset can also be exported as JSON, CSV or Excel.

Example input

{
"items": [
{
"id": "invoice-1001",
"html": "<html><body><h1>Invoice #1001</h1><p>Total: ₹5,000</p></body></html>"
}
]
}

See the Input tab for all options and validation limits.

Pricing

Pay per successful output, with no Actor subscription. Platform usage is included in event pricing. Current configured prices are shown in the Pricing tab.

EventPrice
PDF document$1.50 / 1,000 successful files
Actor start$0.0005 per GB of allocated memory, minimum one event

The start fee applies even if every item fails. There is no result fee for an invalid URL, HTTP error, missing element, timeout or failed render. Budget-skipped items have no result fee. Start fewer runs with larger batches to reduce startup overhead. For example, 100 items cost 100 × the applicable result price plus one memory-based start fee. An item is one output on one device/size, not one input domain with unlimited variants.

This purchase provides hosted Actor usage. Source-code ownership, resale rights, custom development, permanent file hosting and a service-level agreement are not included. Apify handles accounts and billing; you do not register on a separate website. Generated files live in the run storage and follow your Apify plan's retention and access rules. Download files you need to keep.

Output

FieldMeaning
statussuccess or failed
id / indexMatch output to input
fileUrl / fileKeyDownload location
contentType / bytes / sha256File type, size and integrity
width / heightImage dimensions; null for PDF
finalUrl / httpStatusWebsite result; null for HTML/template input
truncatedFull page was cropped at maxHeight
durationMs / errorRender timing or failure reason

SUMMARY contains requested, successful, failed, skipped and budgetStopped counts. When the spending limit is reached, remaining inputs are counted as skipped in SUMMARY rather than generating a row for each one. Rendering is sequential to keep budget enforcement predictable. Completed-item progress is saved; restarting a completed run is not a new free entitlement or an exactly-once guarantee across abrupt platform failures.

API and n8n

Use your own Apify token on the server or in an n8n credential. Never embed a private token in a public webpage. No upstream paid API key is required. The API tab supplies account-specific examples.

import axios from 'axios';
const { data: run } = await axios.post(
'https://api.apify.com/v2/acts/chirpy_polygon~html-to-pdf-batch/runs',
{"items":[{"id":"invoice-1001","html":"<html><body><h1>Invoice #1001</h1><p>Total: ₹5,000</p></body></html>"}]},
{ headers: { Authorization: 'Bearer ' + process.env.APIFY_TOKEN },
params: { maxTotalChargeUsd: 1 } }
);
// Poll GET /v2/actor-runs/{run.data.id} until terminal status.
// Then GET /v2/datasets/{run.data.defaultDatasetId}/items.

In n8n, use an HTTP Request node with POST, the same URL, a saved bearer credential and JSON body. Poll the run or use an Apify webhook, then fetch the dataset. Starting a run does not mean its files are ready.

Limits and troubleshooting

Up to 200 documents/run; at most 200,000 characters/document and 2 MB total JSON input; output at most 20 MB/document. JavaScript is disabled, so client-rendered apps may print incomplete content. No OCR, PDF editing, electronic signing, PDF/A guarantee or pixel-parity claim with another PDF provider. Standard margins are 12 mm; use CSS @page to customize. Missing remote images/fonts may be absent from a PDF; embed critical assets as data URLs for deterministic output.

Only public HTTP(S) resources on ports 80/443 are supported. Localhost, private/reserved addresses and private-network redirects/resources are blocked by a DNS-pinned outbound proxy. No login, user cookies, user-supplied request headers or CAPTCHA solving. Use only content you are authorized to process, and follow the target site's terms. Files may contain information from the submitted page; choose appropriate storage access and retention.

If a file link asks for authentication, use the same Apify account or authorized API token; do not append tokens to publicly shared links. For a problem, open an issue with a non-sensitive sample input and run ID. Do not post passwords, tokens or confidential documents.