apyhub
Back
FILE CONVERSION

Convert Images to PDF API

Hosted on ApyHub

What it does

The Image to PDF API turns images into PDF documents. Send a JPG, PNG, GIF, SVG, TIFF, or BMP file as an upload (up to 100 MB), as a URL, or as a base64 string, and get the PDF back either as the file itself or as a signed link you can store or share. Set landscape to true for wide images such as screenshots or charts.

Use it to save receipts and scanned pages as PDFs, turn screenshots and product photos into shareable documents, or add image-based pages to reports without building your own rendering setup. Need the opposite? The PDF to Image API turns PDF pages back into images. For web pages and documents, use the HTML to PDF or Word to PDF APIs.

Pick the endpoint that fits where your image is: upload endpoints when the file is in your app, URL endpoints when it's hosted elsewhere, and base64 endpoints when the image is already encoded in your data. You can start on ApyHub's free tier with no card required.

▣ ENDPOINT 01 / 06
POST
Convert base64-encoded image to PDF signed link
https://api.eu.apyhub.com/apyhub/convert-image-to-pdf/base64/link

QUICKSTART

GUIDE

Quickstart

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

curl -X POST "https://api.eu.apyhub.com/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
https://api.eu.apyhub.com/apyhub/convert-image-to-pdf/file/download

QUICKSTART

GUIDE

Quickstart

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

curl -X POST "https://api.eu.apyhub.com/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
https://api.eu.apyhub.com/apyhub/convert-image-to-pdf/url/download

QUICKSTART

GUIDE

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 "https://api.eu.apyhub.com/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
https://api.eu.apyhub.com/apyhub/convert-image-to-pdf/url/link

QUICKSTART

GUIDE

Quickstart

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

curl -X POST "https://api.eu.apyhub.com/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
https://api.eu.apyhub.com/apyhub/convert-image-to-pdf/base64/download

QUICKSTART

GUIDE

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 "https://api.eu.apyhub.com/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.