.net & XML & .pdf & error

Gang:

"There was an error opening this document. The file is damaged and could not be repaired."

Has anybody had issue with not being able to open pdf in any browser using .net application?

The pdf is fine if use Adobe to read it; or just a browser, but not when combined with .net.

This is probably related to dll hell with version 1.1 framework.
If anybody has pointers, I'll be researching the issue.

The pdf is accessed via datagrid HyperLinkColumn. It was working until recently. I'll be asking the network admin if has backup of application/bin/dll's.

[595 byte] By [TheManiac] at [2007-12-23]
# 1
I am having the same problem. My application prompts the user to either open or save the pdf. Once it has been saved, after opening it, it comes up with the same error message. The funny thing is, it was displaying the pdf earlier but once I started creating cases for generating pdfs having different layouts, things started going downhill.
crazyabtdotnet at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2

  • My boss doesn't give me a straight answer regarding what coding he does. When he sent me an e-mail, this is what he wrote:
    • "This is a rather unique approach that never dawned on me. This works on my PC at home using Adobe Reader 6.0. This looks great, hope this works when I implement it in PW DEV.
    • Response.Redirect("15EF5BC6-05D3-4F11-987E-E001A4EF9470.pdf")
    • Your approach eliminated 10-20 lines of code where we create and send a binary stream to the response.redirect."

  • The last line clued me in to that he is doing things the long way.
  • If you're doing the same, you might need to flush & close the stream. What basically occurs is that the pdf is rendered along with the aspx page causing generic error message.
    • pdf 'not =' pdf + aspx page

  • What I did was just send people straight to the page, without the code overhead.
  • I hope this helps.
TheManiac at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified