Apaches POI has a ExcelToFoConverter
class that allows to convert xls files to XSL-FO. Since I use XLSX files, I am worried that I will have data loss when I use this converter. POI does not offer an explicit converter for xlsx files. However, I saw that someone used the ExcelToFoConverter
for xlsx files.
If you can get from XLSX > HTML:
https://poi.apache.org/apidocs/org/apache/poi/hssf/converter/ExcelToHtmlConverter.html
http://allstarnix.blogspot.co.uk/2013/05/use-java-to-convert-excel-to-html.html
then you can use easily get from HTML > PDF using FlyingSaucer.
https://github.com/flyingsaucerproject/flyingsaucer
Commercial solutions would include Aspose Cells for Java:
For option 3 I have used iText to create PDF files. See the answers to this question for more info.
I wrote an xsl sometime ago that did Excel XML format conversion to XSL FO. It is available in the Cool tools section of the RenderX website.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.