Enum PdfPageOrientation
Enumerator that represents the PDF page orientations.
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public enum PdfPageOrientation
Remarks
Default value is Portrait. To know more about document settings refer this link.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Set the page size.
document.PageSettings.Size = PdfPageSize.A4;
//Change the page orientation to landscape.
document.PageSettings.Orientation = PdfPageOrientation.Landscape;
//Add a page to the document.
PdfPage page = document.Pages.Add();
//Create PDF graphics for the page.
PdfGraphics graphics = page.Graphics;
//Create the PDF font instance.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);
//Draw the text.
graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document.
document.Close(true);
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Set the page size.'
document.PageSettings.Size = PdfPageSize.A4
'Change the page orientation to landscape.
document.PageSettings.Orientation = PdfPageOrientation.Landscape
'Add a page to the document.
Dim page As PdfPage = document.Pages.Add()
'Create PDF graphics for the page.
Dim graphics As PdfGraphics = page.Graphics
'Create the PDF font instance.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 20)
'Draw the text.
graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, New PointF(0, 0))
'Save document to disk.
document.Save("Output.pdf")
'Close the document.
document.Close(True)
Fields
Name | Description |
---|---|
Landscape | Landscape orientation. |
Portrait | Portrait orientation. |