Hello,
I am using the following code to preview a document. This code is adapted from the samples supplied:
Code:
private void button1_Click(object sender, EventArgs e)
{
Renderer renderer = new Renderer();
frmDoc form = new frmDoc();
form.RenderEvent = new PdfSharp.Forms.PagePreview.RenderEvent(Render1);
form.Show();
}
Code:
public void Render1(XGraphics gfx)
{
//Initialize Renderer Components
XFont font = new XFont("Arial", 16);
XPen pen = XPens.Navy.Clone();
pen.Width = 2.5;
XPen pen1 = XPens.Black.Clone();
pen1.Width = 1;
XPen pen2 = XPens.Black.Clone();
pen2.Width = 1.5;
//Add Text to the Form Object
gfx.DrawString("INCIDENT FORM", new XFont("Arial", 48, XFontStyle.Bold), XBrushes.Black, 400, 20, XStringFormats.Center);
...
XGraphicsState state = gfx.Save();
gfx.Restore(state);
}
This is working absolutely fine. However I would like to preview that page in Landscape format and am not able to do so.
Is this possible? If yes could someone please explain how?
Thanks,
Andre