how to set the page orientation [PDF]

Hi,
how does one set the page orination when creating a PDF file using VB.Net?
TIA,
Kari

3 Replies

AJ Ajish Syncfusion Team October 26, 2006 07:43 PM UTC

Hi Kari,

Essential PDF supports the Orientation of pages in a document. The PageOrientation property of a PDF document is used to assign the orientation type. LandScape Orientation and Portrait Orientation are supported.

Here is a sample code.

[C#]

// To create Landscape orientation.
pdfDoc.LastPage.Orientation = PageOrientation.Landscape;

// Create second page.
pdfDoc.CreatePage();

// To create Portrait Orientation.
pdfDoc.LastPage.Orientation = PageOrientation.Portrait;



[VB.NET]

' To create Landscape orientation.
pdfDoc.LastPage.Orientation = PageOrientation.Landscape

' Create second page.
pdfDoc.CreatePage()

' To create Portrait Orientation.
pdfDoc.LastPage.Orientation = PageOrientation.Portrait

you can find a sample at the following path demonstrating various page setting that can be made with Essential PDF

C:\Program Files\Syncfusion\Essential Studio\4.3.0.30\Windows\Pdf.Windows\Samples\Grid Model\Settings\PageSettings


Please take a look and let me know if you need any further assistance.

Regards,
Ajish.


>Hi,
how does one set the page orination when creating a PDF file using VB.Net?
TIA,
Kari


KP Kari Paukku October 26, 2006 09:21 PM UTC

Ok, it may be here where my problem is: I would like to use the "Flow Model" (not the grid model).

Does the Flow model also have similar functionality?

Thanks for the help,
kari



DK Dhivya K Syncfusion Team October 27, 2006 04:17 AM UTC

Hi Kari,

We do have option for setting page orientation in Flow model. Here are some code to do this:

[C#]
// Create a section in pdf document
IPDFSection section = document.AddSection();

// Create Landscape orientation.
section.PageSetup.Orientation = PageOrientation.Landscape;

// Create another section in new page
section=document.AddSection();
section.BreakCode = SectionBreakCode.NewPage;

// Create Portrait orientation.
section.PageSetup.Orientation = PageOrientation.Portrait;

[VB.Net]
'Create a section in pdf document
Dim section As IPDFSection = document.AddSection()

'Create Landscape orientation.
section.PageSetup.Orientation = PageOrientation.Landscape

'Create another section in new page
section = document.AddSection()
section.BreakCode = SectionBreakCode.NewPage

'Create Portrait orientation.
section.PageSetup.Orientation = PageOrientation.Portrait

Here is a sample for your reference:
PageOrientation.zip

Please take a look into it and let me know if you have any queries.

Regards,
Dhivya.

Loader.
Up arrow icon