> ## Documentation Index
> Fetch the complete documentation index at: https://docs.okrapdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Image to PDF

> Create a hosted PDF from a PNG or JPEG.

## Overview

Stores a PNG or JPEG from multipart upload or source URL as a private file asset, then publishes an immutable PDF derivative with preview and download URLs.

<ParamField body="file" type="file">
  PNG or JPEG file when using multipart form data.
</ParamField>

<ParamField body="url" type="string">
  Source image URL when using JSON.
</ParamField>

<ParamField body="namespace" type="string">
  Optional hosted PDF namespace.
</ParamField>

<RequestExample>
  ```bash theme={null}
  curl -X POST https://api.okrapdf.com/v1/conversions/image-to-pdf \
    -H "Authorization: Bearer $OKRA_API_KEY" \
    -F "file=@scan.png" \
    -F "namespace=scan-as-pdf"
  ```
</RequestExample>
