I want to save a PdfSharp.Pdf.PdfDocument by its Save method to a Stream, but it doesn\'t attach the PDF header settings to it. So when I read back the Stream and return it to t
I found simpler solution:
byte[] fileContents = null; using(MemoryStream stream = new MemoryStream()) { pdfDoc.Save(stream, true); fileContents = stream.ToArray(); }
Source: http://usefulaspandcsharp.wordpress.com/2010/03/09/save-a-pdf-to-a-byte-array-using-pdf-sharpmigradoc/