Dxf to png and get block area

pic.jpg (118.4 KB)

I want to use java, Convert dxf file to png, and get the area of each element in the picture, hope you can give me some advice, thanks.

@BlackWhite,
Hi,
please provide the initial DXF file so we can investigate the items in it.
Here is a brief example how to convert DXF to PNG:

CadImage cadImage = (CadImage)Image.load(in);

CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();

rasterizationOptions.setPageWidth(1000);
rasterizationOptions.setPageHeight(1000);

PngOptions pngOptions = new PngOptions();
pngOptions.setVectorRasterizationOptions(rasterizationOptions);

cadImage.save(out, pngOptions);

I know how to convert dxf to png, but i want to get the area of each closed element in the 2D file.

@BlackWhite,
there will be some measurement options (getLength/getArea) or entities in the upcoming Aspose.CAD for Java 24.3 release, probably, they will be helpful.