aspose file tools
The moose likes Other Open Source Projects and the fly likes Merging the docx files using Apache POI Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "Merging the docx files using Apache POI" Watch "Merging the docx files using Apache POI" New topic
Author

Merging the docx files using Apache POI

guru kurady
Greenhorn

Joined: Feb 18, 2013
Posts: 2
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
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
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.


Android appsImageJ pluginsJava web charts
guru kurady
Greenhorn

Joined: Feb 18, 2013
Posts: 2
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
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
I'm not aware of any sample code, I've never tried anything like that.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Merging the docx files using Apache POI
 
Similar Threads
Excel .xls or .xlsx interaction with IO program
Search in documents
Problem with exporting data in excel
Any hints for using Apache POI to read DOCX files?
lucene and office 2007