ODF to WebP API
POST /v2/convert/odf/to/webp renders the print page of an OpenDocument formula file as a lossless WebP. Sent with ImageWidth=800, our loan formula comes back 800 × 1,131 pixels and 30,324 bytes; at the full 150 DPI it is 1,240 × 1,753 and 47,942 bytes.
- Endpoint
- POST /v2/
convert/ odf/ to/ webp - Accepts
- odf
- Sample timing
- 0.551 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/odf/to/webp \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@loan-payment-formula.odf \
--form-string ImageWidth=800 \
-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/odf/to/webp",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("loan-payment-formula.odf", "rb"))],
data={
"ImageWidth": "800",
},
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 = "loan-payment-formula.odf";
form.append("File", new Blob([await readFile(file)]), file);
form.append("ImageWidth", "800");
const url = "https://api.pdfconversionapi.com/v2/convert/odf/to/webp";
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.551,
"Files": [
{
"FileName": "loan-payment-formula-1.webp",
"FileExt": "webp",
"FileSize": 30324,
"FileData": "UklGRmx2AABXRUJQVlA4TF92…"
}
]
}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
- loan-payment-formula.odf (1.8 KB)
- Output
- loan-payment-formula-1.webp (30 KB)
- Source
- Two loan payment formulas with their variables, which we wrote as an OpenDocument formula by hand (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 |
|---|---|
ImageWidthinteger | Width in pixels; 800 gives 800 × 1,131 for the A4 page.Values: 1–20000 |
ImageHeightinteger | Height in pixels, alone or as a box with ImageWidth.Values: 1–20000 |
ImageResolutioninteger, default 150 | Pixel density of the A4 page. WebP keeps no DPI field, so only the size changes.Values: 36–600 |
ScaleProportionsboolean, default true | false stretches the page to the box. |
ScaleImageboolean, default true | false crops the box from the top-left corner instead. |
ScaleIfLargerboolean, default false | true keeps the page from being enlarged. |
BackgroundColorstring, default white | Page color behind the formula; #e8f5e9 at 800 wide gave a pale green page of 55,088 bytes.Values: color name, #RRGGBB or R,G,B |
TransparentColorstring | One exact color to clear: white at 800 wide cleared 862,212 of 904,800 pixels for a 34,540-byte file.Values: color name, #RRGGBB or R,G,B |
ColorSpaceenum, default default | monochrome leaves only black and white pixels (7,012 bytes at 800 wide). gray changes nothing here, since the page is already neutral gray: the same 30,324 bytes. WebP has no gray mode, so the file stays an RGB image either way.Values: default, rgb, gray, monochrome |
FileNamestring | Stem of the file name, followed by -1.webp. |
StoreFileboolean, default false | Store the WebP and return a 3-hour link. |
Not supported yet
Setting one of these to anything but its default returns 400.
| Option | What to do instead |
|---|---|
PageSize | 400 "PageSize is not supported yet for ODF files". |
What carries over, and what doesn't
Kept
- Every pixel of the rendered page, since the WebP is lossless
- The formula, title row and source text in their frames, at the width you ask for
- No alpha channel unless
TransparentColoris set, which adds one
Lost or not yet supported
- Quality settings:
ImageQuality=20changed nothing, the file stayed 30,324 bytes. - DPI metadata, which WebP has no field for.
- Your file name in the title row: it reads "input".
Limits
- Options this pair doesn't use, such as
ImageQuality, are ignored rather than refused. - One image per formula file, up to 100,000,000 pixels and 16,000 pixels per side.
- Protected formula files return 422 "the input file is password-protected" when sent without
Passwordand 400 "password-protected ODF files are not supported yet" when sent with it. On an unprotected file the option is ignored: 47,942 bytes either way. - Up to 10 MB on the Free plan or 100 MB on paid plans per request and 120 seconds per conversion.
Where teams use it
Light previews of formula files
A course site or file browser can show a formula file's page as an 800-pixel WebP of about 30 KB, without a formula editor on the viewer's side.
Formula pages over a page design
TransparentColor=white leaves the frames, the title, the formula and its source text, with 95% of the 800-wide image clear, ready to place on a colored layout.
Questions
Why is the WebP so much smaller than the PNG?
The page is mostly white with black lines, which lossless WebP packs tightly: 47,942 bytes at 150 DPI, against 168,178 for the PNG of the same page.
Does `ImageQuality` make it lossy?
No. The route always writes lossless WebP and ignores ImageQuality; make the file smaller with ImageWidth or ImageResolution.
Can I color the page?
Yes: BackgroundColor fills the whole page, frames included, because formula pages have no background of their own.
Convert your first ODF file in a minute.