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.21k stars 371 forks source link

Is it possible to handle ODT and DOCX documents in the same project? #133

Open rchabin opened 8 years ago

rchabin commented 8 years ago

Hello! In my company, we are currently using your tool with ODT documents, Freemarker template engine and PDF conversion, it works great so thank you for that!

But now, some of our users would rather use DOCX documents, and I did not find a way (neither an example) to handle ODT and DOCX document types in the same web application, is that possible?

I would like to be able to write something like this: final Options options; if (report.getKind().toLowerCase().equals("odt")){ options = Options.getTo(ConverterTypeTo.PDF).via(ConverterTypeVia.ODFDOM); } else if (report.getKind().toLowerCase().equals("docx")){ options = Options.getTo(ConverterTypeTo.PDF).via(ConverterTypeVia.XWPF); }

Thanks for the reply :)

angelozerr commented 8 years ago

it works great so thank you for that!

Glad XDocReport helps you

I did not find a way (neither an example) to handle ODT and DOCX document types

I'm sorry I don't understand your problem?

handle ODT and DOCX document types in the same web application, is that possible?

If you wish to generate odt -> pdf and docx -> pdf in the same web application, yes it's possible, your application must just host the well XDocReport jars