Error during conversion of .dwg files with XRefs in version 12.2.0

Product: PDFNet Java Library, CADModule

Product Version: 12.2.0

Please give a brief summary of your issue:
When converting .dwg files containing XRefs, the conversion fails with an Exception.

Please describe your issue and provide steps to reproduce it:
This is on Linux. See the attached sample files below.

master.dwg (16.0 KB)

rectangle.dwg (13.4 KB)

circle.dwg (16.9 KB)

rectangle.dwg contains a small rectangle, circle.dwg contains a circle. master.dwg has some lines and refers to rectangle and circle. When all three are present in the same folder, the CADModule is capable of finding the referenced files and created a PDF from master with the references resolved and the output visible. This has worked until we upgraded to PDFNet library and CADModule 12.2.0.

We now get the following error:

2026-10-14 09:21:53.188 Caused by: Exception:
2026-10-14 09:21:53.188 Message: Exception:
2026-10-14 09:21:53.188 Message: Error converting CAD content using CAD2PDF module Add-On.
2026-10-14 09:21:53.188 Exit code: 0X25
2026-10-14 09:21:53.188 Failed to create valid PDF: PDF header not found. The file is not a valid PDF document.
2026-10-14 09:21:53.188 Parser.cpp:1494
2026-10-14 09:21:53.188 SkipHeader
2026-10-14 09:21:53.188 2026-10-14 09:21:53.188 Conditional expression: exit_code == 0
2026-10-14 09:21:53.188 Version : 12.2.0-4345c0e
2026-10-14 09:21:53.188 Platform : Linux
2026-10-14 09:21:53.188 Architecture : AMD64
2026-10-14 09:21:53.188 Filename : Cad2Pdf.cpp
2026-10-14 09:21:53.188 Function : Convert
2026-10-14 09:21:53.188 Linenumber : 976
2026-10-14 09:21:53.188 2026-10-14 09:21:53.188 Conditional expression: exit_code == 0
2026-10-14 09:21:53.188 Filename : Cad2Pdf.cpp
2026-10-14 09:21:53.188 Function : Convert
2026-10-14 09:21:53.188 Linenumber : 976
2026-10-14 09:21:53.188 Error code : 0
2026-10-14 09:21:53.188 2026-10-14 09:21:53.188 at com.pdftron.pdf.Convert.FromCAD(Native Method) ~[PDFNet-12.2.0.jar:na]
2026-10-14 09:21:53.188 at com.pdftron.pdf.Convert.fromCAD(Convert.java:4191) ~[PDFNet-12.2.0.jar:na]
2026-10-14 09:21:53.188 at com.chapoo.pdftronconverter.conversion.service.imp.PdftronConversionServiceImp.getPdfDocFromCAD(PdftronConversionServiceImp.java:104) ~[classes/:na]
2026-10-14 09:21:53.188 at com.c.pdftronconverter.conversion.service.imp.PdftronConversionServiceImp.convertToOptimizedPdf(PdftronConversionServiceImp.java:69) ~[classes/:na]
2026-10-14 09:21:53.188 … 61 common frames omitted

This looks like a regression, as this has worked well until the new release.

1 Like

I’m working on reproducing this. To ensure I’m experiencing the error in the same means you are, could you confirm you’re using Convert.fromCAD() with default options, or furnish me with the ones you’re using if you’re changing any?

2 Likes

Hi Nicholas,

We’re using Convert.fromCAD(), with the following options:

final CADConvertOptions cadConvertOptions = new CADConvertOptions();
cadConvertOptions.setZoomToExtents(true);
cadConvertOptions.setIncludeModel(true);
cadConvertOptions.setAutoRotate(true);
cadConvertOptions.setAllowThinLines(true);
cadConvertOptions.setUseScaleFromDocument(true);

Thanks for looking into it!

1 Like

Thank you. I’ve reproduced the issue and this is something which will require additional investigation by our development team. When I get any updates from them, I’ll post an update here.

2 Likes

Our engineering team has addressed this and the resolution should be available in the next major toolkit release.

1 Like

Great news! Thanks for the update Nicholas! And thanks to the engineering team for resolving it.

1 Like