DWG to PDF: Some part of CAD is missing in PDF (Java)

image.png (114.6 KB)
image.png (9.8 KB)

@gaoyinfeng,

Can you please share source file along with generated result and sample code so that we may further investigate to help you out.

Hello:

This is my source code file.code.zip (1.1 MB)

Thank you

Kind regards

yinfeng

@gaoyinfeng,

I have worked with the file shared by you and have been able to observe the issue specified. An issue with ID CADJAVA-501 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

I found a phenomenon.When my drawings were saved, they were not all in the window.You will see this phenomenon when you open my drawings in CAD and compare them with PDF files.After my test DWG converted PDF, I could only convert the screen in the window.

Thank you, kind regards!

@gaoyinfeng,

I have observed the information shared by you and request you to please provide the source code, source and output image for reference. Please also first try using latest Aspose.CAD for Java 19.6 on your end as well.

@gaoyinfeng,

I like to inform that file you shared is not perceived by the AutoCAD as native and contains incorrect dimensions. So the only manual call of cadImage.UpdateSize(); method may be applied after image load to define correct dimensions. Please check following sample code on your end.

using (CadImage cadImage = (CadImage)Image.Load(fileName))
{
cadImage.UpdateSize();
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.PageWidth = 1600;
rasterizationOptions.PageHeight = 1600;
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = rasterizationOptions;
cadImage.Save(outPath, pdfOptions);
}

The issues you have found earlier (filed as CADJAVA-501) have been fixed in this update.