The PDF operations every back office needs, without shipping Ghostscript and qpdf into your own image. Returns the binary directly, or JSON when you ask for metadata.
Click one to see its parameters and a ready-to-paste curl call.
Repeat the `file` part, or pass `urls` as a comma-separated list. Up to 20 documents per call.
Returns: binary pdf
| Parameter | Type | Description |
|---|---|---|
file |
file |
A PDF. Repeat the part for each document. |
urls |
string |
Comma-separated public URLs instead of uploads. |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/merge" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
--output result.bin
Extract a page selection into a new PDF
Returns: binary pdf
| Parameter | Type | Description |
|---|---|---|
file |
file |
Source PDF. |
pages required |
string |
Selection such as "1,3,5-9". Order is preserved. |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/split" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
-F "pages=1,3,5-9" \
--output result.bin
Runs Ghostscript and returns whichever of the two files is smaller, so a call can never inflate a document.
Returns: binary pdf
| Parameter | Type | Description |
|---|---|---|
file |
file |
Source PDF. |
level |
string |
screen, ebook, printer or prepress, from smallest to sharpest. Default: ebook |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/compress" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
-F "level=ebook" \
--output result.bin
A single page comes back as a binary image; several pages come back as JSON with base64 payloads.
Returns: binary image or json
| Parameter | Type | Description |
|---|---|---|
file |
file |
Source PDF. |
first |
integer |
First page to render, 1-based. Default: 1 |
last |
integer |
Last page to render. At most 50 pages per call. |
dpi |
integer |
Render resolution, 36-400. Default: 150 |
format |
string |
png or jpeg. Default: png |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/to-images" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
-F "first=1" \
-F "dpi=150" \
-F "format=png" \
--output result.bin
Build a PDF from images
Returns: binary pdf
| Parameter | Type | Description |
|---|---|---|
file |
file |
An image. Repeat the part for each page. |
margin |
integer |
White margin in points. Default: 0 |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/from-images" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
-F "margin=0" \
--output result.bin
Also returns `scannedLikely`, which tells you when to fall back to the OCR API.
Returns: json
| Parameter | Type | Description |
|---|---|---|
file |
file |
Source PDF. |
layout |
boolean |
Keep the visual column layout. Default: false |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/extract-text" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
-F "layout=false"
Read page count, size, author and encryption state
Returns: json
| Parameter | Type | Description |
|---|---|---|
file |
file |
Source PDF. |
url |
string |
Public URL instead of an upload. |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/info" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf"
Encrypt a PDF with a password (AES-256)
Returns: binary pdf
| Parameter | Type | Description |
|---|---|---|
file |
file |
Source PDF. |
password required |
string |
User password, 4 characters or more. |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/protect" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
-F "password=s3cret-pass" \
--output result.bin
Remove the password from a PDF you own
Returns: binary pdf
| Parameter | Type | Description |
|---|---|---|
file |
file |
Encrypted PDF. |
password |
string |
Current password. |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/unlock" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
--output result.bin
Draw a diagonal text watermark on every page
Returns: binary pdf
| Parameter | Type | Description |
|---|---|---|
file |
file |
Source PDF. |
text required |
string |
Caption to draw. |
opacity |
number |
Fill opacity, 0.02-1. Default: 0.18 |
angle |
integer |
Rotation in degrees, -90 to 90. Default: 45 |
curl -X POST "https://173-249-18-142.sslip.io/v1/pdf/watermark" \
-H "X-API-Key: $SMALLAPIS_KEY" \
-F "file=@input.pdf" \
-F "text=CONFIDENTIAL" \
-F "opacity=0.18" \
-F "angle=45" \
--output result.bin