473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

stream/pdf/email

Hi there

In a web app I am making, I use a class which has a method which generates a
pdf from some xml data. The method accepts a "stream" parameter which I set
to the http-output-stream, and thereby the pdf is sent automatically to the
user's browser.

This has worked fine, but now there are some changes required.

Instead of streaming the pdf to the user's browser I need to include the pdf
in an email instead. Actually I need to send multiple emails with the same
pdf. What is a good way of doing this? What type of "output stream" can I
instantiate and send to the pdf-generation method, and include in multiple
emails?

Thanks for any advice,
Peter
Aug 23 '06 #1
5 2532
A filestream .. then include the file as an attachment to the emails.

Cheers,

Greg
"Peter Kirk" <pk@alpha-solutions.dkwrote in message
news:eh**************@TK2MSFTNGP05.phx.gbl...
Hi there

In a web app I am making, I use a class which has a method which generates
a pdf from some xml data. The method accepts a "stream" parameter which I
set to the http-output-stream, and thereby the pdf is sent automatically
to the user's browser.

This has worked fine, but now there are some changes required.

Instead of streaming the pdf to the user's browser I need to include the
pdf in an email instead. Actually I need to send multiple emails with the
same pdf. What is a good way of doing this? What type of "output stream"
can I instantiate and send to the pdf-generation method, and include in
multiple emails?

Thanks for any advice,
Peter

Aug 23 '06 #2
Hi, thanks.

Actually I found a solution where I use a MemoryStream (wrapped in a
BufferedStream). It also took me a while to realise there are two "email"
components in .net - with the .net2 System.Net.Mail seemingly much more
versatile.

Is a MemoryStream/BufferedStream ok for this - or are there advantages with
a FileStream?

Thanks,
Peter

"Greg Young" <dr*******************@hotmail.comskrev i en meddelelse
news:%2****************@TK2MSFTNGP06.phx.gbl...
>A filestream .. then include the file as an attachment to the emails.

Cheers,

Greg
"Peter Kirk" <pk@alpha-solutions.dkwrote in message
news:eh**************@TK2MSFTNGP05.phx.gbl...
>Hi there

In a web app I am making, I use a class which has a method which
generates a pdf from some xml data. The method accepts a "stream"
parameter which I set to the http-output-stream, and thereby the pdf is
sent automatically to the user's browser.

This has worked fine, but now there are some changes required.

Instead of streaming the pdf to the user's browser I need to include the
pdf in an email instead. Actually I need to send multiple emails with the
same pdf. What is a good way of doing this? What type of "output stream"
can I instantiate and send to the pdf-generation method, and include in
multiple emails?

Thanks for any advice,
Peter


Aug 24 '06 #3
Why you want to use a BufferedStream ontop of a memoryStream?

--
William Stacey [MVP]

"Peter Kirk" <pk@alpha-solutions.dkwrote in message
news:OH*************@TK2MSFTNGP06.phx.gbl...
| Hi, thanks.
|
| Actually I found a solution where I use a MemoryStream (wrapped in a
| BufferedStream). It also took me a while to realise there are two "email"
| components in .net - with the .net2 System.Net.Mail seemingly much more
| versatile.
|
| Is a MemoryStream/BufferedStream ok for this - or are there advantages
with
| a FileStream?
|
| Thanks,
| Peter
|
| "Greg Young" <dr*******************@hotmail.comskrev i en meddelelse
| news:%2****************@TK2MSFTNGP06.phx.gbl...
| >A filestream .. then include the file as an attachment to the emails.
| >
| Cheers,
| >
| Greg
| "Peter Kirk" <pk@alpha-solutions.dkwrote in message
| news:eh**************@TK2MSFTNGP05.phx.gbl...
| >Hi there
| >>
| >In a web app I am making, I use a class which has a method which
| >generates a pdf from some xml data. The method accepts a "stream"
| >parameter which I set to the http-output-stream, and thereby the pdf is
| >sent automatically to the user's browser.
| >>
| >This has worked fine, but now there are some changes required.
| >>
| >Instead of streaming the pdf to the user's browser I need to include
the
| >pdf in an email instead. Actually I need to send multiple emails with
the
| >same pdf. What is a good way of doing this? What type of "output
stream"
| >can I instantiate and send to the pdf-generation method, and include in
| >multiple emails?
| >>
| >Thanks for any advice,
| >Peter
| >>
| >
| >
|
|
Aug 24 '06 #4
A memorystream also works ... I assumed filestream from your previous
description.

You should not have to wrap it in a bufferredstream though you should just
be able to use the memroystream directly.

"Peter Kirk" <pk@alpha-solutions.dkwrote in message
news:OH*************@TK2MSFTNGP06.phx.gbl...
Hi, thanks.

Actually I found a solution where I use a MemoryStream (wrapped in a
BufferedStream). It also took me a while to realise there are two "email"
components in .net - with the .net2 System.Net.Mail seemingly much more
versatile.

Is a MemoryStream/BufferedStream ok for this - or are there advantages
with a FileStream?

Thanks,
Peter

"Greg Young" <dr*******************@hotmail.comskrev i en meddelelse
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>A filestream .. then include the file as an attachment to the emails.

Cheers,

Greg
"Peter Kirk" <pk@alpha-solutions.dkwrote in message
news:eh**************@TK2MSFTNGP05.phx.gbl...
>>Hi there

In a web app I am making, I use a class which has a method which
generates a pdf from some xml data. The method accepts a "stream"
parameter which I set to the http-output-stream, and thereby the pdf is
sent automatically to the user's browser.

This has worked fine, but now there are some changes required.

Instead of streaming the pdf to the user's browser I need to include the
pdf in an email instead. Actually I need to send multiple emails with
the same pdf. What is a good way of doing this? What type of "output
stream" can I instantiate and send to the pdf-generation method, and
include in multiple emails?

Thanks for any advice,
Peter



Aug 24 '06 #5
OK, thanks,

I have no clear reason why I wrapped the MemoryStream in a BufferedStream.
Probably a mix of blindly believing if it says "buffered" it must be better
than one which doesn't say "buffered", and of trying all sorts of types of
streams with the pdf generator and emails until I got something that worked,
and then trying to untwine the mess to something that still worked but
looked more elegant....

cheers,
Peter
"Greg Young" <dr*******************@hotmail.comskrev i en meddelelse
news:%2****************@TK2MSFTNGP06.phx.gbl...
>A memorystream also works ... I assumed filestream from your previous
description.

You should not have to wrap it in a bufferredstream though you should just
be able to use the memroystream directly.

"Peter Kirk" <pk@alpha-solutions.dkwrote in message
news:OH*************@TK2MSFTNGP06.phx.gbl...
>Hi, thanks.

Actually I found a solution where I use a MemoryStream (wrapped in a
BufferedStream). It also took me a while to realise there are two "email"
components in .net - with the .net2 System.Net.Mail seemingly much more
versatile.

Is a MemoryStream/BufferedStream ok for this - or are there advantages
with a FileStream?

Thanks,
Peter

"Greg Young" <dr*******************@hotmail.comskrev i en meddelelse
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>>A filestream .. then include the file as an attachment to the emails.

Cheers,

Greg
"Peter Kirk" <pk@alpha-solutions.dkwrote in message
news:eh**************@TK2MSFTNGP05.phx.gbl...
Hi there

In a web app I am making, I use a class which has a method which
generates a pdf from some xml data. The method accepts a "stream"
parameter which I set to the http-output-stream, and thereby the pdf is
sent automatically to the user's browser.

This has worked fine, but now there are some changes required.

Instead of streaming the pdf to the user's browser I need to include
the pdf in an email instead. Actually I need to send multiple emails
with the same pdf. What is a good way of doing this? What type of
"output stream" can I instantiate and send to the pdf-generation
method, and include in multiple emails?

Thanks for any advice,
Peter



Aug 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sandeep | last post by:
Hi all, I am new to the ADODB.Stream I am using following code lRecordset.Open "Select * from <some table-name>" 'this query return more than 1000 records dim lstream as new ADODB.stream...
5
by: andrewcw | last post by:
I have an object to serialize. TextWriter writer = new StreamWriter("test.xml"); serializer.Serialize(writer,obj); writer.Close(); but below does not, why ?? I have a file that I will have...
3
by: Peter Rilling | last post by:
Is there anyway of being notified when a Stream is modified? Basically, If one of my objects is passed a stream, I would like to initialize an object cache. Then when the Stream changes, I would...
7
by: simonrigby_uk | last post by:
Hi all, Sorry if this is the incorrect group but I couldn't see anything directly relevant. Can someone confirm for me what happens when two network streams are sent to an application at the...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
4
by: Helge Jensen | last post by:
In C# 2.0 System.IO.Stream is declared as: public class Stream: ..., IDisposable { ... public void Dispose(); public void Dispose(bool); IDisposable.Dispose(); } Which must be a...
3
by: ZaRMaS | last post by:
Hi all, I'm developping a project which you can see a video stream in a panel (like webcam). I am using DirectShowNet library to see the render, and it works correctly. But i need to compress...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
4
by: Fresh_Air_Rider | last post by:
Hi In the "good old" Classic ASP days, I used to stream records from a SQL Server database out to the user's browser in CSV format by using a combination of COALESCE and the ADODB.Stream object....
9
by: ThePants | last post by:
Hi, given the following code, I've been successful in grabbing pages for parsing, but for a certain page template (containing a particular piece of code) the stream always ends right after that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.