Rasterize PDF API
Send a PDF to POST /v2/convert/pdf/to/rasterize and get a PDF of the same pages, each one now a single picture drawn at Resolution DPI. Nothing on the page can be selected, edited or extracted as text afterwards.
- Endpoint
- POST /v2/
convert/ pdf/ to/ rasterize - Accepts
- Sample timing
- 0.204 s median of 5 runsHow we measure
- Request size
- Up to 10 MB on the Free plan or 100 MB on paid plans, all files together
Request and response
Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.
curl -sS -X POST \
https://api.pdfconversionapi.com/v2/convert/pdf/to/rasterize \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@greenhouse-inspection.pdf \
--form-string Resolution=150 \
-o response.json
# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
mkdir -p converted
name=$(jq -r '.Files[0].FileName' response.json)
jq -r '.Files[0].FileData' response.json \
| base64 --decode > "converted/$name"
else
cat response.json
fiimport base64
import os
import requests
key = os.environ["PDFCONVERSIONAPI_KEY"]
response = requests.post(
"https://api.pdfconversionapi.com/v2/convert/pdf/to/rasterize",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("greenhouse-inspection.pdf", "rb"))],
data={
"Resolution": "150",
},
timeout=180,
)
result = response.json()
if not response.ok:
raise SystemExit(f"{result['Code']}: {result['Message']}")
os.makedirs("converted", exist_ok=True)
for file in result["Files"]:
path = os.path.join("converted", file["FileName"])
with open(path, "wb") as out:
out.write(base64.b64decode(file["FileData"]))
print(path, file["FileSize"], "bytes")
import { mkdir, readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
const form = new FormData();
const file = "greenhouse-inspection.pdf";
form.append("File", new Blob([await readFile(file)]), file);
form.append("Resolution", "150");
const url = "https://api.pdfconversionapi.com/v2/convert/pdf/to/rasterize";
const key = process.env.PDFCONVERSIONAPI_KEY;
const response = await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${key}` },
body: form,
});
const result = await response.json();
if (!response.ok) {
throw new Error(`${result.Code}: ${result.Message}`);
}
await mkdir("converted", { recursive: true });
for (const file of result.Files) {
const path = join("converted", file.FileName);
await writeFile(path, Buffer.from(file.FileData, "base64"));
console.log(path, file.FileSize, "bytes");
}
{
"ConversionCost": 1,
"ConversionTime": 0.204,
"Files": [
{
"FileName": "greenhouse-inspection.pdf",
"FileExt": "pdf",
"FileSize": 642353,
"FileData": "JVBERi0xLjcKJYCAgIAKMSAw…"
}
]
}Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.
The sample and the result
The same file the code sends. Download the input and the output and compare them yourself.

- Input
- greenhouse-inspection.pdf (115 KB)
- Output
- greenhouse-inspection.pdf (627 KB)
- Source
- A three-page greenhouse inspection report for a fictional nursery, with form fields, comments and attached files, made by us for this site. (CC0-1.0). How it was made
- Made by
- 2026-11-04, API build
9eeeb0640aba
Parameters
Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.
| Parameter | What it does |
|---|---|
Resolutioninteger, default 300 | Pixels per inch for each page picture. The sample uses 150: a Letter page becomes a 1,275 x 1,650 image and the 3-page file 642,353 bytes. The default 300 gave 1,184,014 bytes, 600 gave 2,195,420 and 36 gave 82,151. Outside the range, or not a whole number, returns 400.Values: 36 to 600 |
Passwordstring | Opens a PDF that needs a password to open. The image-only result is not encrypted. If the owner also restricted printing, copying or editing, send the owner password. |
FileNamestring | Name of the result without the extension. Left out, the upload's name is kept. |
StoreFileboolean, default false | Return a download link (Url and FileId) instead of the file data, valid for 3 hours. |
What carries over, and what doesn't
Kept
- Each page's size and orientation: 612 x 792, 792 x 612 and 612 x 792 points, as in the input
- What the page showed, including the filled-in form values, the checkmark, the yellow highlight and the note icon
- Page order and count
- Colors as drawn: each page is one RGB picture stored with lossless compression, so there is no JPEG noise around text
Lost or not yet supported
- All text.
/v2/convert/pdf/to/txton the sample result returns an empty file, so search, copy and screen readers no longer work. Run/v2/convert/pdf/to/ocrafterwards if you need searchable text again. - Form fields, comments and links as working objects, plus bookmarks and both attachments.
- Document properties: Title, Author, Subject, Keywords and InspectionID. The new file carries only basic XMP data such as its page count.
- Sharpness when zoomed in: text is only as sharp as
Resolutionallows. - Small size: at the default 300 DPI the sample grew from 117,855 to 1,184,014 bytes.
Limits
- A digitally signed PDF returns 422 "this PDF is digitally signed, and rewriting it would invalidate the signature".
- A PDF that restricts printing, copying or editing returns 422 "this PDF has permission restrictions; send the owner password in Password, or remove them with /v2/convert/pdf/to/unprotect and the owner password". With the owner password the restrictions are removed before the pages are drawn, also for a file that opens without one.
- Every page is rasterized;
PageRangeis not read here. - Up to 2,000 pages, 16,000 pixels per side and 100 million pixels per page picture. Past that the API returns 413: a 30 x 30 in page at
Resolution=600gave "page 1 is too large to draw at 18,000×18,000 pixels; lower Resolution". - One PDF per request, up to 10 MB on the Free plan or 100 MB on paid plans, and up to 120 seconds.
Where teams use it
Make sure hidden content is really gone
Cropped-away margins, white text and covered-up passages still sit in a normal PDF. After rasterizing, each page holds only what was visible: our 1 in crop of the sample came back at the cropped size with no text left to extract.
Freeze a document before it leaves your hands
A signed-off report or a filled form, once rasterized, has no fields to change and no text to copy and paste into a new version. The sample's form values and review marks are part of the page pictures.
Strip links, forms and attachments from a file you pass on
A PDF from outside can carry web links, fillable fields, comments and attached files. The rasterized copy has none of them: the sample came back with no annotations, no form and no attachments, only one picture per page.
Questions
What resolution should I choose?
It trades sharpness for size. For the sample, 36 DPI gave 82,151 bytes, 150 gave 642,353, the default 300 gave 1,184,014 and 600 gave 2,195,420. At 150 the sample's 9.5 pt gray caption is still clear in the page picture; choose 300 or more for small print and fine lines.
Does rasterizing remove text that was hidden or cropped?
Yes. Only what the page showed is drawn into the picture. A PDF cropped with /v2/convert/pdf/to/crop came back at the cropped size, and the text outside the crop was not in the result, since the result has no text at all.
Can I make the rasterized PDF searchable again?
Send it to /v2/convert/pdf/to/ocr, which adds a text layer read from the page pictures. On the rasterized sample, the text came back with a few misreadings, such as "qabled" for "gabled" and "davs" for "days".
Why is the result so much bigger than the original?
Text and vector drawings take little space; a picture of the same page at 300 DPI holds millions of pixels. Lower Resolution, or send the result to /v2/convert/pdf/to/compress.
Convert your first PDF file in a minute.