Free Support Forum - aspose.com

Problem exporting DWG to PDF


#1

Hello,

I’m trying Aspose CAD library (Demo version) to convert a .DWG file into a .PDF.

However, I have a problem, my .DWG file contains an OLE picture and it isn’t present in the generated PDF file.

Is there a way to get this picture in my PDF file?

Here is my code:

string MyDir = @“C:\temp”;
string sourceFilePath = MyDir + “test.dwg”;
using (CadImage image = (CadImage) Aspose.CAD.Image.Load(sourceFilePath))
{

            Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
            rasterizationOptions.PageWidth = 1200;
            rasterizationOptions.PageHeight = image.Height;
            rasterizationOptions.DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor;
         
            Aspose.CAD.ImageOptions.PdfOptions pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions();
            pdfOptions.VectorRasterizationOptions = rasterizationOptions;
            pdfOptions.Rotation = RotateFlipType.Rotate90FlipNone;
            
            //Export CAD to PDF
            image.Save(MyDir + "CAD.pdf", pdfOptions);

}


#2

@raziel229,

Can you please share source DWG file and generated result with us so that we may test that on our end and help you out.


#3

@ Adnan.Ahmad

Thanks for your reply,

Here is a link to download the files :

https://drive.google.com/drive/folders/1XXaiiP0XbmINgQ7LhtmrlTwL39gHFbnf?usp=sharing

This is the Logo “Deny security” that is not present in the pdf file.


#4

@raziel229,

I have worked with source file shared by you using Aspose.CAD 19.2 and unable to observe issue. I have also shared my generated result with you. Can you please share which Aspose.CAD version you are using on your end. Also please share comparison screenshot pointing towards issue.TestCAD.pdf (891.6 KB)


#5

Hello,

Thank you for your reply.
Unfortunately, in the PDF file you generated, I cannot see the picture I was expecting to see.
Please take a look at the attached files in my reply to see what I mean.
PdfFile.png (3.4 KB)
DWGFile.png (10.8 KB)

For reference, I’m using Aspose.CAD 19.2 for .net.


#6

@raziel229,

I have worked with the file shared by you and have been able to observe the issue specified. An issue with ID CADNET-784 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.