Chapter 9. Integrating iText in your web applications
This chapter covers
- Making interactive forms “web ready”
- Converting HTML and XML to PDF
- Using iText in servlets
Every month, I visit Google Analytics to look at the statistics for my different sites; I click Export > PDF and save a printable report for my archives. When I want to travel by train or by plane, I can download a ticket or a boarding pass from a website. When you download an eBook from Manning, your email address is automatically stamped on every page. Most of these reports, vouchers, stamped books, and so on, are “powered by iText.” iText was one of the first libraries that combined ease of use with speed, and that’s why it’s omnipresent in applications generating PDFs for the web.
Let’s take a look at how these applications work and see how easy it is to integrate iText in a Java servlet.
Up until now, you’ve only worked with standalone examples. You compiled them using the javac command and executed them with java, resulting in one or more PDF documents.
For this chapter, you need to install an application server. If you’ve written and deployed Java servlets before, you shouldn’t have any problem setting up the examples. If you don’t have any experience with J2EE applications, please consult a book about writing web applications in Java, as this is outside the scope of this book.