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 !!!!!!!