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.PageRequestManagerParserErrorException
I have tried to research this, but I am not able to solve the problem. Any Advice??
Register and join over 40,000 other developers!
Recent Topics
-
The Game You Are Waiting For?
WendellHarper - Dec 06 2020 01:21 PM
-
Quora and Reddit Backlinks
WendellHarper - Dec 06 2020 01:14 PM
-
Delete account
pindo - Jul 23 2020 01:33 AM
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

No replies to this topic
#1
Posted 11 March 2010 - 11:25 AM
Also tagged with one or more of these keywords: runtime, pdf
General Forums →
General Programming →
Pdftk Fill forms with special charsStarted by Vaielab, 26 Mar 2015 ![]() |
|
![]() |
||
General Forums →
General Computing →
How can I fix a corrupted PDF file?Started by slindseyd, 29 Oct 2014 ![]() |
|
![]() |
||
Language Forums →
C# →
My C# PDF selectionsStarted by bunny03, 22 Jul 2014 ![]() |
|
![]() |
||
Language Forums →
PHP →
Convert PDF to HMTLStarted by lucasdcsp, 14 Jul 2014 ![]() |
|
![]() |
||
![]() Runtime of printf() functionStarted by Anshdeb, 20 Apr 2014 ![]() |
|
![]() |
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download