Free Support Forum - aspose.com

How to convert CDR file to PDF using aspose imaging for .net?

I would like to use Aspose.Imaging for.net offline solution for converting CDR file to PDF. Can you please provide the .net code to do the same. If you can provide any sample link of Github that is converting CDR file to PDF through Aspose.Imaging offline solution would be great.

P.S: Need to have solution for offline conversion not online in .net.

Thanks.

@vvorld,

I have observed your requirements and suggest you to please try using following sample code on your end to serve the purpose.

            string[] fileNames = { "3.60.cdr", "4.20.cdr" };
            string baseFolder = @"D:";
            foreach (string fileName in fileNames)
            {
                string inputFilePath = Path.Combine(baseFolder, fileName);
                string outputFileName = inputFilePath + ".pdf";
                using (Image image = Image.Load(inputFilePath))
                {
                    PdfOptions pdfOptions = new PdfOptions();
                    CdrRasterizationOptions rasterizationOptions = new CdrRasterizationOptions();
                    rasterizationOptions.PageWidth = image.Width;
                    rasterizationOptions.PageHeight = image.Height;
                    pdfOptions.VectorRasterizationOptions = rasterizationOptions;
                    image.Save(outputFileName, pdfOptions);
                }
            }

Thanks. Appreciate it. I will try.

@vvorld,

You are welcome.