TH-Soft wrote:
Hi!
You can invoke "pdf.Save()" with a stream. Use a MemoryStream and you will have the PDF file in it. Use GetBytes for the stream to get a byte array.
See lines 21 through 26 in the first code block here:
http://pdfsharp.net/wiki/Clock-sample.ashxThank you for the reply,
I am trying to incorporate this into my code, just to clarify. If I just want to store the pdf file in a variable how would I proceed from here?
this is my code right now
MemoryStream stream = new MemoryStream();
document.Save(stream, false);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "output/pdf";
HttpContext.Current.Response.AddHeader("content-length", stream.Length.ToString());
HttpContext.Current.Response.BinaryWrite(stream.ToArray());
i am not sure how to store the pdf file to use in another method