HTML

Render HTML to PDF

Render an HTML document to PDF format.

Uses a headless browser to render the HTML with:

  • CSS styling
  • Images
  • JavaScript execution (optional)

Options

  • page_size: Paper size (A4, Letter, etc.)
  • landscape: Landscape orientation
  • print_background: Include background colors/images
post/html/to-pdf

Request

  • Base URL: https://api.filegraph.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.filegraph.ai/html/to-pdf
  • Auth: API key in header X-API-Key

Query parameters

page_sizestring
landscapeboolean
print_backgroundboolean

Response

Successful Response

filenamestring required

Output filename

content_typestring required

MIME type of the file

size_bytesinteger required

File size in bytes

content_base64string required

Base64-encoded file content

Example response

{
  "content_base64": "JVBERi0xLjQK...",
  "content_type": "application/pdf",
  "filename": "output.pdf",
  "size_bytes": 102400
}

Changes

No recorded changes to this operation across all 1 revision of this API.