Writing new content on a page rotated using page.SetRotation().

Q: I’m trying to put a page in “landscape” mode, but I’m apparently
doing something wrong. Below is part of my code. I first tried the
e_90 rotation. The page is rotated OK, but the text I write to the
page is upside down. So I figured maybe e_270 could do the trick, but
the text is still upside down. How to rotate the page and have the
text rightside up?

Thanks for your help.

======= code snippet ========

PDFNet.Initialize();
PDFNet.SetResourcesPath(ResourcePath);
PDFDoc doc = new PDFDoc();

eBuilder = new ElementBuilder();
eWriter = new ElementWriter();
Page currentPage = doc.PageCreate();

if (CurrentOrientation == Orientation.LANDSCAPE)
      currentPage.SetRotation(Page.Rotate.e_270);

eWriter.Begin(currentPage);

======= end of code snippet ========
------
A: You may want to set the page rotation _after_ writing new content
to the page. For example:

======= code snippet ========
PDFDoc doc = new PDFDoc();

ElementBuilder eBuilder = new ElementBuilder();
ElementWriter eWriter = new ElementWriter();
Page currentPage = ...
eWriter.Begin(currentPage);
...
eWriter.End();

// Set the page rotation...
if (CurrentOrientation == Orientation.LANDSCAPE)
      currentPage.SetRotation(Page.Rotate.e_270);
======= end of code snippet ========

The problem is that if you set the rotation on page before writing
content, ElementWriter will try to compensate for the rotation so you
may get unexpected results.