Thanks for the response

Looks like I will have to the same. As the users want a copy of the
generated pdf I will probably just create a copy at a "known" location
and then email the pdf document from the file.

The error I was getting was that the javamail didn't know how to convert
the string of type application/pdf into a mail attachemnt. When I create
the pdf document as a file and attach it that way it works fine. 

In the long run I might look at creating a ContentHandler. What I was
trying to create is a service component that took xhtml and send it as a
pdf document without having the overhead of creating an actual file.

Pete

-----Original Message-----
From: Bill Lunnon [mailto:[EMAIL PROTECTED] 
Sent: Friday, 25 July 2003 5:00 p.m.
To: [EMAIL PROTECTED]
Subject: RE: PDF Generation and Javamail


Peter,

This is my experience with fop-0.20.3

I have been generating content (application/pdf) quite sucsessfully
using FOP in a servlet. Standard FOP stuff!

I had a requirement to email one or more PDF documents (as attachments)
to a recipient. My initial approach was based on using JavaMail and
creating a HTML page where a user could define the email stuff
(recipient, subject,
content(text)) as well as indicate the PDF documents to be generated and
attached to the email. I then used a servlet to connect to the SMTP
server
(sendmail) and create the email content and PDF attachments. The PDF
generation worked ok, the email creation and connection to the SMTP
server did not return any errors (or throw any exceptions) but the email
didn't consistently get to the receipient. Reviewing the SMTP server
logs, I could see where some email's were getting through and others
where not. I am not assuming that there are no errors in the code, but
all checks returned without error or exceptions thrown. I modified the
approach so that the email details and PDF attachments where written to
a "known" location by the servlet. I used another (cron'd) task then to
connect to the SMTP server (again using JavaMail) and sent the email
with attachments. This has worked without missing a message.

Hope this helps

Bill
-----Original Message-----
From: Peter Abbot [mailto:[EMAIL PROTECTED]
Sent: Friday, 25 July 2003 12:38 PM
To: [EMAIL PROTECTED]
Subject: PDF Generation and Javamail


Does anybody have any tips for sending the output of an xml to pdf
conversion by email using javamail. I also tried creating the output as
a file and then using javamail to send the file but I got the same
result.

I have been looking around the web for help and nothing seems to help.
The best I have been able to achieve is a whole lot of blank pages. What
I think I will have to end up doing is write a DataHandler for handling
the content type "application/pdf".

Any help would be most appreciated.

Cheers

Pete

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to