You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Markus Christian <ma...@gmail.com> on 2016/12/10 12:44:14 UTC

Export pdf-file from xssf-file with java

Hello there,
I am seaching for a possibility to export my ready xlsx-file filled with
lot of data (through java operations) into an pdf-file. I am searching for
an easy way to print out this pdf file after export without opening
Microsoft Excel.
Did you integrate such a function in the apache poi project to? Sorry if
there are sources with the question, but in the mailing list and the
xssf-examples I couldn't find that.

Mit freundlichen Grüßen

Markus Christian

Re: Export pdf-file from xssf-file with java

Posted by Andreas Beeker <ki...@apache.org>.
Hi,

the LibreOffice export would probably handle the most cases, but is also quite heavy weighted
and assumes you have a LO installation on your system/server.

If you want to have a light-weighted - but also incomplete - solution, you can modify [1] and
put the output through FOP [2] - that's the first approach which came to my mind and which I
would prefer

But there also other matches when you google for it - see [3], [4], [5] ...
be aware that new versions of iText are now commercial licensed/supported.

Andi

[1] http://svn.apache.org/repos/asf/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
[2] https://xmlgraphics.apache.org/fop/
[3] http://stackoverflow.com/questions/18131849/convert-excel-to-pdf-or-create-new-pdf-file
[4] http://www.docx4java.org/forums/xlsx-java-f15/how-to-convert-xlsx-to-docx-to-pdf-t1565.html
[5] http://thinktibits.blogspot.de/2012/12/POI-iText-Convert-XLS-to-PDF-Java-Program.html


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Export pdf-file from xssf-file with java

Posted by Andreas Reichel <an...@manticore-projects.com>.
the LibreOffice/OpenOffice Java Interface http://api.libreoffice.org/examples/examples.html#Java_examples will be your
best bet.
Together with XVFB it will run also on headless servers.

Cheers
Andreas

On Sat, 2016-12-10 at 13:44 +0100, Markus Christian wrote:
> Hello there,
> I am seaching for a possibility to export my ready xlsx-file filled with
> lot of data (through java operations) into an pdf-file. I am searching for
> an easy way to print out this pdf file after export without opening
> Microsoft Excel.
> Did you integrate such a function in the apache poi project to? Sorry if
> there are sources with the question, but in the mailing list and the
> xssf-examples I couldn't find that.
> 
> Mit freundlichen Grüßen
> 
> Markus Christian