Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Stream to PDF

Reply
Thread Tools

Re: Stream to PDF

 
 
Mark Rae
Guest
Posts: n/a
 
      12-12-2006
"Badis" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Could pls send a few lines of code because I really don't have a clue how
> to
> do it!!?


Hmm - are you trying to stream an *existing* PDF document, or are you trying
to *create a new* PDF document and stream that to the browser...?


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmFkaXM=?=
Guest
Posts: n/a
 
      12-13-2006
I have saved the content of my PDF as a stream in my database the way that if
I loose (or delete) my current PDF document from disk I can call the saved
stream from my database and display it again in a new pdf document.


"Mark Rae" wrote:

> "Badis" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> > Could pls send a few lines of code because I really don't have a clue how
> > to
> > do it!!?

>
> Hmm - are you trying to stream an *existing* PDF document, or are you trying
> to *create a new* PDF document and stream that to the browser...?
>
>
>

 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      12-13-2006
"Badis" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

>I have saved the content of my PDF as a stream in my database the way that
>if
> I loose (or delete) my current PDF document from disk I can call the
> saved
> stream from my database and display it again in a new pdf document.


OK - so, I take it that you are trying to stream a PDF file saved on your
server's file system, not stream the binary data stored in SQL Server...?

In which case:

Response.ContentType = "application/pdf";
Response.WriteFile(MapPath("xxxxxxxx.pdf"));
Response.End();


 
Reply With Quote
 
=?Utf-8?B?QmFkaXM=?=
Guest
Posts: n/a
 
      12-13-2006
No, it's the way arround. I'm trying to stream the binary data stored in
database called "Cache" bit simillar to SQL Server to PDF

Thanks

"Mark Rae" wrote:

> "Badis" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> >I have saved the content of my PDF as a stream in my database the way that
> >if
> > I loose (or delete) my current PDF document from disk I can call the
> > saved
> > stream from my database and display it again in a new pdf document.

>
> OK - so, I take it that you are trying to stream a PDF file saved on your
> server's file system, not stream the binary data stored in SQL Server...?
>
> In which case:
>
> Response.ContentType = "application/pdf";
> Response.WriteFile(MapPath("xxxxxxxx.pdf"));
> Response.End();
>
>
>

 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      12-13-2006
"Badis" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> No, it's the way arround. I'm trying to stream the binary data stored in
> database called "Cache" bit simillar to SQL Server to PDF


Hmm - OK, well this might be of help:
http://www.codeproject.com/aspnet/ImageBinaryStream.asp

It shows how to extract binary data (in this case, a JPEG rather than a PDF)
from a database (in this case, SQL Server rather than "Cache", whatever that
is...) and stream it to the browser - the principle is the same...


 
Reply With Quote
 
=?Utf-8?B?QmFkaXM=?=
Guest
Posts: n/a
 
      12-14-2006
Thank you very much Mark you have been very helpful its working but I have
got only one issue is that when excuting this line of code to open the PDF:
Response.BinaryWrite(myfile); // myfile is the stream converted to byte[]
type
the Acrobat Reader 8 is not opening it but asking me if I want to save it or
Cancel!!?So, always I have to save disk before opening it




"Mark Rae" wrote:

> "Badis" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> > No, it's the way arround. I'm trying to stream the binary data stored in
> > database called "Cache" bit simillar to SQL Server to PDF

>
> Hmm - OK, well this might be of help:
> http://www.codeproject.com/aspnet/ImageBinaryStream.asp
>
> It shows how to extract binary data (in this case, a JPEG rather than a PDF)
> from a database (in this case, SQL Server rather than "Cache", whatever that
> is...) and stream it to the browser - the principle is the same...
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Postscript to PDF with pdf-tools, pdf-writer, or other Sean Nakasone Ruby 1 04-14-2008 09:13 PM
PDF::Writer, create pdf and insert in other pdf file. Ricardo Pog Ruby 1 03-26-2008 08:24 PM
get stream mode flags from an opened stream Alexander Korsunsky C++ 1 02-17-2007 10:38 AM
How to GET multi-word input from a *file* stream as opposed to a *console* stream? sherifffruitfly@gmail.com C++ 9 04-27-2006 04:14 PM
Doing readline in a thread from a popen4('rsync ...') stream blocks when the stream ends. Rasmusson, Lars Python 1 04-30-2004 08:10 AM



Advertisments