apyhub
FILE CONVERSION

Convert Images to PDF API

Hosted on ApyHub

What it does

Image to PDF converts image files, base64-encoded image bytes, or remote image URLs into PDF output. Send an image and get back either a downloadable PDF binary or a signed PDF link, depending on the endpoint you choose.

Use Image to PDF when you need to turn screenshots, scanned pages, product photos, or generated assets into a portable document format. The service accepts uploaded files, a base64 string, or a url to a remote image. For file- and URL-based conversions, you can also set landscape to control page orientation. The download endpoints return a PDF as binary data, while the link endpoints return a data field containing a URI.

This is useful for document workflows that assemble image-based reports, archive receipts, or package visual assets for sharing and storage. If your app already stores images in object storage or receives them from a client upload, you can convert them to PDF without adding your own rendering pipeline.

Image to PDF supports common image formats including PNG, JPEG, GIF, SVG, TIFF, and BMP on the upload path.

▣ ENDPOINT 01 / 06
POST
Convert base64-encoded image to PDF signed link
http://localhost:8080/apyhub/convert-image-to-pdf/base64/link
QUICKSTARTGUIDE

Quickstart

Convert a base64-encoded image into a PDF link with one JSON request.

curl -X POST "http://localhost:8080/apyhub/convert-image-to-pdf/base64/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"base64":"iVBORw0KGgoAAAANSUhEUgAA..."}'

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/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 image into a PDF and returns a signed link to the generated PDF. The request sends the base64 content, and the response returns the resulting PDF URL in a JSON object.

Request Body

ParameterTypeMandatoryDescription
base64StringYesBase64-encoded file bytes.

Response

Returns a JSON object with a data string field formatted as a URI — this is the signed link to the generated PDF.

ParameterTypeMandatoryDescription
dataStringYesSigned PDF link as a URI.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 06
POST
Convert image upload to PDF download
http://localhost:8080/apyhub/convert-image-to-pdf/file/download
QUICKSTARTGUIDE

Quickstart

Upload an image and download the generated PDF. The output and landscape options are sent as query parameters.

curl -X POST "http://localhost:8080/apyhub/convert-image-to-pdf/file/download?output=output.pdf" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.png"

What you'll get back

Returns the PDF file itself as a binary response.

<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*
.png, .jpeg, .jpg, .gif, .svg, .tif, or .bmp

About this endpoint

What it does

Converts an uploaded image file into a PDF and returns the resulting PDF as a binary download.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput filename for the generated PDF. Example: output.pdf.
landscapeBooleanNoWhen true, generates the PDF in landscape orientation. Default: false.

Request Body

ParameterTypeMandatoryDescription
fileStringYesBinary image file to convert. Supported formats: .png, .jpeg, .jpg, .gif, .svg, .tif, .bmp.

Response

Returns a binary file containing the generated PDF. The success response is a single binary payload, not a JSON object.

ParameterTypeMandatoryDescription
binaryStringYesPDF file content returned as binary download.

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 04 / 06
POST
Convert remote image URL to PDF download
http://localhost:8080/apyhub/convert-image-to-pdf/url/download
QUICKSTARTGUIDE

Quickstart

Convert an image from a public URL into a PDF. The url goes in the JSON body, and landscape is an optional query parameter.

curl -X POST "http://localhost:8080/apyhub/convert-image-to-pdf/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.png"}'

What you'll get back

Returns a binary file stream containing the generated PDF. There is no JSON wrapper in the response.

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 image referenced by a URL into a PDF and returns the PDF as a binary download. The request accepts the image URL in the body, with an optional landscape query parameter to control page orientation.

Query Parameter(s)

AttributeTypeMandatoryDescription
landscapeBooleanNoOptional page orientation flag. Default: false.

Request Body

ParameterTypeMandatoryDescription
urlStringYesRemote image URL to convert. Must be a URI.

Response

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

AttributeTypeMandatoryDescription
(binary)StringYesPDF file content returned as binary data.

Query parameters

Name
Type
Description
landscapeOPTIONAL
boolean
DEFAULT false

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 05 / 06
POST
Convert remote image URL to PDF signed link
http://localhost:8080/apyhub/convert-image-to-pdf/url/link
QUICKSTARTGUIDE

Quickstart

Convert an image from a URL into a PDF by sending the image link in the request body.

curl -X POST "http://localhost:8080/apyhub/convert-image-to-pdf/url/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.png"}'

What you'll get back

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

{
  "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 image accessible by URL into a PDF and returns a signed PDF link. You send the image URL in the request body and receive a JSON object containing the generated PDF URL.

Request Body

ParameterTypeMandatoryDescription
urlStringYesThe remote image URL to convert. Must be a URI.

Response

Returns a JSON object with a data string field formatted as a URI. This field contains the signed PDF link generated from the source image.

ParameterTypeMandatoryDescription
dataStringYesSigned PDF URL returned by the conversion process. Must be a URI.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 06 / 06
POST
Convert base64-encoded image to PDF download
http://localhost:8080/apyhub/convert-image-to-pdf/base64/download
QUICKSTARTGUIDE

Quickstart

Convert a Base64-encoded file into a PDF. This example sends the required base64 value and uses the default download flow.

curl -X POST "http://localhost:8080/apyhub/convert-image-to-pdf/base64/download?landscape=false" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"base64":"JVBERi0xLjQKJ..." }'

What you'll get back

Returns a binary file response (string with format: binary), so the successful response is the generated PDF file itself.

%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 image into a PDF and returns the PDF as a binary download. The request body must include the base64 content, and you can optionally request landscape orientation via a query parameter.

Query Parameter(s)

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

Request Body

ParameterTypeMandatoryDescription
base64StringYesBase64-encoded file bytes.

Response

Returns a binary response containing the generated PDF file. The output schema is a binary string, so the successful response is the PDF download itself.

ParameterTypeMandatoryDescription
binaryStringYesPDF file content returned as binary data.

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.