Converting SVG file to PDF - now want to rotate PDF from Portrait to Landscape

Very simple conversion of SVG output to pdf file. However, it defaults to a portrait orientation. Is there a simple way to change the orientation to landscape?

// create and tune conversion options

Aspose.Pdf.

SvgLoadOptions options = new SvgLoadOptions();

options.ConversionEngine = Aspose.Pdf.

SvgLoadOptions.ConversionEngines.NewEngine;

// load PDF document from SVG

Aspose.Pdf.

Document pdfDocument = new Aspose.Pdf.Document(mydir + "assembly.svg", options);

pdfDocument.PageLayout.IsLandscape =

"True";

// Save PDF document

pdfDocument.Save(mydir +

"assembly.pdf");

// create and tune conversion options

Aspose.Pdf.

SvgLoadOptions options = new SvgLoadOptions();

options.ConversionEngine = Aspose.Pdf.

SvgLoadOptions.ConversionEngines.NewEngine;

// load PDF document from SVG

Aspose.Pdf.

Document pdfDocument = new Aspose.Pdf.Document(mydir + "assembly.svg", options);

pdfDocument.PageLayout.IsLandscape =

"True";

// Save PDF document

pdfDocument.Save(mydir +

"assembly.pdf");

Hi Jim,

Thanks for using our APIs.

In order to accomplish your requirements, please try using the following code snippet. In case you encounter any issue, please share the resource files, so that we can test the scenario in our environment.

C#

// create and tune conversion options
Aspose.Pdf.SvgLoadOptions svgoptions = new Aspose.Pdf.SvgLoadOptions();

//        svgoptions.ConversionEngine =
//Aspose.Pdf.SvgLoadOptions.ConversionEngines.NewEngine;

// load PDF document from SVG
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(@"C:\pdftest\img_04.svg", svgoptions);

//  pdfDocument.Pages[1].PageInfo.IsLandscape = true;

// Save PDF document
// pdfDocument.Save(@"C:\pdftest\img_04_Converted.pdf");

Aspose.Pdf.PdfPageEditor ppe = new Aspose.Pdf.PdfPageEditor();
ppe.BindPdf(pdfDocument);

Aspose.Pdf.PageSize ps = new Aspose.Pdf.PageSize(421, 595);
ps.IsLandscape = true;

ppe.PageSize = ps;
ppe.Save(@"C:\pdftest\img_04_Landscape.pdf");