Skip to content
pdfconversionapi

DXF to JPG API

Upload a DXF to /v2/convert/dxf/to/jpg and a 2400 × 1600 JPEG of model space comes back, drawn on a dark CAD background. The sample asks for ImageQuality=90; the default is 85.

Endpoint
POST /v2/convert/dxf/to/jpg
Accepts
dxf
Sample timing
0.153 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/jpg \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@linden-garden-site-plan.dxf \
  --form-string ImageQuality=90 \
  -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.153 s median1 file, 315 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.153,
  "Files": [
    {
      "FileName": "linden-garden-site-plan.jpg",
      "FileExt": "jpg",
      "FileSize": 322681,
      "FileData": "/9j/4AAQSkZJRgABAgAAAQAB…"
    }
  ]
}

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.jpg, rendered by the API
Input
linden-garden-site-plan.dxf (24 KB)
Output
linden-garden-site-plan.jpg (315 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
ImageQualityinteger, default 85Compression quality of the JPEG. The garden plan is 322,681 bytes at 90 (the sample), 283,247 at 85 and 239,842 at 75, ConvertAPI's default.Values: 1–100
ColorSpaceenum, default defaultgray gives a one-channel JPEG, 148,243 bytes for the sample. monochrome sets each pixel to black or white: the cyan notes, green beds and yellow dimensions stay white, while the red shed outline and the brown shed fill turn black like the background.Values: default, rgb, truecolors, gray, grayscale, monochrome
ImageResolutionintegerA DPI value written into the JPEG header, for programs that print or place the image. The pixel size doesn't change.Values: 10–800
FileNamestringFile name for the JPEG, without extension; linden-garden-site-plan by default.
StoreFileboolean, default falseReturn a 3-hour download link instead of the encoded JPEG.

Not supported yet

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

OptionWhat to do instead
ImageWidthAlways 2400 pixels wide; resize the JPEG afterwards with /v2/convert/jpg/to/jpg.
ImageHeightAlways 1600 pixels high.
SpaceToConvertOnly model space; other values return 400.
ExportLayersfalse returns 400.

Also refused when set: CustomSpaceToConvert.

What carries over, and what doesn't

Kept

  • The drawing as a CAD screen shows it: colors, the white PHANTOM property line, hatches, attributes and dimensions on the dark background
  • Exact true colors before compression: the shed fill is RGB 139, 90, 43 in the PNG this JPEG is encoded from
  • Color detail in thin lines: no chroma subsampling (4:4:4), so the green bed outlines and cyan text don't bleed
  • Hidden layers stay hidden: the off survey layer and the frozen old-shed layer are not drawn

Lost or not yet supported

  • JPEG is large for line drawings. The sample is 322,681 bytes, 2.4 times the 132,185-byte PNG of the same picture, and edges of thin lines pick up compression noise.
  • The size is always 2400 × 1600, with the plan fitted inside, so the image has no scale.
  • The background can't be changed: BackgroundColor and AlphaColor are accepted and have no effect, because the picture has no transparency.
  • Lineweights and paper space are not drawn, and SHX-style text uses a single-stroke font.

Limits

  • DXF versions R12 through 2018.
  • One JPEG per DXF.
  • ImageQuality must be 1 to 100 and ImageResolution 10 to 800; other values return 400.
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
  • Each conversion is allowed 120 seconds, then the API answers 504.

Where teams use it

Plans in emails and printed handouts

A garden committee, a landscaper or a homeowner can open a JPEG anywhere. Attach the site plan to an email or drop it into a newsletter without asking anyone to install a DXF viewer.

Pictures for systems that want JPEG

Listing sites, form builders and older document systems often accept JPEG uploads only. Convert the DXF on the way in and store the original next to the picture.

Questions

What JPEG quality should I use?

For drawings, higher than for photos: thin lines show compression noise quickly. The sample uses 90. At ConvertAPI's default of 75 the file is 239,842 bytes. If size matters, PNG (132,185 bytes) and WebP (122,888) are smaller and lossless.

How do I get a black-and-white image?

Send ColorSpace=monochrome. You get white lines on black, and only colors brighter than mid-gray survive: in the garden plan the red shed outline and the brown fill disappear. For print, a PDF from /v2/convert/dxf/to/pdf is black on white instead.

Does `ImageResolution` make the drawing sharper?

No. It only records a DPI value in the file. The drawing is always drawn into 2400 × 1600 pixels.

Convert your first DXF file in a minute.