We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Export to PDF is zoomed out

Hi,

I’m trying to convert a DWG file to PDF using the .NET implementation of ASPOSE.CAD, but the end result is zoomed out to the point that my entire drawing is just a small dot in the PDF. I’ll need to convert many DWG files to PDF is there a generic way to find a suitable bounding box for generated image?

static void Main(string[] args)
{

        string sourceFilePath = @"C:\DwgStuff\SB-SCH-1LWP-LEVEL03-DRW-AV_Type 5.dwg";
        using (var cadImage = (CadImage)Aspose.CAD.Image.Load(sourceFilePath))
        {
            //Export to pdf
            CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
            rasterizationOptions.DrawColor = Color.Red;
            rasterizationOptions.Layouts = new[] { "Layout2" };
           
            PdfOptions pdfOptions = new PdfOptions();

            pdfOptions.VectorRasterizationOptions = rasterizationOptions;
            cadImage.Save(@"C:\DwgStuff\Export3DImagestoPDF_out.pdf", pdfOptions);
        }
    }

@daniel4567,

I have observe the issue specified and request you to please share the source DWG along with generated PDF for reference and further investigation on our end.

Please find the attached zip file containing the project and the DWG file as well as the pdf. Make sure to update the absolute paths in the project to match where you put your DwgStuff folder. Please note that there is a red dot in the right side of the PDW. If I change the draw color the dot color changes. I base my assumption that the image is really zoomed out on that fact. Good luck. I hope you’ll be able to help me solve this issue. Thanks in advance.

@daniel4567,

I think you have missed to share the information with us. Can you please share the requested information.

This link has a zip file containing the project files and the DWG https://drive.google.com/open?id=17RpHh0jP9HtCWec-RDidvmHq40_2Wk54. I tried using the upload function in here but it doesn’t work.

@daniel4567,

I have worked with file shared by you using Aspose.Cad for .NET 18.3 and have been able to observe the issue. A ticket with ID CADNET-632 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.

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