DOTX to PNG API
POST /v2/convert/dotx/to/png draws each page of a Word template as a PNG. The sample uses ImageResolution=96, the usual screen density: the A4 quote page is 793 × 1,122 pixels, 103,983 bytes, and the file says 96 DPI.
- Endpoint
- POST /v2/
convert/ dotx/ to/ png - Accepts
- dotx
- Sample timing
- 0.579 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/png \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@catering-quote.dotx \
--form-string ImageResolution=96 \
-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/png",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("catering-quote.dotx", "rb"))],
data={
"ImageResolution": "96",
},
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", "96");
const url = "https://api.pdfconversionapi.com/v2/convert/dotx/to/png";
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.579,
"Files": [
{
"FileName": "catering-quote-1.png",
"FileExt": "png",
"FileSize": 103983,
"FileData": "iVBORw0KGgoAAAANSUhEUgAA…"
}
]
}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.png (102 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 | Drawing density in DPI, saved in the PNG's pHYs chunk when you send it (3,780 pixels per meter for 96). At the default 150 the page is 1,240 × 1,753 and 182,852 bytes.Values: 36–600 |
TransparentColorstring | Make one exact color transparent. white clears 93.5% of the sample page at its 96 DPI (94.3% at the default 150), leaving the text, table lines, logo and the colored header row. |
ColorSpaceenum, default default | monochrome gives a black-and-white page of 25,842 bytes at 150 DPI; gray a one-channel gray PNG (68,023 bytes); rgb the same three-channel PNG as the default.Values: default, rgb, gray, monochrome |
ImageWidthinteger | Output width; 640 gives a 640-pixel-wide page of 77,029 bytes.Values: 1–20,000 |
ImageHeightinteger | Output height, with proportional width.Values: 1–20,000 |
PageRangestring | Pages to draw from a multi-page template.Values: e.g. 1, 2- |
BackgroundColorstring | Color under the whole sheet, since the template paints no paper of its own. |
Passwordstring | Password of an encrypted .dotx. Our encrypted copy of the sample gave a PNG of the same 182,852 bytes as the plain file. |
FileNamestring | Stem for -1.png and the following pages. |
StoreFileboolean, default false | Links instead of image data; they expire after 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". |
UpdateTableOfContents | true returns 400 for DOTX files. |
What carries over, and what doesn't
Kept
- Lossless RGB pixels, with an alpha channel added only when you send
TransparentColor - The logo, the gray content control placeholder, the price table and the footer
- The DPI in the file when
ImageResolutionis set (96.012 as Pillow reads 3,780 pixels per meter) - The page size from the template: A4 proportions, 793 × 1,122 at 96 DPI
Lost or not yet supported
- The saved date: the DATE field prints the day of the conversion.
- Light details in
monochrome: the gray placeholder text and the pale header fill turn white. - Exact fonts: Caladea and Carlito stand in for Cambria and Calibri.
Limits
- Up to 2,000 pages per request.
- 16,000 pixels per side and 100 million pixels per page; above either, 413.
- 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 thumbnails in a web app
List a company's quote, letter and report templates with a picture of each. PNG keeps small type crisp, and 96 DPI matches how the page looks at 100% zoom on a standard screen.
Placing a letterhead on other designs
With TransparentColor=white, the template's logo, lines and text can be laid over a colored background in a slide or web banner.
Questions
Which resolution matches the screen?
96 is the number of CSS pixels per inch, so at 96 DPI the A4 page is 793 × 1,122 pixels and shows at its paper size in a browser at 100% zoom. Use 150 or more if people zoom in, or for printing.
Why do edges look light on a dark background after TransparentColor?
Only pixels that are exactly the chosen color become transparent. Smoothed letter edges are light gray, not white, so they stay opaque. Draw at a higher resolution to make that fringe thinner.
Is the PNG of a DOTX different from that of a DOCX?
The image side is the same, but the layout differs: templates are laid out by an office suite, while /v2/convert/docx/to/png uses our own document converter. Template routes also refuse Word options such as IncludeMarkup.
Convert your first DOTX file in a minute.