Java Convert Excel To Pdf

I have done the following, but wondering how to get the layout in my pdf files? I mean the bordering, tables and so on. OfCourse, this is not the final thing that I will end up.this is just a start.so there might be some stupid code standards followed. How to read pdf file and write it to excel file in csv format. The link of code and package is. And the code is.

Active2 years, 1 month ago

I have created an excel file with Apache POI. And now I need convert it to PDF. I want to use iText, but I want copy the merged cell, styles, etc from excel file to pdf.

How can I achieve this? Because the code sample I've found on the web: PDF to Excel using iText and Apache POI is good but doesn't copy the merged cells, styles.

Any ideas? Thank you very much !

Java Convert Excel To PdfJoris Schellekens
6,4961 gold badge14 silver badges43 bronze badges
Ady96Ady96
One

1 Answer

If you are going to use iText, it's best to use iText7. This is the latest version of iText, and substantial bugfixing has been done (especially for tables).

That having been said, when I look at the example, it seems like the example just iterates over all the cells and adds them to an iText Table object.

The exact same thing can be done with iText7. You create a table with the proper amount of columns, and then add cells to it.

Your question (as far as I'm concerned) comes down to 'how can I style iText table cells'.

This is a piece of sample code that just generates a table. I have indicated where you can style the content of the table.

Check out more examples at http://developers.itextpdf.com/content/itext-7-examples/itext-7-tables

Joris Schellekens

Convert Excel To Pdf Free Download

Joris Schellekens

How To Convert Excel To Pdf In Mobile

6,4961 gold badge14 silver badges43 bronze badges

Convert Excel To Pdf In Java

Not the answer you're looking for? Browse other questions tagged javaexcelpdfitext or ask your own question.