Skip to content
pdfconversionapi

DWG to JPG API

Upload a DWG to POST /v2/convert/dwg/to/jpg and receive a 2400 × 1600 JPEG of the drawing's model space on a dark background. ImageQuality, ColorSpace and ImageResolution shape the file; the picture itself is the same one the PNG route returns.

Endpoint
POST /v2/convert/dwg/to/jpg
Accepts
dwg
Sample timing
0.131 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/dwg/to/jpg \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@deck-framing-plan.dwg \
  --form-string ImageQuality=80 \
  -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.131 s median1 file, 296 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.131,
  "Files": [
    {
      "FileName": "deck-framing-plan.jpg",
      "FileExt": "jpg",
      "FileSize": 303379,
      "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 deck-framing-plan.jpg, rendered by the API
Input
deck-framing-plan.dwg (12 KB)
Output
deck-framing-plan.jpg (296 KB)
Source
A framing plan for a fictional 16 by 12 foot backyard deck, which we drew as a DXF with a short script and saved as DWG (2004 format) (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 85JPEG quality. The sample sends 80 and gets 303,379 bytes; the same deck plan is 282,687 bytes at 75 (ConvertAPI's default), 328,512 at our default of 85 and 439,424 at 95. 0 or 101 returns 400.Values: 1–100
ColorSpaceenum, default defaultgray writes a one-channel JPEG (186,530 bytes for the deck plan). monochrome turns every pixel black or white at a fixed threshold, so dark colors such as the red beam and the blue ledger vanish into the black background. cmyk returns 400.Values: default, rgb, truecolors, gray, grayscale, monochrome
ImageResolutionintegerOnly the DPI recorded in the JPEG header; the image stays 2400 × 1600 pixels. With 300 the file says 300 × 300 DPI, without it no DPI is written. Values outside 10–800 return 400.Values: 10–800
FileNamestringOutput name without .jpg. Leave it out to get deck-framing-plan.jpg.
StoreFileboolean, default falsetrue sends back a download link that works for 3 hours instead of the JPEG bytes.

Not supported yet

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

OptionWhat to do instead
ImageWidthThe JPEG is always 2400 × 1600. Resize it in a second request to /v2/convert/jpg/to/jpg.
SpaceToConvertModel space is drawn; any value other than the default returns 400.
ExportLayersLayers are drawn as they are set in the file; false returns 400.

Also refused when set: ImageHeight, CustomSpaceToConvert.

What carries over, and what doesn't

Kept

  • The CAD-screen picture: dark background, the layer colors and white color-7 linework, the same image as dwg/to/png before JPEG compression
  • Full color detail: the JPEG is written without chroma subsampling (4:4:4), which keeps thin yellow and green lines from smearing
  • Dashed HIDDEN lines, the ANSI31 hatch, block inserts with their attribute values and the wrapped framing notes
  • Visibility of layers: S-DECKING is off in the DWG, so its boards are not in the JPEG

Lost or not yet supported

  • JPEG is a poor fit for line art: the sample is 303,379 bytes at quality 80, three times the 97,617-byte PNG of the same picture, and thin lines get soft edges.
  • The background is opaque dark gray (RGB 33, 40, 48). BackgroundColor and AlphaColor are accepted but change nothing, because the drawing has no transparent pixels to fill.
  • Every image is 2400 × 1600 with the drawing fitted to it, so there is no drawing scale.
  • Paper space, viewports and title blocks in layouts are not drawn.
  • No DPI is recorded unless you send ImageResolution.

Limits

  • DWG files saved in the R13 through 2018 formats.
  • One 2400 × 1600 JPEG per DWG.
  • ImageQuality outside 1–100 and ImageResolution outside 10–800 return 400.
  • A damaged DWG returns 422 with the reader's message.
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together, and 120 seconds per conversion (then 504).

Where teams use it

Attaching drawings where only JPEG is accepted

Some upload forms, ERP attachments and photo-centric systems take JPEG and nothing else. Converting the DWG there and then saves someone from screenshotting the CAD screen.

Smaller grayscale copies for review

ColorSpace=gray cuts the sample to 186,530 bytes, a little over half the color file at quality 85, and still shows the framing, notes and dimensions.

Questions

Why is the JPEG bigger than the PNG?

Drawings are mostly flat background with thin lines, which PNG stores compactly and JPEG does not. For the deck plan, the PNG is 97,617 bytes and the JPEG 282,687 bytes even at quality 75. Use JPEG when a system demands it, and PNG or WebP otherwise.

Can I get a white background?

Not from this route. The image is drawn dark, like a CAD screen, and BackgroundColor has no effect on it. A PDF or SVG of the same drawing has a white background, and /v2/convert/pdf/to/jpg turns that PDF into a JPEG on white.

Does `ColorSpace=monochrome` give a clean black-and-white drawing?

It gives white lines on black. Each pixel above mid-gray becomes white and the rest black, so yellow, green and white linework survives, but red, blue and magenta lines (the beam, the ledger and the posts in the sample) are lost against the background. gray keeps them as dim gray lines.

Is `ImageResolution` the drawing scale?

No. It only writes a DPI number into the JPEG header for printing and layout programs. The pixel size stays 2400 × 1600, and the drawing is always fitted to that frame.

Convert your first DWG file in a minute.