Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

send mail with pdf attachment

 
Posts: 11
  • Mark post as helpful
  • send pies
  • 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..
 
pioneer
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • 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
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
pioneer
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • 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.
 
pioneer
Posts: 536
  • Mark post as helpful
  • send pies
  • 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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much..sir..
 
gaurav kumawat
Posts: 11
  • Mark post as helpful
  • send pies
  • 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..
 
master steward
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • 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.
 
My, my, aren't you a big fella. Here, have a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!