Hi,
While testing the conversion of DWG files to PDF, using Aspose.CAD for Java v17.4, I found many issues, firstly about lines or elements not drawn, secondly about the wrong size for the result.
Here is the code you can use to test it:
for (String fileName: Arrays.asList("pump.dwg", "street.dwg")) {
try (Image image = CadImage.load(fileName)) {
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
// A4 format landscape
rasterizationOptions.setPageWidth(210);
rasterizationOptions.setPageHeight(297);
rasterizationOptions.setUnitType(UnitType.Millimeter);
rasterizationOptions.setTypeOfEntities(TypeOfEntities.Entities2D);
rasterizationOptions.setCenterDrawing(true);
rasterizationOptions.setDrawType(CadDrawTypeMode.UseObjectColor);
rasterizationOptions.setLayouts(new String[]{"Model"});
PdfOptions options = new PdfOptions();
options.setVectorRasterizationOptions(rasterizationOptions);
image.save(fileName + ".pdf", options);
}
}
You can find the DWG files used in this code in the joined files.zip file.
I’ve seen 3 issues in the resulting files:
- In the produced file “pump.dwg.pdf”, a lot of elements are not drawn: some simple lines, the hatch lines, the numbered bubbles, the list of items on the left, etc…
- In the produced file “street.dwg.pdf”, the drawn model is very small in the center of the page, so small that it isn’t usable. I expected it to fit the page. I tried to use
CadRasterizationOptions.setAutomaticLayoutsScaling()
andCadRasterizationOptions.setNoScaling()
, but it didn’t produced the expected result. - The produced file “street.dwg.pdf” doesn’t have the expected page size. While looking at Acrobat Reader > File > Properties, I get a page size of 141.32 x 199.86 in / 3589.4 x 5076.5 mm. I tried to use
PdfOptions.setResolutionSettings()
, but it didn’t changed anything.
A last question: I’ve seen you published release notes for v17.8, but it isn’t available for download yet (see here). Will this version be available soon ? Is there a chance it could fix my issues ?
Best regards