Free Support Forum - aspose.com

Converted image from dxf doesn't include all elements; layer is not removed completely

DXF-Drawings.zip (534.5 KB)
Hi Aspose,
we are software partner for a bigger company in Germany (it’s no secret, if you open the attached files) and we are using Aspose.CAD in our productive environment since last year.

Our job is to convert DXF images into SVG images and place them together with product data into a PDF sheet. We have to remove the border and textbox (these are in layers with specified names) from the DXF and - if possible - zoom and center to the remaining visible objects (“scale to fit”).

Maybe you can give me an advice for the latter, because I don’t find anything useful. I ended up with getting the dimensions of each CAD element - which is simple for lines and circles, but not for texts or some other elements.

But to the main reason for my request:
The attached dxf file has two problems which I can’t solve.

First: There are some texts missing (see attached file “Missing_texts.jpg”) and compare it to the dxf file.
Second: When I remove the layer “70_GS” which contains the border and the textbox on the lower right corner, some text of this textbox remains (see attached file “G_I202_XX_55521V_without_border.pdf”).

I viewed the DXF file with “Autodesk DWG Trueview” and everything seems to be ok with the DXF file.

Both pdfs are generated with your sample code from github.
I used the examples “ExportDXFToPDF” and “ExportDXFSpecificLayerToPDF”.
For the second example I retrieved all Layers from the CADImage, removed the “70_GS” and put the remaining into the CadRasterizationOptions for the PDF conversion.

Any help is appreciated.
Kind regards,
Stefan

@Steff

In order to investigate the issue further on our end, I request you to please share the source code that you have used to reproduce the issue on your end and that we may try on our end. I am also assuming that you are using the latest version of Aspose.CAD for .NET 21.3 on your end. Please also try using the licensed version instead of evolutionary version on your end too.

Hello,
yes I’m using the 21.3.0 version. We are using the licensed version in our productive environment and there the problem was found.
I simulated the issue in your example code to be sure, that none of our other code is causing this problem and you can test it on your own.

I guess you don’t need your whole example code https://github.com/aspose-cad/Aspose.CAD-for-.NET

Find attached the two classes I’ve changed.
DXF-Drawings.zip (1.6 KB)

Should I convert the DXF with the license file to provide the PDFs without the watermark to proove that we have licensed the product?

Kind regards,
Stefan

@Steff

No, if you are using unlicensed version then apart from watermark some of rendering features also get limited. Moreover, I have seen your code but can’t see any source file and generated output having issue that we may test on our end.

Hi,
the errors were found on the production system (where of course the licensed version is running), but I put the license file now into the example solution. Find the created files attached.

I’m not sure if I understand “…but can’t see any source file and generated output having issue…” because I provided the source dxf file and the generated pdf documents in my first post. But I attached it again (this time without the watermark, because I used the licensed version) on this post.

Kind regards,
Stefan
DXF-Drawings_with_license.zip (523.2 KB)

@Steff

Thank you for sharing the elaboration. We need to investigate this issue further on our end. A ticket with ID CADNET-8050 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.

Thank you!

Maybe you can answer my question from my first post meanwhile:
Is there a function like “scale-to-fit” if I remove the border of the dxf image and I want the remaining
elements to be perfect zoomed and centered?

I solved this problem by determing the extends of each CAD element and creating a new Viewport (CadVportTableObject) with the calculated CenterPoint, ViewHeight and ViewAspectRatio.
But I wonder If there is not an easier method?

Kind regards,
Stefan

@Steff

I have linked the information shared in our issue tracking system and we will share the further feedback with you as soon as it will be shared by team.