Skip to content
pdfconversionapi

ODC to WebP API

POST /v2/convert/odc/to/webp renders a standalone OpenDocument chart as one lossless WebP image. At the default 150 DPI the sample chart comes back 1,062 × 590 pixels and 62,330 bytes; the PNG of the same pixels is 95,821 bytes.

Endpoint
POST /v2/convert/odc/to/webp
Accepts
odc
Sample timing
0.515 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/odc/to/webp \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@garden-water-use.odc \
  -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.515 s median1 file, 61 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.515,
  "Files": [
    {
      "FileName": "garden-water-use-1.webp",
      "FileExt": "webp",
      "FileSize": 62330,
      "FileData": "UklGRnLzAABXRUJQVlA4TGbz…"
    }
  ]
}

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 garden-water-use-1.webp, rendered by the API
Input
garden-water-use.odc (2.7 KB)
Output
garden-water-use-1.webp (61 KB)
Source
A line chart of a fictional community garden's daily water use, 2025 against 2026, which we wrote as an OpenDocument chart 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
ImageResolutioninteger, default 150Pixels per inch of chart. WebP stores no DPI, so this sets the size only: 96 gave 680 × 377 and 37,198 bytes.Values: 36–600
ImageWidthintegerWidth in pixels: 800 gave 800 × 444 and 45,032 bytes.Values: 1–20000
ImageHeightintegerHeight in pixels; the width follows the 18:10 chart.Values: 1–20000
ScaleProportionsboolean, default truefalse stretches the chart to an exact ImageWidth × ImageHeight.
ScaleImageboolean, default truefalse crops the requested size from the top-left corner of the 150 DPI chart.
ScaleIfLargerboolean, default falsetrue keeps a chart that already fits from being enlarged.
TransparentColorstringClears one exact color. white cleared 345,220 of 626,580 pixels, the chart's white background, for a 66,368-byte file.Values: color name, #RRGGBB or R,G,B
ColorSpaceenum, default defaultgray (30,188 bytes) or monochrome (5,772 bytes) change the colors; WebP has no gray mode, so the file is still an RGB image.Values: default, rgb, gray, monochrome
FileNamestringStem of the file name, followed by -1.webp.
StoreFileboolean, default falseReturn a link to the stored WebP, valid for 3 hours.

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 ODC files".

What carries over, and what doesn't

Kept

  • Every pixel of the rendered chart: the WebP is lossless, so thin lines and small labels look the same as in PNG
  • The chart's 18:10 shape and its own edges, with no page around it
  • No alpha channel unless TransparentColor is used, which adds one

Lost or not yet supported

  • A quality knob: ImageQuality=30 returned the same 62,330 bytes, because the output is always lossless.
  • DPI metadata, which WebP has no field for.
  • Text as text: the chart's labels are pixels.

Limits

  • Options from other image routes, such as ImageQuality, are ignored on this pair rather than refused.
  • 100,000,000 pixels and 16,000 pixels per side; larger sizes return 413.
  • Password can't open protected charts yet. A protected chart returns 422 "the input file is password-protected" without it and 400 "password-protected ODC files are not supported yet" with it; on an unprotected chart it is ignored (62,330 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

Charts on web pages

A site that shows monthly figures can serve each chart as WebP: 62,330 bytes for the sample against 95,821 as PNG, with identical pixels.

Charts in a web or mobile app

Apps that render reports can request charts at the width of the screen with ImageWidth and show them as images.

Charts over a colored page

TransparentColor=white removes the white chart background so the chart sits on the page color; the gray plot area stays.

Questions

Is the WebP lossy?

No. The file is VP8L, WebP's lossless mode. It is smaller than PNG because the format compresses better, not because detail is dropped.

How do I make the file smaller?

Lower the pixel count: ImageWidth=800 gave 45,032 bytes and ImageResolution=96 gave 37,198. ImageQuality changes nothing on this route.

Can I get a transparent chart?

Send TransparentColor=white. In the sample, 55% of the pixels became transparent: the chart background, not the plot area, which is filled #F5F7FA.

Convert your first ODC file in a minute.