Skip to content
pdfconversionapi

DXF to WebP API

Send a DXF to POST /v2/convert/dxf/to/webp and get a lossless WebP of model space back, 2400 × 1600, with the same pixels as the PNG route. For the garden plan that is 122,888 bytes instead of 132,185.

Endpoint
POST /v2/convert/dxf/to/webp
Accepts
dxf
Sample timing
0.128 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/dxf/to/webp \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@linden-garden-site-plan.dxf \
  -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.128 s median1 file, 120 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.128,
  "Files": [
    {
      "FileName": "linden-garden-site-plan.webp",
      "FileExt": "webp",
      "FileSize": 122888,
      "FileData": "UklGRgDgAQBXRUJQVlA4TPTf…"
    }
  ]
}

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 linden-garden-site-plan.webp, rendered by the API
Input
linden-garden-site-plan.dxf (24 KB)
Output
linden-garden-site-plan.webp (120 KB)
Source
A site plan for a fictional community garden, in feet, which we wrote as a DXF R2000 file with a short script (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
ColorSpaceenum, default defaultgray halves the sample to 57,094 bytes; monochrome keeps only black and white pixels, 8,252 bytes. Both files are still RGB, because lossless WebP has no one-channel mode. cmyk returns 400.Values: default, rgb, truecolors, gray, grayscale, monochrome
TransparentColorstringPixels of exactly this color become transparent. 33,40,48 removes the dark background (131,318 bytes for the sample).Values: A color name, #RRGGBB or R,G,B
ImageResolutionintegerAccepted for compatibility (10–800) but not stored, since WebP has no DPI field.Values: 10–800
FileNamestringOutput file name minus .webp; the DXF's name otherwise.
StoreFileboolean, default falseReplace the base64 WebP in the reply with a link that lasts 3 hours.

Not supported yet

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

OptionWhat to do instead
ImageQualityOutput is lossless; values other than 75 return 400.
ImageAntialiasingValues other than 8 return 400.
SpaceToConvertModel space only.
ExportLayersOnly true passes.

Also refused when set: CustomSpaceToConvert.

What carries over, and what doesn't

Kept

  • Pixel-for-pixel the PNG picture, because the WebP is lossless (VP8L)
  • The true-color shed fill, the crosshatched walk and the PHANTOM property line
  • Tree species attributes and wrapped MTEXT notes
  • Plain RGB with no alpha channel, until TransparentColor keys a color out and adds one

Lost or not yet supported

  • No lossy mode, so a smaller file at lower quality isn't possible.
  • ImageWidth and ImageHeight are silently ignored on this route; the WebP is 2400 × 1600 regardless. /v2/convert/webp/to/webp with ImageWidth resizes it.
  • Keying out the background leaves dark edges around antialiased lines, since only the exact background color is removed.
  • Paper space, lineweights and the drawing's scale are not carried into the image.

Limits

  • DXF versions R12 through 2018.
  • One WebP per DXF, 2400 × 1600.
  • Input that isn't DXF returns 422 with the parser's message.
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
  • After 120 seconds a conversion returns 504.

Where teams use it

Lighter plan images on the web

Serve the WebP where a site would otherwise use the PNG: the same pixels in 7% fewer bytes for the garden plan, and browsers decode it natively.

Plans layered over maps or photos

Key out the background with TransparentColor=33,40,48 and place the plan over an aerial photo or a map tile in your viewer.

Questions

Why can't I set `ImageQuality`?

The WebP is written lossless, which has no quality setting. The API refuses values other than ConvertAPI's default of 75 rather than ignore them.

How do I make a smaller WebP?

Send ColorSpace=gray (57,094 bytes for the sample instead of 122,888), or resize the result with /v2/convert/webp/to/webp and ImageWidth.

Can browsers show the transparent version?

Yes, WebP supports alpha. With TransparentColor=33,40,48 the garden plan's white property line needs a dark backdrop to stay visible.

Convert your first DXF file in a minute.