PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 8:47 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jan 28, 2010 11:00 am 
Offline

Joined: Thu Jan 28, 2010 10:52 am
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 28, 2010 1:58 pm 
Offline

Joined: Thu Jan 28, 2010 10:52 am
Posts: 2
Hello again,

I managed to fix it myself. I just adapted the Pagesize.cs and Pagesizeconverter.cs to include the measurements for A4 Landscape before building the PdfSharp.dll again.

Regards,
Andre


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 367 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group