apyhub
FILE CONVERSION

Convert HTML Content to PDF API

What it does

HTML to PDF renders an HTML content string into a PDF, either as a direct download or as a signed link you can fetch later. Send the HTML in body.content, and choose whether the output should be landscape with the landscape query parameter.

Use POST /download when you want a PDF binary response immediately. Use POST /link when you want a URI in the data field instead. That makes it easy to separate generation from delivery in workflows where you store, queue, or pass around the file later.

This is a good fit for generating invoices, reports, receipts, or any page-like document from server-side HTML. Because the input is raw HTML, you can render your own templates and control layout before converting them to PDF.

The service keeps the interface simple: one required HTML payload, one optional layout flag, and two output modes depending on whether you need the file now or a signed link.

▣ ENDPOINT 01 / 02
POST
Render HTML content string to PDF download (PDF-06)
https://api.eu.apyverse.com/apyhub/convert-html-content-to-pdf/download

QUICKSTART

GUIDE

Quickstart

Convert a snippet of HTML into a PDF file.

curl -X POST "https://api.eu.apyverse.com/apyhub/convert-html-content-to-pdf/download?output=output.pdf" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"<html><body><h1>Hello</h1></body></html>"}'

What you'll get back

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

%PDF-...
TRY ITLIVE · 50 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*

About this endpoint

What it does

Converts the provided HTML content string into a PDF and returns the PDF as a binary response. You can optionally set the output filename and whether the PDF is rendered in landscape orientation.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput filename for the generated PDF.
landscapeBooleanNoRender the PDF in landscape orientation. Default: false.

Request Body

ParameterTypeMandatoryDescription
contentStringYesHTML content to convert to PDF.

Response

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

Notes

The request body is unwrapped before forwarding, so send content directly in the JSON body rather than nesting it under a body field.

Query parameters

Name
Type
Description
outputOPTIONAL
string
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
POST
Render HTML content string to PDF signed link (PDF-06)
https://api.eu.apyverse.com/apyhub/convert-html-content-to-pdf/link

QUICKSTART

GUIDE

Quickstart

Convert a snippet of HTML into a PDF, using the required HTML content in the JSON body.

curl -X POST "https://api.eu.apyverse.com/apyhub/convert-html-content-to-pdf/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"<html><body><h1>Hello</h1></body></html>"}'

What you'll get back

Returns a JSON object with a data string field containing a URI for the generated PDF.

{
  "data": "https://example.com/file.pdf"
}
TRY ITLIVE · 50 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*

About this endpoint

What it does

Renders the provided HTML content string into a PDF and returns a signed link to the generated file. The request sends the HTML in the body and can optionally request landscape orientation via a query parameter.

Query Parameter(s)

AttributeTypeMandatoryDescription
landscapeBooleanNoWhen true, renders the PDF in landscape orientation. Default: false.

Request Body

ParameterTypeMandatoryDescription
contentStringYesHTML content to render into a PDF document.

Response

Returns a JSON object with a data string field containing a URI to the generated PDF signed link.

ParameterTypeMandatoryDescription
dataStringYesSigned link to the generated PDF file.

Query parameters

Name
Type
Description
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object
▣ 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.