DOTX to WebP API
POST /v2/convert/dotx/to/webp turns the pages of a Word template into lossless RGB WebP images. The sample renders the A4 catering quote at ImageResolution=100: one 826 × 1,169 image of 46,768 bytes.
- Endpoint
- POST /v2/
convert/ dotx/ to/ webp - Accepts
- dotx
- Sample timing
- 0.588 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/dotx/to/webp \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@catering-quote.dotx \
--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/dotx/to/webp",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("catering-quote.dotx", "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 = "catering-quote.dotx";
form.append("File", new Blob([await readFile(file)]), file);
form.append("ImageResolution", "100");
const url = "https://api.pdfconversionapi.com/v2/convert/dotx/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.588,
"Files": [
{
"FileName": "catering-quote-1.webp",
"FileExt": "webp",
"FileSize": 46768,
"FileData": "UklGRqi2AABXRUJQVlA4TJu2…"
}
]
}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
- catering-quote.dotx (40 KB)
- Output
- catering-quote-1.webp (46 KB)
- Source
- A one-page catering quote template for a fictional bakery, written for this site and saved as a Word template, with a fill-in content control, a date field and a price table. (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. At the default the page is 1,240 × 1,753 and 72,738 bytes; at 100 it is 46,768 bytes. Not stored in the file.Values: 36–600 |
ImageWidthinteger | Width of the output; 600 makes the quote 30,978 bytes.Values: 1–20,000 |
ImageHeightinteger | Height of the output, width in proportion.Values: 1–20,000 |
PageRangestring | Pages of a multi-page template.Values: e.g. 1 |
TransparentColorstring | Clear one exact color: white turns the paper transparent (80,318 bytes at 150 DPI). |
ColorSpaceenum, default default | gray made the sample page 51,330 bytes at 150 DPI.Values: default, rgb, gray, monochrome |
BackgroundColorstring | Color under the page, visible wherever the template paints nothing. |
Passwordstring | Opens an encrypted .dotx before rendering. |
FileNamestring | Stem of the image name. |
StoreFileboolean, default false | Return a link per page, valid for 3 hours. |
Not supported yet
Setting one of these to anything but its default returns 400.
| Option | What to do instead |
|---|---|
IncludeMarkup | true returns 400 "IncludeMarkup is not supported yet for DOTX files". |
Also refused when set: UpdateTableOfContents.
What carries over, and what doesn't
Kept
- Every pixel as rendered, without lossy artifacts, in a smaller file than PNG: 72,738 bytes against 182,852 for the same page at 150 DPI
- Opaque RGB pages;
TransparentColoradds an alpha channel when you need one - The logo, placeholder, table, bullet list and footer
Lost or not yet supported
- A DPI value: WebP has no field for it, whatever
ImageResolutionyou send. - The template's saved date, since the DATE field shows the conversion day.
- Lossy compression settings:
ImageQualityis ignored here, soImageQuality=50gives the same 72,738 bytes as the default.
Limits
- At most 2,000 pages per request.
- 16,000 pixels per side and 100 million pixels per page; 413 above that.
- Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together; 120 seconds per conversion, then 504.
Where teams use it
Template previews on a website
A store that sells or shares document templates can show each page as WebP, which browsers display directly, at a fraction of the size of the same lossless page as PNG.
Previewing templates inside a product
Contract and proposal tools can generate a preview when a template is uploaded and cache it, so the gallery never has to open the .dotx again.
Questions
Is WebP smaller than PNG for template pages?
For the sample, yes: the A4 quote at 150 DPI is 72,738 bytes as WebP and 182,852 as PNG, both lossless. Your templates may differ, especially ones with large photos.
Can I make lossy WebP to save more space?
Not yet. The encoder writes lossless WebP only, and ImageQuality is not read on this route. Lower the resolution or width instead.
Is the background transparent?
No. By default the image is RGB, with no alpha channel. Send TransparentColor=white to add one and clear the paper (94.3% of the page); the sample page then grows from 72,738 to 80,318 bytes at 150 DPI.
Convert your first DOTX file in a minute.