test1.zip (408.8 KB)
I ran the following codes to output attached dxf as pdf:
final long beforeUsedMem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
final CadImage image = (CadImage) Image.load(“C:/test1.dxf”);
final CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.setPageSize(new com.aspose.cad.SizeF(800, 800));
rasterizationOptions.setCenterDrawing(true);
final PdfOptions pdfOptions = new PdfOptions();
pdfOptions.setVectorRasterizationOptions(rasterizationOptions);
image.save(“C:/test.pdf”, pdfOptions);
final long afterUsedMem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.println("after Used memory: " + (afterUsedMem) / (1024 * 1024));
The size of tested dxf file: 4.6MB
The memory usage: ~200MB
Is there anyway to optimize (reduce) memory usage?