2

While searching for a free solution to implement a DOC(x)-to-PDF transformation for an internal business application, I stumbled upon the org.apache.poi.xwpf.converter.* packages.

I found some examples e.g. http://www.programcreek.com/java-api-examples/index.php?api=org.apache.poi.xwpf.converter.pdf.PdfOptions

I saw the packages starting with "org.apache.poi..." so I thought "oh great, OSS". But after further search, I realized that source code isn't coming from Apache, rather from an obscure French company I never heard of, OpenSagres: http://www.opensagres.fr/

For example http://poi.apache.org/apidocs/index.html has nothing about those packages. I then found the matching Javadoc API: http://oss.opensagres.fr/xdocreport/javadoc/1.0.3/org/apache/poi/xwpf/converter/core/package-summary.html

...as well as source code on GitHub: https://github.com/opensagres/xdocreport/wiki/XWPFConverterPDFViaIText org.apache.poi.xwpf.converter.pdf provides...

<dependency>
  <groupId>fr.opensagres.xdocreport</groupId>
  <artifactId>org.apache.poi.xwpf.converter.pdf</artifactId>
  <version>${XDOCREPORT_VERSION}</version>
</dependency>

https://github.com/opensagres/xdocreport/wiki/XWPFConverterXHTML org.apache.poi.xwpf.converter.xhtml provides...

<dependency>
  <groupId>fr.opensagres.xdocreport</groupId>
  <artifactId>org.apache.poi.xwpf.converter.xhtml</artifactId>
  <version>XDOCREPORT_VERSION</version>
</dependency>

Jars are also available (for download) inside docx.converters-xxx-sample.zip archive file, packaged (under the "libs" folder) as:

org.apache.poi.xwpf.converter.core-1.0.4.jar
org.apache.poi.xwpf.converter.pdf-1.0.4.jar
org.apache.poi.xwpf.converter.xhtml-1.0.4.jar

And when you look at the source code, there is even a copyright for The XDocReport Team e.g. see https://github.com/opensagres/xdocreport/blob/master/thirdparties-extension/org.apache.poi.xwpf.converter.core/src/main/java/org/apache/poi/xwpf/converter/core/AbstractXWPFConverter.java

Copyright (C) 2011-2015 The XDocReport Team <xdocreport@googlegroups.com>

How is that even possible? I mean, prefixing a package from a well-known entity which releases OSS should be restricted, no?

Moreover, even if not coming from Apache, I can't use this source code/library/whatever, because:

  1. (it) depends on iText 2.1.7 due to licensing issue(s), see: iText 5.5.0 with XDocReport 1.0.4 which should not be used anymore (but can I really trust the commenter... as he's the author of the code??? https://stackoverflow.com/users/1622493/bruno-lowagie )
  2. there's a version with iText 5.x (https://github.com/opensagres/xdocreport/tree/master/thirdparties-extension/org.apache.poi.xwpf.converter.pdf.itext5) but it's not free! see http://itextpdf.com/Pricing

So how am I supposed to do?

Community
  • 1
  • 1
maxxyme
  • 2,164
  • 5
  • 31
  • 48
  • 2
    Not sure if there will be a conclusion for the POI part, but [we are discussing this](http://apache-poi.1045710.n5.nabble.com/Interesting-question-on-SO-td5725719.html) ... – kiwiwings Nov 21 '16 at 23:53
  • 1
    ... btw. if I would have the issue to solve, I probably would scan the docx4j project for a similar topic - [their old/free approach](https://github.com/plutext/docx4j/blob/2935212d8927ed0b209f96d6c2ae479bfca08996/src/samples/docx4j/org/docx4j/samples/ConvertOutPDF.java) is via Apache FOP – kiwiwings Nov 22 '16 at 00:07
  • OK thank @kiwiwings for your answer, unfortunately this confirms there is no **true** OS native solution (I mean by avoiding generating XSL-FO) to convert MS documents to PDF. – maxxyme Nov 22 '16 at 11:02
  • 1
    See https://github.com/opensagres/xdocreport/issues/174 – Angelo Nov 22 '16 at 13:48
  • This namespace conflict appears to have been resolved in 694cf75 and 769d431 on 2016-11-29 and will likely be reflected in the 2.0.0 release of XDocReport. https://github.com/opensagres/xdocreport/commits/master/converter/fr.opensagres.xdocreport.converter.docx.xwpf/pom.xml – IceArdor Jan 06 '17 at 10:21

0 Answers0