Wrong DWF viewport/page/layout size and scale

Hi everyone,

I’m working with Aspose.CAD for Python (v25.3.0 on Python 3.12), and I’ve run into a scaling issue when opening DWF files—I suspect this might apply across other language bindings too.

I receive architectural DWFs from clients, and in some of them, the drawing scale is completely off. Many segments in these drawings have dimension annotations (e.g., measurements written as text), and when I cross-check these segments using Autodesk Viewer, the dimensions more or less match what’s written—sometimes needing a factor adjustment (×10, ×100, etc.), which is understandable and expected.

However, with Aspose.CAD, the measurements are often off by seemingly arbitrary scaling factors, such as 4.62, 14.58, 6.88, etc.—and these values vary wildly between drawings. This affects about 50% of the DWF files I receive.

Unfortunately, I can’t share these files publicly, but I’m open to sharing them privately if someone from Aspose wants to take a deeper look.

What I’ve Tried So Far:

  1. transform_matrix.x_scale – This always gives me the same value (≈ 0.0211666…), regardless of the file.
  2. Viewport entity size – Always matches the page size, which is incorrect in these cases.
  3. page.max_point - page.min_point – Same as the viewport size.
  4. Bounding box of all polylines – Again, aligns with the viewport, but doesn’t reflect the true scale.
  5. CAD metadata – Nothing useful there, just author info, title, etc.
  6. cad_image.size and cad_image.bounds – Both return the same incorrect dimensions as above.
  7. Unit conversion attempts (e.g., to inches) – Doesn’t help, as the problem lies in inconsistent scaling between files.

My Goal

I’m not trying to render or convert the drawings (e.g., to JPEG or PDF). I’m only interested in extracting raw vector data (e.g., polylines)—which I can do—but I need reliable physical sizes, which I currently don’t get for about half of the files.

Has anyone faced a similar issue? Is there a reliable way to extract or infer the correct scale from these DWFs using Aspose?

@alexbm,
Hello.
Please use this example to send some test file privately. Could you please provide exactly which values are not correct, what are the expected values and what do you use to obtain them.

@alexbm,
thank you for very nice details, we have created CADPYTHON-417 to investigate this case better.

1 Like