DWG to PDF Conversion Page Size Issue


#1

I have some code and some sample DWG files that were downloaded from AutoDesk website. The code I am using looks at the PlotPaperSize.Width and PlotPaperSize.Height specified in the default layout (“Model”) and sets the PDF PageWidth and PageHeight using these values to convert from millimeters to inches.

AutoCad1.dwg produces a PDF with page size 199.? x 129.? inches. This should be 17 x 11 inches. This was unexpected.

AutoCad2.dwg produces a PDF with page size 11 x 8.5 inches as expected.

I have several other DWG examples that produce the correct page size using this code if you need them, but this one file (AutoCad1.dwg) seems to produce a PDF with a huge page size.

I have included a .Net solution file using Aspose.CAD 17.12 and Aspose.PDF 18.1. If you run the example it will produce in bin/Debug the two PDF files pdf1.pdf and pdf2.pdf that correspond to the DWG example files that I have supplied.

What can I do to resolve this issue?

Thanks.


#2

Also, the upload of the example project that I have seems to have failed. Please advise.


#3

@trippshelnutt,

I have observed your comments. Can you please share source files and sample project via dropbox so that we may further investigate to help out.


#4

Hopefully this link from Google Drive will suffice…

https://drive.google.com/file/d/1c__Y9rhdytEM4AJzY5O2MOoQOs_IgRKD/view?usp=sharing

Thanks.


#5

@trippshelnutt,

I have worked with file shared by you using Aspose.CAD for .NET 17.12 and have been able to observe the issue. A ticket with ID CADNET-537 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.


#6

Thanks for kicking off a ticket for this.

I found another CAD file that demonstrates page sizing issues. Here is a link to the sample project and examples…

https://drive.google.com/open?id=1BHoBIEiLN7yiEsNONE5xA_-aEOnnzIDj

AutoCad1.dwg in this examples converts to bin/Debug/pdf1.pdf which is .43 x .33 inches instead of 11 x 8.5 as expected.

I think this is likely related to CADNET-537, but I wanted to make you aware of it since it is the opposite problem of the previous sample I sent (that one was too large and this one is too small).

Please let me know if I can do anything to help.


#7

@trippshelnutt,

I have observed your comments. I have shared sample code in a text file with you. This will help you to get expected result. Please check attachment and share feedback with us if there is still an issue.sample code (2).zip (1.0 KB)


#8

@Adnan.Ahmad Is that code publicly available anywhere? I’m running into the same issue and would like to see it, but thread attachments are private by default.


#9

@jpf,

I have observed your comments. I have shared dropbox link with you. You can download sample code from this link. Please share feedback with us if there is still an issue.