Use Java SDK to convert the dxf file into a new dxf file, and the new dxf file cannot be opened

The code has been uploaded.

code

@cgcgcg

Cause The issue with the newly created DXF file not opening could be due to several factors, including incorrect settings during the conversion process, unsupported entities in the original DXF file, or issues with the file structure itself. Solution To ensure that the DXF file is created correctly, follow these steps: 1. Load the DXF File: Use the Image.load method to load the original DXF file.
2. Set Rasterization Options: Create an instance of CadRasterizationOptions and set the PageWidth and PageHeight properties to define the output dimensions.
3. Save the DXF File: Use the CadImage.save method to save the file, ensuring that you specify the correct format and options. Here’s a sample code snippet to guide you through the process: ```java
import com.aspose.cad.;
import com.aspose.cad.imageoptions.
; public class ConvertDXF { public static void main(String[] args) { // Load the original DXF file String srcFile = “path/to/your/source.dxf”; CadImage cadImage = (CadImage) Image.load(srcFile); // Create an instance of CadRasterizationOptions CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.setPageWidth(1600); rasterizationOptions.setPageHeight(1600); // Create an instance of PdfOptions PdfOptions pdfOptions = new PdfOptions(); pdfOptions.setVectorRasterizationOptions(rasterizationOptions); // Save the new DXF file String outputFile = “path/to/your/output.dxf”; cadImage.save(outputFile, pdfOptions); }
}

2. Check the output file path and permissions to ensure the file can be created.
3. If the issue persists, try opening the DXF file in a different CAD application to see if it provides any error messages. Please follow these steps and let me know if you encounter any further issues!

@cgcgcg,
Hi,
thank you for the details, we are able to reproduce the issue and logged CADJAVA-11987 task to fix it.

Does the old version have this problem? Or is it a problem with the trial version?

@cgcgcg,
we tested 25.3 and the latest 25.6, both have this issue. This is not a problem with trial version, we need to fix the export in the product.