ODG to WebP API
POST /v2/convert/odg/to/webp gives you each page of an OpenDocument drawing as a lossless WebP. The 2-page sample returns two 1,650 × 1,275 images of 77,522 and 60,662 bytes, less than half the size of the same pages as PNG.
- Endpoint
- POST /v2/
convert/ odg/ to/ webp - Accepts
- odg
- Sample timing
- 0.562 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/odg/to/webp \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@maker-fair-floor-plan.odg \
-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/odg/to/webp",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("maker-fair-floor-plan.odg", "rb"))],
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 = "maker-fair-floor-plan.odg";
form.append("File", new Blob([await readFile(file)]), file);
const url = "https://api.pdfconversionapi.com/v2/convert/odg/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.562,
"Files": [
{
"FileName": "maker-fair-floor-plan-1.webp",
"FileExt": "webp",
"FileSize": 77522,
"FileData": "UklGRsouAQBXRUJQVlA4TL0u…"
},
{
"FileName": "maker-fair-floor-plan-2.webp",
"FileExt": "webp",
"FileSize": 60662,
"FileData": "UklGRu7sAABXRUJQVlA4TOHs…"
}
]
}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
- maker-fair-floor-plan.odg (4.4 KB)
- Output
- maker-fair-floor-plan-1.webp (76 KB)maker-fair-floor-plan-2.webp (59 KB)
- Source
- A two-page floor plan and booth directory for a fictional maker fair, which we wrote as an OpenDocument drawing 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 |
|---|---|
ImageResolutioninteger, default 150 | Sets the pixel size only; WebP has no DPI field to store it in. At 96 the hall page was 1,056 × 816 and 47,796 bytes.Values: 36–600 |
ImageWidthinteger | Width in pixels: 1024 gave a 1,024 × 791 image of 46,252 bytes.Values: 1–20000 |
ImageHeightinteger | Height in pixels; the width follows the page shape unless both are set.Values: 1–20000 |
ScaleProportionsboolean, default true | When both sizes are given, false stretches the page to them instead of fitting it inside. |
ScaleImageboolean, default true | false returns a top-left crop of the requested size, unscaled. |
ScaleIfLargerboolean, default false | true keeps a page that is already smaller than the requested size as it is. |
TransparentColorstring | Clears one exact color. With white, 1,591,447 pixels of the hall page became transparent and the file grew to 83,220 bytes.Values: color name, #RRGGBB or R,G,B |
ColorSpaceenum, default default | gray turns the colors to grays (41,684 bytes for the hall page), but WebP has no gray mode, so the file is still an RGB image.Values: default, rgb, gray, monochrome |
PageRangestring | Pages to convert; 2 returns only the booth directory. |
Passwordstring | Opens a drawing saved with a password. |
FileNamestring | Stem for the numbered .webp files. |
StoreFileboolean, default false | Return links instead of the files; they expire after 3 hours. |
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 ODG files". |
Also refused when set: PageOrientation.
What carries over, and what doesn't
Kept
- Every pixel of the rendered page: the output is lossless WebP, so flat fills and thin lines show no compression artifacts
- One image per page, in page order, 1,650 × 1,275 at the default 150 DPI
- No alpha channel unless
TransparentColoris set, which adds one
Lost or not yet supported
- A quality setting: the images are always lossless, and
ImageQuality=40returned the same 77,522-byte page. - Resolution metadata: WebP has no DPI field, so
ImageResolutionchanges only the pixel size. - Text as text, and shapes on layers that are hidden or don't print.
Limits
- Images up to 100,000,000 pixels and 16,000 pixels per side; bigger requests return 413.
- Options this pair doesn't use, such as
ImageQuality,MultiPageorTiffType, are ignored instead of refused. - 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
Lighter diagrams on web pages
Event sites, help centers and intranets can show a floor plan or diagram as WebP: the hall page is 77,522 bytes as WebP and 156,740 as PNG, with the same pixels.
Page previews in a web app
An app can show each drawing page as an image, at the width its layout needs (ImageWidth=1024 gave 46,252 bytes), without sending the .odg file or a PDF viewer to the browser.
Overlays with a clear background
TransparentColor=white gives shapes on a transparent background for a map or dashboard layer.
Questions
Are the WebP files lossy or lossless?
Lossless. Each file is a VP8L WebP, so it matches the PNG output pixel for pixel while being smaller: 77,522 against 156,740 bytes for the hall page.
Can I make the WebP smaller?
Lower the pixel size with ImageWidth or ImageResolution. ImageWidth=1024 gave 46,252 bytes and 96 DPI gave 47,796 bytes. ImageQuality has no effect on this route.
Does `ColorSpace=gray` make a one-channel file?
No. The colors become grays and the file shrinks to 41,684 bytes, but WebP has no one-channel mode, so the file still decodes as red, green and blue.
Convert your first ODG file in a minute.