Re: Problem sending PDF as stream using iTextSharp

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Jul 11, 12:31 pm, "antonyliu2...@xxxxxxxxx"
<antonyliu2...@xxxxxxxxx> wrote:
I have no problem writing PDF file to hard drive on the fly with
iTextSharp, but have had no luck in sending PDF as a stream in my
asp.net web application.

I am simply copying the example at

http://itextsharp.sourceforge.net/examples/Chap0105.cs

But, Adobe Acrobat reader complains that the file has been damaged or
cannot be opened, or says something like "if the file was sent as an
email attachment, it was not properly decoded" or something to that
effect.

At thewww.asp.netforum,http://forums.asp.net/p/1093198/1643956.aspx#1643956
, someone says that we need to reset the value of the memory stream
position to 0. I tried that with no luck.

Any idea about how to shoot this problem? Thanks.

I searched a little bit, and it looks like it's gonna be very hard to
send PDF as stream without saving it to file first. The workaround
would be to save it to file, and then redirect to that pdf file. When
the session expires, remove that pdf file to avoid accumulation of
junk files on the server.

.



Relevant Pages

  • Re: .NET 2.0 Web App - streaming PDF
    ... I was able to use your code successfully to stream the PDF into the browser ... using Visual Web Developer Express. ... Dim stream1 As IO.FileStream ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: PDF Primary Hint Stream
    ... I have not clew what a hint stream is? ... of linearized PDFs on the web. ... Can we create a PDF sample from Acrobat and almost all the Linearized ...
    (comp.text.pdf)
  • Re: Problem sending PDF as stream using iTextSharp
    ... Did you set the Response.ContentType header to the PDF Mime type? ... writing to the Response Output stream? ... default.aspx web form, on which there is a button which says "export ... I tried that with no luck. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Stream pdf to browser
    ... from backend file or database and stream them to web application(let web ... application flush the pdf content to client). ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Need help with WebBrower Control
    ... I've not streamed from a string, I've only streamed PDF using ... Response.ContentType = "application/doc" for the Word file. ... stream into the WebBrowser control. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)