when I use pdf1.Save(“C:\Users\Downloads\Report.pdf”);…the pdf file contains all the data…Working fine
Hi Som,
System.IO.MemoryStream finalStream = new System.IO.MemoryStream();<o:p></o:p>
string documentTitle = “testPDF”;<o:p></o:p>
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(“E:/data/helloworld.pdf”);<o:p></o:p>
pdf.Save(finalStream);<o:p></o:p>
byte[] downloadBytes = finalStream.ToArray();<o:p></o:p>
HttpContext.Current.Response.AddHeader(“Content-Type”, “application/pdf”);<o:p></o:p>
//To download<o:p></o:p>
HttpContext.Current.Response.AddHeader(“Content-Disposition”, “attachment; filename=” + documentTitle + “.pdf”);<o:p></o:p>
HttpContext.Current.Response.BinaryWrite(downloadBytes);<o:p></o:p>
HttpContext.Current.Response.End();<o:p></o:p>
<o:p> </o:p>
<o:p>
</o:p>
<o:p>Please feel free to contact us for any further assistance.</o:p>
<o:p>
</o:p>
Best Regards,
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(“E:/data/helloworld.pdf”);
Hi Som,
System.IO.MemoryStream finalStream = new System.IO.MemoryStream();<o:p></o:p>
string documentTitle = “testPDF”;<o:p></o:p>
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(“E:/data/helloworld.pdf”);<o:p></o:p>
pdf.Save(finalStream);
…
…
Please feel free to contact us for any further assistance.
Best Regards,