We are attempting to the set page orientation using Aspose.pdf to landscape and portrait. We have tried several options and none seem to be working. When the first page of the PDF shows up, it appears to be landscape. When the page goes to page 2, it changes to portrait. We want to keep it landscape. How can we do this?
When we set up the page the first time, we use this code:
Dim page As Page = document.Pages(1)
Dim tempHeight As Decimal
Dim tempFontHeight As Decimal
tempFontHeight = CDec(1.055 * Fontsize * 1.02)
tempHeight = 1055 * PageHeight
page.SetPageSize(PageWidth, tempHeight) ’ 1055 is the height of the font Courier
Dim pageMargin As New MarginInfo
pageMargin.Left = Margin
pageMargin.Top = CDec(tempHeight) - CDec(tempHeight - Margin + tempFontHeight)
page.PageInfo.Margin = pageMargin
Later on, in the code we try and do it again this way but it still switches to portrait.
Dim page As Page = document.Pages(1)
Dim tempHeight As Decimal
Dim tempFontHeight As Decimal
tempFontHeight = CDec(1.055 * Fontsize * 1.02)
tempHeight = 1055 * PageHeight
page.SetPageSize(PageWidth, tempHeight) ' 1055 is the height of the font Courier
Dim pageMargin As New MarginInfo
pageMargin.Left = Margin
pageMargin.Top = CDec(tempHeight) - CDec(tempHeight - Margin + tempFontHeight)
page.PageInfo.Margin = pageMargin
page = document.Pages(1)
page = document.Pages.Add
text.IsInNewPage = True
priorLine = " "