1

I'm using jasperreports to create a file, it has to be edited by the user, so the file must be a doc/docx, the reason I don't create a docx file from jasper is that the way jasper creates docx isn't editable. I found out that if I create a pdf from jasper and then convert to a docx it remains with the format and I can edit it perfectly, the problem is that I can't find a way to convert the file from my java application.

I've tried using itext with POI, but I lost format of text, using splice.pdf I can't properly edit the doc, using docx4j I can't convert. So with there is some libraries or API that I'm missing please show me.

  • That's like asking how to convert a photo of a painting back to the painting. – Sean Patrick Floyd Oct 16 '19 at 18:08
  • 3
    Why are you using JasperReports, I mean why can't the document be directly created from Java? – user3115056 Oct 16 '19 at 18:14
  • There are several commercial libraries/APIs which convert PDF to docx. Alternatively, PDF Box can extract the text, but I suspect that without a lot of work you wouldn't be happy with whatever docx you created from that. Better to improve Jasper's docx export? – JasonPlutext Oct 17 '19 at 07:06
  • 1
    @user3115056 I'm using jasperreports because we thought it would be useful, we've created a hole pdf based on jasper and then we figured out that it needed to be a docx... our planning was terrible, now I need to fix this. You suggest that we create a docx from java, what tools do we need? I mean, our "pdf" has a lot of identation, has footnotes and stuff... So I need a really heavy tool for this, right? –  Oct 17 '19 at 14:03
  • @DaviBogo: There are several options you can try - https://www.docx4java.org/trac/docx4j https://products.aspose.com/total/java - paid http://poi.apache.org/ – user3115056 Oct 17 '19 at 16:57

0 Answers0