Page 1 of 1

How to convert XLSX to DOCX to PDF

PostPosted: Wed Jun 26, 2013 9:09 pm
by mrOlicas
Hello Jason!

On another post in this forum you answered a question with this cite:

"..Or you could go from XLSX to a docx table, and use what is in docx4j already to convert that to a PDF. "


I would very much like to convert my XLSX (everything working there with xlsx4j) into:

1. docx
2. PDF

like you said.
I just need the conversion from XLSX (e. g. a SpreadsheetMLPackage) to docx (WordprocessingMLPackage); the conversion docx -> PDF is already available, as i have seen.


Could you please post an example of this? It would greatly help.

By the way:
You do lose all formatting you had in the Spreadsheet, right? There is no way of mapping this to docx4J, if I understood well... or is there?

Maybe as you said before, another API would be more suited to see the xlsx as a whole and transform it "as is" to PDF.


Thank you,

mrOlicas

Re: How to convert XLSX to DOCX to PDF

PostPosted: Thu Jun 27, 2013 11:29 pm
by jason
The best solution may be to port http://svn.apache.org/repos/asf/poi/tru ... erter.java (which is ASLv2 licensed)

That'll create XSL FO, which you then convert to PDF using FOP (just as docx4j does for a docx).

For another way to create the XSL FO, see http://www.renderx.com/cooltools.html "A style sheet for converting Excel XML format to XSL FO (XSLFO) tables". They say "you are welcome to improve it", but if this were to form the basis of a contrib to docx4j, the license would need to be clarified first.