We want the user to be able to download a PDF image when they go to print. However, when the user goes to open the file, we get an error message. Below is the notes we have on the problem. Do you have any ideas?
I tried to print the page to a PDF file,
By calling
string name = string.Format("athena-{0}.pdf", Guid.NewGuid().ToString().Substring(0, 8));
byte[] data = BuildPDF();
if (data != null)
{
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.AddHeader("Content-Type", "binary/octet-stream");
response.AddHeader("Content-Disposition", "attachment; filename=" + name + "; size=" + data.Length.ToString());
response.Flush();
response.BinaryWrite(data);
response.Flush();
response.End();
}
in “Print” button click handler.
If I make the Print user control in AJAX UpdatePanel, I got an error:
Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerParserErrorExceptio n
I have tried to research this, but I am not able to solve the problem. Any Advice??
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks