Skip to content
Browse all functions

HTML to PDF – Create PDF from HTML or URL

files/html2pdf

Creates a PDF from HTML or from a web page (URL) with Chromium, like printing in the browser: CSS, web fonts and images included. Paper format, orientation, margins and backgrounds can be set.

Endpoint

POSThttps://api.1001fx.com/files/html2pdf
Header
X-API-KEY: YOURSECRETAPIKEY How to
Content type
application/json (no body)

Parameters

This function has no parameters.

Examples

HTML to PDF – Create PDF from HTML or URL

HTML to PDF – Create PDF from HTML or URL

Input

Expects a json body
{
  "html": "<h1 style=\"font-family:sans-serif\">Offer 2026-117</h1><p>Thank you for your request.</p>",
  "format": "A4"
}

Output · HTTP 200

Response
{
  "statusCode": 200
}
Show curl command
curl -X POST 'https://api.1001fx.com/files/html2pdf' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"html":"<h1 style=\"font-family:sans-serif\">Offer 2026-117</h1><p>Thank you for your request.</p>","format":"A4"}'

Try html2pdf now

Run it in your browser or create a free account and get 100 credits every month.

Changelog

  • 1.0.001.11.2026created