apyhub
Back
▣ FILE CONVERSION · FILE MANIPULATION

Convert URL/HTML to PDF API

What it does

HTML to PDF Render turns a public URL or raw HTML into a PDF binary, with optional PDF merging in the same request. Send either url or html, choose a page_size of A4, Letter, or Legal, and include merge_urls when you want to append existing PDFs after the rendered output.

Use it when you need server-side document generation from web content: invoices, reports, receipts, archived pages, or print-ready snapshots of dynamic HTML. The response is a binary PDF, so you can stream it, store it, or pass it into your own file pipeline without parsing intermediate data.

Because the input is plain HTML or a reachable URL, it fits workflows that already render content in the browser or template layer but need a stable PDF artifact for download, email, or recordkeeping. The merge step is useful when a generated cover page or statement should be combined with supporting PDFs before delivery.

HTML to PDF Render keeps the contract simple: one request body, predictable page sizing, and a PDF result.

POST
Render HTML or URL content to PDF and optionally merge PDFs
https://api.eu.apyhub.com/dosvak/html-to-pdf-render

QUICKSTART

GUIDE

Quickstart

Render a public URL or raw HTML to a PDF with the simplest required JSON body.

curl -X POST "https://api.eu.apyhub.com/dosvak/html-to-pdf-render" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'

What you'll get back

Returns a binary file response (string with format: "binary"), which is the generated PDF.

PDF binary data
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Public URL to render to PDF
Raw HTML content to render

About this endpoint

What it does

Renders either a public URL or raw HTML into a PDF. You can also supply additional PDF source URLs to merge after the render step.

Request Body

ParameterTypeDescription
urlStringPublic URL to render to PDF.
htmlStringRaw HTML content to render.
page_sizeENUMAllowed values: A4, Letter, Legal.
Default: A4.
merge_urlsString ArrayOptional list of source PDF URLs to merge after rendering.

Response

Returns a binary file response containing the generated PDF. The output schema is a single string with binary format, so the success payload is the PDF content itself rather than a JSON object.

ParameterTypeDescription
response bodyStringBinary PDF content returned by the endpoint.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.