Dears, I am using PDFSharp, version 1.32, GDI+ build. I have a C# application which uses System.Drawing.Graphics to draw various graphics on GDI. The Graphics is from a PrintPageEventArgs event e, so it is e.Graphics. Now I would like to do the drawings on PDF, so here is what I have come up with so far:
string filename = String.Format("{0}_tempfile.pdf", Guid.NewGuid().ToString("D").ToUpper()); PdfDocument s_document = new PdfDocument(); PdfPage page = new PdfPage(); page = s_document.AddPage(); XGraphics gfx = XGraphics.FromPdfPage(page); //gfx.Graphics.xxxxx methods are used here to draw //????????????? Need help here! s_document.Save(filename); Process.Start(filename);
I use gfx.Graphics to access all the routines that are used currently in GDI+, no problem so far. So here is the question: How do I put those drawings on the PDF page. I could not find any examples or guidelines online.
|