Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Merging the docx files using Apache POI

 
guru kurady
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we perform document merging (of docx file ) using Apache POI XWPF apis? I am not trying to merge the not only the contents but also the style and formatting associated..so copy and paste content wouldn't work for me. My requirement is somewhat similar to the post:
http://www.coderanch.com/t/440303/open-source/Mearging-word-documents-POI




Thanks.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It shouldn't be hard to port that code from using the HWPF API (for DOC) to the XWPF API (for DOCX) - the classes and methods are largely identical.
 
guru kurady
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there sample code available to merge two doc files, so I can correlate it with DOCX? In the post referred to, you had commented that there are several objects other than range that need to be merged, and there was no conclusion whether the original poster was able to merge doc files using POI.
In XWPF, I could not find methods to get the range. The XWPFDocument class has plenty of support to retrieve content from DOCX, but only a few methods to write back.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not aware of any sample code, I've never tried anything like that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic