Javatpoint Logo

91-9990449935

 0120-4256464

How to write data into PDF using Servlet

Here, we are going to see how we can write data into PDF using servlet technology. We are simply writing some data using servlet and it will get displayed in the PDF.

To create such application, you need to have the spdf.jar file. If you download this example, you will get the example with jar file.

Example to write data into PDF using servlet

Let's see the simple example of writing data into PDF using servlet. In this example, we have mentioned the content type application/pdf that must be specified to display data in the PDF format.

ServletPDF.java