apyhub
FILE CONVERSION

Convert HTML to PDF API

What it does

HTML to PDF Converter turns HTML sources into PDF output. Send a base64-encoded HTML payload, a file upload, or a remote HTML URL, and get back either a downloadable PDF binary or a signed PDF link.

Use the /base64/link, /file/link, and /url/link endpoints when you want a URI you can hand off to another system or store for later retrieval. Use the /base64/download, /file/download, and /url/download endpoints when your application needs the PDF bytes directly. The file and URL variants also support a landscape query parameter, and the file download endpoint lets you set an output filename.

This is a practical fit for generating invoices, reports, receipts, and archived web pages from HTML you already render in your application. If your template engine or CMS already produces HTML, you can convert that content into a PDF without adding a browser-based rendering flow on your side.

▣ ENDPOINT 01 / 06
POST
Convert base64-encoded HTML file to PDF signed link (PDF-05)
https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/base64/link

QUICKSTART

GUIDE

Quickstart

Send a Base64-encoded file payload to generate a PDF link.

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

What you'll get back

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

{
  "data": "https://example.com/output.pdf"
}
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*
Base64-encoded file bytes.

About this endpoint

What it does

Converts a base64-encoded HTML file into a PDF and returns a signed link to the generated file. The request sends the encoded file bytes in the body, and the response returns the resulting PDF link as a JSON string.

Request Body

ParameterTypeMandatoryDescription
base64StringYesBase64-encoded file bytes.

Response

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

ParameterTypeMandatoryDescription
dataStringYesURI of the generated PDF link.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 06
POST
Convert HTML file upload to PDF download (PDF-05)
https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/file/download

QUICKSTART

GUIDE

Quickstart

Upload an HTML file to generate a PDF download. The example below sends a local file named index.html and saves the response as output.pdf.

curl -X POST "https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/file/download?output=output.pdf" \
  -H "apy-token: $APY_TOKEN" \
  -F "[email protected]"

What you'll get back

Returns the PDF as a binary file response (string with format: binary), not a JSON object.

<binary PDF 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.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
.html

About this endpoint

What it does

Converts an uploaded HTML file into a PDF and returns the generated PDF as a binary response.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput filename for the generated PDF.
landscapeBooleanNoWhether to render the PDF in landscape orientation. Default: false.

Request Body

ParameterTypeMandatoryDescription
fileStringYesHTML file to convert. Binary upload; .html file format.

Response

Returns a binary file response containing the generated PDF.

ParameterTypeMandatoryDescription
binaryStringYesThe PDF file content returned as binary data.

Query parameters

Name
Type
Description
outputOPTIONAL
string
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 03 / 06
POST
Convert HTML file upload to PDF signed link (PDF-05)
https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/file/link

QUICKSTART

GUIDE

Quickstart

Upload a local HTML file to convert it to PDF.

curl -X POST "https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/file/link" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.html"

What you'll get back

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

{
  "data": "https://example.com/generated-file.pdf"
}
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.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Converts an uploaded HTML file into a PDF and returns a signed PDF link. The request sends the file in the body, and the response returns a JSON object containing the resulting URL.

Query Parameter(s)

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

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe HTML file to convert. Binary upload.

Response

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

ParameterTypeMandatoryDescription
dataStringYesA URI pointing to the signed PDF link.

Query parameters

Name
Type
Description
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 04 / 06
POST
Convert remote HTML file URL to PDF download (PDF-05)
https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/url/download

QUICKSTART

GUIDE

Quickstart

Convert a webpage URL to PDF with the default layout.

curl -X POST "https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.html"}'

What you'll get back

Returns a binary PDF file as the response body.

%PDF-...
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*

About this endpoint

What it does

Converts the HTML file available at the provided remote URL into a PDF and returns the generated PDF as a binary response. The request accepts the source URL in the body and an optional landscape query parameter to control page orientation.

Query Parameter(s)

AttributeTypeMandatoryDescription
landscapeBooleanNoOptional page orientation flag.<br>Defaults to false.

Request Body

ParameterTypeMandatoryDescription
urlStringYesRemote HTML file URL to convert. Must be a valid URI.

Response

Returns a binary PDF file in the success response. The output schema is a binary string, so the response body is the generated PDF content rather than a JSON object.

Query parameters

Name
Type
Description
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 05 / 06
POST
Convert remote HTML file URL to PDF signed link (PDF-05)
https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/url/link

QUICKSTART

GUIDE

Quickstart

Convert a webpage URL to a PDF by sending the page link in the request body.

curl -X POST "https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/url/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.html"}'

What you'll get back

Returns a JSON object with a data string field containing the PDF file URL.

{
  "data": "https://..."
}
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*

About this endpoint

What it does

Converts a remote HTML file accessible by URL into a PDF and returns a signed link to the generated PDF. The request accepts the source HTML URL and the response contains a PDF URL.

Request Body

ParameterTypeMandatoryDescription
urlStringYesThe remote HTML file URL to convert. Must be a valid URI.

Response

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

ParameterTypeMandatoryDescription
dataStringYesSigned link to the generated PDF file as a URI.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 06 / 06
POST
Convert base64-encoded HTML file to PDF download (PDF-05)
https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/base64/download

QUICKSTART

GUIDE

Quickstart

Convert Base64-encoded HTML to a PDF and download the result.

curl -X POST "https://api.eu.apyverse.com/apyhub/convert-html-to-pdf/base64/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"base64":"PGh0bWw+PGJvZHk+SGVsbG8gV29ybGQ8L2JvZHk+PC9odG1sPg=="}'

What you'll get back

Returns a binary file (format: binary) containing the generated PDF.

%PDF-1.4
...
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*
Base64-encoded file bytes.

About this endpoint

What it does

Converts a base64-encoded HTML file into a PDF and returns the PDF as a binary download. The request body supplies the base64 file bytes, and an optional query parameter controls whether the PDF is generated in landscape orientation.

Query Parameter(s)

AttributeTypeMandatoryDescription
landscapeBooleanNoGenerate the PDF in landscape mode. Default: false.

Request Body

ParameterTypeMandatoryDescription
base64StringYesBase64-encoded file bytes.

Response

Returns a binary file download containing the generated PDF. The response is a binary stream, not a JSON object.

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.