Skip to content

Drawing File Size Limit

Werk24 accepts drawings up to 10 MiB (10,485,760 bytes) when the drawing is uploaded separately, as read_drawing does, and up to about 4.6 MB when it travels inside a callback request. A drawing over the limit is not processed.

How you find out depends on how you submit it. With read_drawing, the Python client reports DRAWING_FILE_SIZE_TOO_LARGE in the exceptions of each ask's message instead of raising. With read_drawing_with_callback, versions newer than 2.7.0 raise an exception before anything is sent, unless the drawing is a stream that cannot seek. A direct POST to /techread/read-with-callback without the Python client is sent and refused without a request_id. See below.

Version note: werk24 2.7.0 behaves differently on both paths. read_drawing raises TypeError: ... unexpected keyword argument 'exception_level' instead of reporting DRAWING_FILE_SIZE_TOO_LARGE when the upload is refused; earlier versions report it, and the fix is in versions newer than 2.7.0. read_drawing_with_callback sends the whole request, which is refused without a request_id, so check the size yourself before sending.

To prevent errors and ensure smooth processing, make sure your file meets the size requirements before submission.

For additional details on handling exceptions, refer to our Exception Handling Guide.

Callback Requests Take Less: About 4.6 MB

The 10 MiB limit applies when the drawing is uploaded separately, as read_drawing does. A callback (webhook) request works differently: read_drawing_with_callback, and a direct POST to /techread/read-with-callback, carry the drawing inside the request body. That body is limited to 6 MiB after base64 encoding, which leaves room for about 4.6 MB (4,669,440 bytes) of multipart body. The drawing shares that space with the other form fields (asks, callback_url, callback_headers, public_key and the file name), so large callback_headers or a long public key reduce the space left for the drawing.

How you submit Largest drawing
read_drawing, read_drawing_sync, read_drawing_with_hooks 10 MiB (10,485,760 bytes)
read_drawing_with_callback / POST /techread/read-with-callback about 4.6 MB, minus the other form fields

The Python client checks this before sending, in versions newer than 2.7.0:

  • CallbackDrawingTooLargeException is raised when the drawing does not fit beside the other fields. Use read_drawing instead, or reduce the file size.
  • CallbackFieldsTooLargeException is raised when the other fields fill the request on their own. Send fewer or shorter callback_headers, or a shorter file name.

Both are subclasses of RequestTooLargeException, so an existing except RequestTooLargeException keeps catching them. A stream that cannot seek (a pipe or a socket) cannot be measured in advance and is sent as is. If you call the endpoint without the Python client, or with version 2.7.0 or older, a request over the limit is rejected before the drawing is read, so check the size yourself.

If your drawings can be larger than about 4.6 MB, submit them with read_drawing (10 MiB), or reduce their size as described below.

How to Handle Large File Sizes

If your technical drawing is over the limit for the way you submit it, consider the following strategies to reduce file size:

  1. For Raster-Based Files (JPEG, PNG, TIFF)

    • Reduce image resolution: Lowering the DPI (e.g., from 600 DPI to 300 DPI) can significantly reduce file size while maintaining clarity.
    • Use lossless compression: Convert images to PNG, which offers efficient compression without quality loss.
    • Crop unnecessary whitespace: Remove non-essential margins and background areas.
  2. For Vector-Based Files (PDF)

    • Optimize embedded images: Ensure raster elements within the PDF are compressed or resized.
    • Remove unnecessary layers: Some CAD software exports contain hidden layers that increase file size.
    • Convert to a simplified PDF: Some PDFs store redundant metadata; using tools like Adobe Acrobat’s "Reduce File Size" feature can help.