PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 11:29 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: Fri Mar 02, 2007 7:32 pm 
Offline

Joined: Fri Mar 02, 2007 4:40 pm
Posts: 2
Im trying to print a in-memory PDFDocument but at the end im receiving a big red cross instead of the original PDF, this is the code:

Code:
// PrintPage handler from the PrintDocument
void d_PrintPage(object sender, PrintPageEventArgs e)
        {           
            PdfDocument pdoc = new PdfDocument();
            PdfPage p = new PdfPage();
            p.Size = PdfSharp.PageSize.Perioskido;
            pdoc.Pages.Add(p);

            XImage a = XImage.FromFile(@"C:\b.pdf");
           
            XGraphics box = XGraphics.FromGraphics(e.Graphics, a.Size);
            box.DrawLine(XPens.Black, new Point(0, 0), new Point(100, 100));
            box.DrawImage(a, new XPoint(0, 0));
        }


Im drawing a line for testing purposes, at the end the line its being drawing successfully but not the PDF !!!!!!! :!: :?:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 08, 2007 11:50 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
>>XGraphics box = XGraphics.FromGraphics(e.Graphics, a.Size);

You try to draw on the window instead into the PDF document. This does not work because PDFsharp cannot render PDF.


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: Google [Bot] and 117 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