• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

send mail with pdf attachment

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ve invoice.jsp in which i extracted the html part(say in variable "htmlMessage") using copy tag and passes it to sendMail.jsp there i m sending it to customer.It is received to customer in text format.I need that this can be send in PDF format as attachment.
Plz help..
Thank you..
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to convert the text into a PDF document using a library like iText and then use the JavaMail API to attach that PDF to an email. Niether of wich are specific to JSP.
 
gaurav kumawat
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sir i m not geeting u.Let me explain my problem.I extracted the html part from invoice.jsp in a string variable htmlMessage.And now i need that i can send that htmlMessage content can be send it as attachment in pdf format.
Pz help in this..
Thanks..
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by gaurav kumawat:
sir i m not geeting u.Let me explain my problem.I extracted the html part from invoice.jsp in a string variable htmlMessage.And now i need that i can send that htmlMessage content can be send it as attachment in pdf format.
Pz help in this..
Thanks..



I'm not sure how to explain it differently. But I will try...

You'll need to convert your htmlMessage content into a PDF document using an API like iText. Once you have generated the PDF, you will need to use the JavaMail API to send the PDF as an attachment in an email.

If you can clarify exactly what part of that you don't understand, maybe I can clarify it a bit more.
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use JSPs for rendering the views only. For business functionality like creating a pdf and sending mails, use a Servlet instead.
 
gaurav kumawat
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much..sir..
 
gaurav kumawat
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sir would u plz tell me..how to convert htmlMessage content into a PDF document using an API like iText.Means which particular method should i use.
Thank you..
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by gaurav kumawat:
sir would u plz tell me..how to convert htmlMessage content into a PDF document using an API like iText.Means which particular method should i use.
Thank you..



gaurav,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see: UseRealWords

Abbreviations such as "u" or "ur" in place of "you" and "you are"
or "you're" confound language translation software making it hard
for our non-English speaking members to read your posts.
"Plz" is not a word in the English language.

Thank you for your help with this.


As to your question.
Since this is not really a JSP issue anymore, I'm going to move this thread to the "Other Open Source Projects" where IText and Apache FOP would be covered.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic