Image load = CadImage.load(new FileInputStream(file.getAbsoluteFile()));
The large dwg file is here.
dwgfile.zip (5.7 MB)
I have opened a ticket with ID CADJAVA-903 in our issue tracking system after observing the issue. This thread has been linked with the issue so that you may be notified once issue will be fixed.
I suggest you to please increase the Java Heap Size. You may consider using -Xmx5g argument with following code. On our end, it takes about 30 seconds.
String srcFile = path + "A01¬г-¦-L¦д=-PRO-E-0027-03.dwg";
Image image = CadImage.load(new FileInputStream(srcFile));
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.setPageHeight(2000);
rasterizationOptions.setPageWidth(1000);
// Export to PNG format
PngOptions pngOptions = new PngOptions();
pngOptions.setVectorRasterizationOptions(rasterizationOptions);
image.save(path + "export.png", pngOptions);
The generated output is attached for your kind reference.
export.png (25.4 KB)