We start by creating a PDF document. We use two transforms to
apply a generic 90 degree rotation around the center of the
document and rotate the drawing rectangle by the same amount. After
applying our rotation we add some text to the page.
using (Doc doc = new Doc()) {
// apply a rotation transform
double w = doc.MediaBox.Width;
double h = doc.MediaBox.Height;
double l = doc.MediaBox.Left;
double b = doc.MediaBox.Bottom;
doc.Transform.Rotate(90, l, b);
doc.Transform.Translate(w, 0);
// rotate our rectangle
doc.Rect.Width = h;
doc.Rect.Height = w;
// add some text
doc.Rect.Inset(50, 50);
doc.FontSize = 96;
doc.AddText("Landscape Orientation");
Using doc As New Doc()
' apply a rotation transform
Dim w As Double = doc.MediaBox.Width
Dim h As Double = doc.MediaBox.Height
Dim l As Double = doc.MediaBox.Left
Dim b As Double = doc.MediaBox.Bottom
doc.Transform.Rotate(90, l, b)
doc.Transform.Translate(w, 0)
' rotate our rectangle
doc.Rect.Width = h
doc.Rect.Height = w
' add some text
doc.Rect.Inset(50, 50)
doc.FontSize = 96
doc.AddText("Landscape Orientation")