Property need to set on Convert from CGM to PDF

I try to convert CGM file to PDF by


Aspose.Pdf.CgmImportOptions options = new Aspose.Pdf.CgmImportOptions();
options.PageSize = new SizeF(100, 200);
Aspose.Pdf.Facades.PdfProducer.Produce(inputFilePath, options, outputFile);

But here i can set only Page Size property,
I need to set Page Margin, Page Orientation, Quality of images in that file, Ability to zoom content. How these operation possible?

Hi Varun,


Thanks for contacting support.

In order to convert CGM file to PDF format, please try using Aspose.Pdf.CgmLoadOptions class and in order to set page dimensions, orientation, you may specify/set values for Document object. However, I am afraid that current release is having some issues while setting page dimensions during CGM to PDF conversion. For the sake of correction, I have logged this problem
as PDFNEWNET-37020 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.

For conversion purposes, you may consider using following code snippet.

[C#]

// instantiate CGM LoadOptions object<o:p></o:p>

Aspose.Pdf.CgmLoadOptions options = new Aspose.Pdf.CgmLoadOptions();

// instantiate Document object with CGM file path as an argument

Aspose.Pdf.Document doc = new Document("c:/pdftest/CORVETTE.CGM", options);

// set the page dimensions are LandScape

doc.PageInfo.IsLandscape = true;

// set the height for first page of Document

doc.Pages[1].PageInfo.Height = 400;

// set width for frist page of document

doc.Pages[1].PageInfo.Width = 400;

// save resultant PDF

doc.Save(“c:/pdftest/CORVETTE.pdf”);

Hi Varun,


Thanks for your patience. We have further looked into the issue and suggest you following code snippet for setting page dimension during CGM to PDF conversion. Please note you need to set properties before the conversion. Hopefully it will help you to accomplish the task.

System.Drawing.SizeF pageSize = new
System.Drawing.SizeF(200f, 200F);<o:p></o:p>

Aspose.Pdf.CgmLoadOptions options = new CgmLoadOptions(pageSize);

Aspose.Pdf.Document doc = new Document("c:/pdftest/CORVETTE.CGM", options);

doc.Save("c:/pdftest/CORVETTE.pdf");

Please feel free to contact us for any further assistance.


Best Regards,

The issues you have found earlier (filed as PDFNEWNET-37020) have been fixed in Aspose.Pdf for .NET 9.4.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.