ODT to PNG API
Send an .odt file to POST /v2/convert/odt/to/png and get one lossless PNG per page. Our document engine lays the pages out, then each page is drawn at the resolution you ask for, 150 DPI unless you say otherwise.
- Endpoint
- POST /v2/
convert/ odt/ to/ png - Accepts
- odt
- Sample timing
- 46 ms 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/odt/to/png \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@garden-plot-guide.odt \
--form-string ImageResolution=100 \
-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/odt/to/png",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("garden-plot-guide.odt", "rb"))],
data={
"ImageResolution": "100",
},
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 = "garden-plot-guide.odt";
form.append("File", new Blob([await readFile(file)]), file);
form.append("ImageResolution", "100");
const url = "https://api.pdfconversionapi.com/v2/convert/odt/to/png";
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.046,
"Files": [
{
"FileName": "garden-plot-guide-1.png",
"FileExt": "png",
"FileSize": 193076,
"FileData": "iVBORw0KGgoAAAANSUhEUgAA…"
},
{
"FileName": "garden-plot-guide-2.png",
"FileExt": "png",
"FileSize": 177686,
"FileData": "iVBORw0KGgoAAAANSUhEUgAA…"
}
]
}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, converted
The same file the code sends. Download the input and the output and compare them yourself.

- Input
- garden-plot-guide.odt (35 KB)
- Output
- garden-plot-guide-1.png (189 KB)garden-plot-guide-2.png (174 KB)
- Source
- A two-page plot holder guide for a fictional community garden, with a fee table, a plot map, lists, a footnote and a page-numbered footer. We wrote it for these pages as an OpenDocument text file. (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 |
|---|---|
ImageResolutioninteger, default 150 | Pixels per inch of paper. The sample sends 100, which makes each Letter page 850 × 1,100 pixels (193,076 and 177,686 bytes); at the default 150 they are 1,275 × 1,650. A value you send is also stored in the PNG's pHYs chunk, so layout programs know the print size.Values: 36–600 |
PageRangestring | Which pages to draw, for example 2, 1-2 or 2-last. Files keep their page number, so PageRange=2 returns only garden-plot-guide-2.png. Asking the 2-page sample for page 3 returns 400 "PageRange asks for page 3, but the document has 2 pages". |
ImageWidthinteger | Target width in pixels; the height follows the page's shape. ImageWidth=600 returns 600 × 776 pages, and PageRange=1&ImageWidth=200 a 23,023-byte thumbnail of 200 × 259.Values: 1–20000 |
ImageHeightinteger | Target height in pixels. Sent with ImageWidth, the page is fitted inside that box: 600 by 600 gives 464 × 600.Values: 1–20000 |
ScaleProportionsboolean, default true | With false and both sizes set, the page is stretched to exactly that box (600 × 600 in our test) instead of keeping its shape. |
TransparentColorstring | Pixels of exactly this color become transparent. white cleared 92.1% of page 1 at 72 DPI. Smoothed letter edges are not pure white, so they stay opaque and show as a pale fringe on dark backgrounds.Values: white, black, red, green, blue, gray, #RRGGBB or R,G,B |
BackgroundColorstring | Color laid down before the page is drawn. The ODT page paints no background of its own, so in our test #FFF8E7 filled the margins and every empty area of page 1.Values: Same as TransparentColor |
ColorSpaceenum, default default | gray writes 8-bit grayscale PNGs (71,254 and 65,608 bytes for the sample at 100 DPI, against 193,076 and 177,686 in color); monochrome writes pure black and white; rgb returns the same 3-channel PNGs as the default. cmyk returns 400.Values: default, rgb, gray, monochrome |
IncludeMarkupboolean, default false | Draw tracked changes onto the pages, with deletions struck through and insertions underlined in color. ODT comments are not drawn. |
FileNamestring | Stem for the page files: FileName=plots gives plots-1.png and plots-2.png. |
StoreFileboolean, default false | Return one download link per page, valid for 3 hours, instead of the image data. |
What carries over, and what doesn't
Kept
- The page layout of
/v2/convert/odt/to/pdf: 2 Letter pages, with the plot map starting page 2 - The header line and the footer on every page, drawn in their own smaller type
- The green table header, the red warning and the yellow highlight, in full color
- Every pixel as rendered, with no compression artifacts around small type
- Opaque pages as 3-channel RGB with no alpha channel;
TransparentColoradds one for the color you name
Lost or not yet supported
- Correct page numbers: page 1 of the sample is drawn with the footer "page 2 of 2", the value stored in the file.
- The footnote and its mark, which this route leaves out (only ODT to XML keeps footnotes).
- The look of the file's heading styles: the title is drawn 28 pt regular black and headings dark blue (#0F4761) in Carlito, instead of bold green.
- The table's own column widths (all four come out equal) and the centering of the map, which is drawn at the left margin.
- Selectable text. For searchable pages use the PDF route.
- A print size, unless you send
ImageResolution: without it the PNG has no pHYs chunk.
Limits
- At most 2,000 pages per request; more returns 413. Work through longer documents with
PageRange. - Each page may be at most 16,000 pixels on a side and 100 million pixels in all.
ImageWidth=17000on a Letter page returns 413 "page 1 is too large to draw at 17,000×22,000 pixels; lower ImageWidth or ImageHeight". - A password-protected ODT returns 422 without
Passwordand 400 "password-protected ODT files can't be converted to PNG yet" with it. - Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together, and 120 seconds per conversion, after which the API returns 504.
Where teams use it
Page previews for uploaded documents
Show the first page of each uploaded .odt in a file list or a chat thread, where an office file can't be displayed. PageRange=1 with ImageWidth=200 returns a 23,023-byte thumbnail of the sample.
Visual regression tests for generated ODT files
If your code fills ODT templates, render the pages in your test suite and compare them with approved images. PNG is lossless, so the same input gives the same pixels, and a table that grows onto a new page shows up as a changed image.
Questions
Which ImageResolution should I pick?
Around 36 to 72 for thumbnails (612 × 792 at 72), 100 to 150 for reading on screen, and 200 or more if the image will be zoomed or sent to OCR. Values below 36 or above 600 return 400 "ImageResolution must be between 36 and 600". If you need an exact pixel width, use ImageWidth instead.
Why does the first page say page 2 of 2?
The page-number field in the ODT footer is drawn with the text the file stored, which the editor sets to the last page it laid out. UpdateFields does not refresh it for ODT input. Leave the number out of the footer, or cover it, if the images are shown to readers.
Can I get the page as a transparent PNG?
Set TransparentColor=white. Pure white pixels, including the page background, become transparent; anti-aliased text edges keep a little white. For a solid tint instead, use BackgroundColor, which shows through every area the page leaves empty.
How do I get only the first page?
Send PageRange=1. The response then holds a single file, garden-plot-guide-1.png for the sample. PageRange also accepts lists and open ranges such as 1,2 or 2-last.
Convert your first ODT file in a minute.