#7 Landscape sections


Base PHPRtfLite only supports landscape for the entire document. Attached patch adds _isLandscape to sections. And prints \lndscpsxn when rendering the section with the option set. Solution might not be the most elegant since the document wide option could conflict, I haven't tested this as we don't use it.

Tested by generating a document with a portrait page, then a landscape page, and then another portrait page. Generated document renders (and more importantly prints) correctly from office 2007 and OpenOffice 3.0


  • Steffen Zeidler

    Steffen Zeidler - 2011-12-08

    Thx for posting the patch, I will try to take a look at it soon.

  • Steffen Zeidler

    Steffen Zeidler - 2011-12-08
    • assigned_to: nobody --> sigmaz
  • Steffen Zeidler

    Steffen Zeidler - 2011-12-22

    unfortunatly it did not work as expected, even with no page width or height defined. I checked that with TextMaker, OpenOffice 3.3 and MS Word 2010.
    I had a similar problem with setting landscape for the entire document. I had to switch height with width to make it work. Any suggestions to get your patch working correctly...

  • Rick

    Rick - 2012-01-03

    I've cross referenced the output of a marginal test script outside of our business logic, and can see the issue. Also with landscape on the entire document, which was in before our patch, and is completely unrelated (didn't touch any of the components that do that)

    it seems we were still flipping the page dimensions from an old attempt to fix this. This however doesn't work without also doing the \lndscpsxn (the printer doesn't respect it)
    the only way seems to be to do both.

    One possibility to get it to work would be to print \pgwsxn16840 \pghsxn11907 automatically after \lndscpsxn, but this is hardly an elegant solution. A similar approach would be to swap the width/height for \landscape

    The rtf spec unfortunately doesn't provide much insight into the matter, a small test with word shows that word does the exact same thing when inserting a \lndscpsxn. Leading me to believe this is actually the way the spec intended it.

    Leaving up to debate the logic behind the spec.

  • Steffen Zeidler

    Steffen Zeidler - 2012-01-03

    So at least it seems to be consequent that width and height have to be swapped. I will commit the patch with the necessary changes in the next days and leave a message here, when done so.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks