Free Support Forum - aspose.com

Landscape

how to create a pdf in landscape. thanks

Hi,


Thanks for your interest in our products.

Please try using the following code snippet to accomplish your requirements. For your reference, I have also attached a sample PDF file generated with following code snippet.

[C#]

//Create pdf document<o:p></o:p>

Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();

//Add a section into the pdf document

Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();

// set page orientation as landscape

sec1.IsLandscape = true;

//Add a text paragraph into the section

sec1.Paragraphs.Add(new Aspose.Pdf.Generator.Text("Hello World in LandScape"));

//Save the document

pdf1.Save("c:/pdftest/HelloWorld.pdf");