Can't change XML section node IsLandscape from code


#1

We create m_Section like this:

Dim xmlFile As String = HttpContext.Current.Server.MapPath("…/xml/ReportInformation.xml")
m_Pdf.BindXML(xmlFile, Nothing)
Dim m_Section As Section = m_Pdf.Sections(“Section1”)

Then we say:

m_Section.IsLandscape = False

And we can see in debugging that this is set and remains set.

HOWEVER, the page always prints in landscape.

How can we force the page to print in portrait?

Thanks,

Edward


#2

Dear Edward,

Thank you for considering Aspose.

I can’t reproduce this error. Here is my XML and code:

<?xml version="1.0" encoding="utf-8" ?>



page 1




page 2




pdf.BindXML(“E:/Projects/CSharp/Pdf-bak/Xml/Test/Test.xml”,Nothing)
Dim sec1 As Section = pdf.Sections(1)
sec1.IsLandscape = false

pdf.Save(“e:\temp\Test.pdf”)

In the resulting PDF file, the first page prints in landscape and the second page prints in porteait.

Did you set the IsNewPage property of Section to true?