Free Support Forum - aspose.com

File missing data on conversion

the pdf that is created, using the Aspose.Cad package, is missing data.
I have attached the source drawing, and the pdf output
any help would be greatly appreciated
thanks

here is the c# code, used to convert

 private void ConvertDwgToPdfWithOptions(string sourceFilePath, string destinationFilePath)
    {
        var stream = new MemoryStream(Resources.Aspose_CAD_NET);

        var license = new License();
        license.SetLicense(stream);

        using (Aspose.CAD.FileFormats.Cad.CadImage cadImage = (Aspose.CAD.FileFormats.Cad.CadImage)Image.Load(sourceFilePath))
        {
            // Iterate over the items of CadStyleDictionary
            foreach (CadStyleTableObject style in cadImage.Styles)
            {
                // Set the font
                style.PrimaryFontName = "ISOCP";// "Arial";
            }

            char firstCharacter = Path.GetFileName(sourceFilePath)[0];

            //The first digit of the drawing number dictates the page size, all drawings are 'landscape' 
            //11 x 8.5  => [1,2,3]
            //17 x 11   => [4,5]
            //22 x 17   => [6,7]
            //34 x 22   => [8,9]
            float pageWidth = (firstCharacter.Equals('8') || firstCharacter.Equals('9')) ? 34f
                : (firstCharacter.Equals('6') || firstCharacter.Equals('7')) ? 22f
                : (firstCharacter.Equals('4') || firstCharacter.Equals('5')) ? 17f
                : 11f;

            float pageHeight = (firstCharacter.Equals('8') || firstCharacter.Equals('9')) ? 22f
                : (firstCharacter.Equals('6') || firstCharacter.Equals('7')) ? 17f
                : (firstCharacter.Equals('4') || firstCharacter.Equals('5')) ? 11f
                : 8.5f;

            var rasterizationOptions = new CadRasterizationOptions
            {
                BackgroundColor = Color.White,
                PageWidth = pageWidth,   
                PageHeight = pageHeight,
                Margins = new Margins { Bottom = 36, Left = 36, Top = 36, Right = 36 },
                UnitType = UnitType.Inch
            };

            var pdfOptions = new PdfOptions
            {
                VectorRasterizationOptions = rasterizationOptions
            };

            //Export the DWG to PDF
            cadImage.Save(destinationFilePath, pdfOptions);
        }
    }

here is the drawing, and the pdf
thanks

dwg-pdf.zip (4.2 MB)

@lrecords

Can you please share that which data is missing in exported PDF along with snapshot of the difference. I am also assuming that you are using latest Aspose.CAD for .NET 21.1 on your end.

this was created using aspose.CAD for .net 21.1.0
there are major portions of the drawing, that do not get converted for some reason, attached is a screenshot, basically the whole center area does not exist on the pdf output

differences.png (625.4 KB)

@lrecords

Can you please check the attached PDF for your reference. It has been generated using Aspose.CAD for .NET 21.1.

87309A-1.pdf (2.8 MB)

this was not generated with the atached c# code, was it? Its different colors, different size, etc.
Is there any c# code reference to compare?

@lrecords

Can you please try setting the CadDrawType mode to Object Color on your end and see if that works for your not.

I end up with the same result, large portion of drawing missing, now with colors that make the text unreadable
using Aspose.CAD for .net version 21.1.0 (latest according to NuGet package manager)
87309A-1.pdf (2.8 MB)

@lrecords

I have created an issue with ID CADNET-1350 in our issue tracking system to further investigate and resolve the issue on our end. This thread has been linked with the issue so that you may be notified once the issue will be addressed.