Skip to content
pdfconversionapi

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
fi
200 OK0.551 s median1 file, 30 KB
{
  "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.

First page of loan-payment-formula-1.webp, rendered by the API
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.

ParameterWhat it does
ImageWidthintegerWidth in pixels; 800 gives 800 × 1,131 for the A4 page.Values: 1–20000
ImageHeightintegerHeight in pixels, alone or as a box with ImageWidth.Values: 1–20000
ImageResolutioninteger, default 150Pixel density of the A4 page. WebP keeps no DPI field, so only the size changes.Values: 36–600
ScaleProportionsboolean, default truefalse stretches the page to the box.
ScaleImageboolean, default truefalse crops the box from the top-left corner instead.
ScaleIfLargerboolean, default falsetrue keeps the page from being enlarged.
BackgroundColorstring, default whitePage 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
TransparentColorstringOne 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 defaultmonochrome 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
FileNamestringStem of the file name, followed by -1.webp.
StoreFileboolean, default falseStore the WebP and return a 3-hour link.

Not supported yet

Setting one of these to anything but its default returns 400.

OptionWhat to do instead
PageSize400 "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 TransparentColor is set, which adds one

Lost or not yet supported

  • Quality settings: ImageQuality=20 changed 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 Password and 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.