opensagres / xdocreport

XDocReport means XML Document reporting. It's Java API to merge XML document created with MS Office (docx) or OpenOffice (odt), LibreOffice (odt) with a Java model to generate report and convert it if you need to another format (PDF, XHTML...).
https://github.com/opensagres/xdocreport
1.23k stars 373 forks source link

DOCX to PDF, IConverter is null #388

Open dcbasso opened 5 years ago

dcbasso commented 5 years ago

Hi everyone, I'm trying to use the XDocReport but I got this error:

final Options options = Options.getFrom(DocumentKind.DOCX).to(ConverterTypeTo.PDF); final IConverter converter = ConverterRegistry.getRegistry().getConverter(options);

The "ConverterRegistry.getRegistry()" got empty converters Hashmap. How to fix it?

boris-dev commented 5 years ago

I have same problem too, I think we need to add some dependency with converters but i dont know which one

dcbasso commented 5 years ago

I couldn't find the fix for it yet. If You find something, please put the solution here.

angelozerr commented 5 years ago

I suggest you see sample https://github.com/opensagres/xdocreport.samples/tree/master/samples/fr.opensagres.xdocreport.samples.docx.converters

You need to add this dependency:

<dependency>
    <groupId>fr.opensagres.xdocreport</groupId>
    <artifactId>fr.opensagres.poi.xwpf.converter.pdf</artifactId>
</dependency>
dcbasso commented 5 years ago

I have used this dependency, and not work for me. I can try again.

dcbasso commented 5 years ago

Work, but the conversion is not good. Lost table information, e etc... DOCX4J its better option to DOCX to PDF convertion, using FO.