Skip to content
pdfconversionapi

ODG to PNG API

POST /v2/convert/odg/to/png draws every page of an OpenDocument drawing as a separate PNG. At the default 150 DPI our floor plan comes back as two 1,650 × 1,275 RGB images of 156,740 and 169,572 bytes, named maker-fair-floor-plan-1.png and -2.png.

Endpoint
POST /v2/convert/odg/to/png
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/png \
  -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
fi
200 OK0.562 s median2 files, 319 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.562,
  "Files": [
    {
      "FileName": "maker-fair-floor-plan-1.png",
      "FileExt": "png",
      "FileSize": 156740,
      "FileData": "iVBORw0KGgoAAAANSUhEUgAA…"
    },
    {
      "FileName": "maker-fair-floor-plan-2.png",
      "FileExt": "png",
      "FileSize": 169572,
      "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.

First page of maker-fair-floor-plan-1.png, rendered by the API
Input
maker-fair-floor-plan.odg (4.4 KB)
Output
maker-fair-floor-plan-1.png (153 KB)maker-fair-floor-plan-2.png (166 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.

ParameterWhat it does
ImageResolutioninteger, default 150Dots per inch of the drawing page, also written into the PNG's pHYs chunk when you send it. 72 gives 792 × 612 pixels per Letter landscape page; 300 gives 3,300 × 2,550 (369,027 bytes for the hall plan).Values: 36–600
ImageWidthintegerWidth in pixels; the page is drawn at the scale that width needs. 800 turned the directory page into 800 × 618.Values: 1–20000
ImageHeightintegerHeight in pixels. 600 alone gave a 776 × 600 hall plan.Values: 1–20000
ScaleProportionsboolean, default trueWith both sizes set, the page fits inside the box: 600 × 600 gave 600 × 464. false stretches it to exactly 600 × 600.
ScaleImageboolean, default truefalse crops instead of scaling: 600 × 300 returned the top-left corner of the plan drawn at 150 DPI: the title, most of the subtitle line, the hall wall's corner and the tops of the info desk and the stage.
ScaleIfLargerboolean, default falsetrue only ever shrinks. ImageWidth=3000 normally gives 3,000 × 2,318; with this set, the plan stays 1,650 pixels wide.
TransparentColorstringOne exact color to clear. white made 1,591,447 of the 2,103,750 pixels on the hall page transparent; tinted fills, lines and text stay opaque.Values: color name, #RRGGBB or R,G,B
ColorSpaceenum, default defaultgray stores one channel (60,547 bytes for the plan) and monochrome keeps only black and white (25,754 bytes); rgb gives the same 156,740-byte file as the default. cmyk returns 400.Values: default, rgb, gray, monochrome
PageRangestringPages to draw. 2 returns only maker-fair-floor-plan-2.png.Values: e.g. 1, 2, 1-2
PasswordstringFor a drawing saved with a password; our protected copy gave PNGs byte for byte the size of the originals.
FileNamestringStem of the image names: FileName=hall gives hall-1.png and hall-2.png.
StoreFileboolean, default falseStore the PNGs and return links that expire after 3 hours.

Not supported yet

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

OptionWhat to do instead
PageSizeReturns 400 "PageSize is not supported yet for ODG files". The pixel size follows the drawing's page size and ImageResolution, or ImageWidth and ImageHeight.

Also refused when set: PageOrientation.

What carries over, and what doesn't

Kept

  • One PNG per drawing page, numbered in page order
  • Exact fill colors: the booth fill is #DBEAFE in all 216,855 of its pixels on the hall page
  • Smooth edges on lines and text, and the stage gradient's color steps: the hall page holds 2,585 distinct colors, 1,965 of them outside the stage
  • The page's proportions: 11 by 8.5 inches becomes 1,650 × 1,275 at 150 DPI
  • Three color channels with no alpha channel; TransparentColor adds one

Lost or not yet supported

  • The DPI value, unless you send ImageResolution: the sample PNGs carry no pHYs chunk.
  • Text as text: labels become pixels, so they can't be searched or copied.
  • Shapes on layers that aren't shown both on screen and in print, such as the sample's planner note.
  • A page background color: drawing pages come with a white page fill that covers the whole image, so BackgroundColor changes nothing. With black, both PNGs came back pixel for pixel the same as without it.

Limits

  • 100,000,000 pixels per image: ImageWidth=13000 returns 413 "the image is 13,000×10,045 pixels, above the limit of 100,000,000 pixels; lower ImageWidth or ImageHeight", while 10,000 wide worked (10,000 × 7,727, 1.8 MB).
  • At most 16,000 pixels on a side, and 2,000 pages per request.
  • Options a PNG has no use for, such as ImageQuality or MultiPage, are accepted and change nothing: the hall page stayed 156,740 bytes.
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans; 120 seconds per conversion.

Where teams use it

Thumbnails in a document library

Show a preview of each uploaded drawing next to its file name. ImageWidth=400 with PageRange=1 keeps the request to one small image of the first page.

Diagrams on web pages and wikis

Publish an office layout or process drawing as an image without asking readers to open the .odg file. PNG keeps flat fills and thin lines without blur.

Cut-out shapes for slides

TransparentColor=white clears the white page around the shapes, so the plan can sit on a colored slide background.

Questions

How big will each PNG be?

Page size in inches times ImageResolution. A Letter landscape page is 1,650 × 1,275 at the default 150 DPI and 792 × 612 at 72 DPI. For a fixed width, send ImageWidth and the height follows the page's shape.

Can I get a transparent background?

Send TransparentColor=white. On the hall page that cleared 75.6% of the pixels. Only exactly white pixels are cleared, so the soft edge pixels around text and lines keep a light fringe on dark backgrounds.

Can I render only one page of a multi-page drawing?

Yes: PageRange=2 returns just the second page. Without it you get one PNG per page in the Files array of the response.

Why is the result missing a note I can see in my editor?

The note sits on a layer that shows on screen but doesn't print. Pages are drawn the way they would print, so move the shape to a normal layer first.

Convert your first ODG file in a minute.