![]() If you like this short tutorial, then do let me know. In future I may cover some of the examples for the iText library that may include styling and the form handling along with the database export options. In this case however I suggest you to check out the documentation of the iText PDF library. There are styles that you can apply to the document. Alternatively you can use it to export the database tables to the PDF document. And there are many other things that can you do with the document. And the file is stored in the same folder to that of the project files. When you run the code, eclipse tries to export the PDF using iText. Make that change and any other change in the output that you want. Just watch out with the classname in this code, and change it to your project’s classname. You can copy the code given above and paste it inside your Eclipse project class. We have placed this code inside try and catch block to avoid file exceptions. In next statement we have added the content inside the pdf document. In second statement we have opened the created document. PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(“demo.pdf”)) ĭocument.add(new Paragraph(“This is Demo PDF”)) Ĭode: In first statement, we have created pdfwriter instance and created pdf document. So let’s see how this can be done with the code. ![]() This helps us to properly format before exporting that document to PDF format. After creating a document we have to push the content inside the document. Once you have created the Eclipse Java project and added itext jar files.
0 Comments
Leave a Reply. |