I have a requirement to split 1 docx to multiple docx based on subheadings. where input document have TOC, graphs, paragraphs, tables , images and drawing tools . I have a write a app to get a docx and generate multiple docx based on subheading. I could see few resource for paragraph read and write but couldn't find for others. any suggestions to clone the doc and write as is in order to maintain the same style and format. Thanks in advance
Asked
Active
Viewed 434 times
-2
-
sad that i couldn't get any help :( – prisesh Nov 24 '17 at 03:33
1 Answers
0
There are at least 2 ways to do this. The first is to use a clone of the entire document, but only including the relevant portion of the main document part. This is fairly easy to do, but the output documents might be large (since they contain unused images etc), unless you open/save in Word.
The second would be to use our commercial Docx4j Enterprise. You still have to identify where each chunk starts and finishes, but it will take just the objects referenced in that chunk (so you get small output documents).

JasonPlutext
- 15,352
- 4
- 44
- 84
-
Hi Jason, Thanks for the reply. could you please tell me more on this "You still have to identify where each chunk starts and finishes". – prisesh Nov 27 '17 at 22:27
-
Well, you need to find your subheadings (could they be in table cells, or in content controls?). I have some code which does what you are asking for, but it isn't published on the web I'm afraid. – JasonPlutext Nov 28 '17 at 20:57
-
ah. :( .. I have code for poi and docx . with poi i could get paragraphs and tables but the images are not in exact format or not copying at all and header and footer is not displaying so I couldn't proceed further with poi. for docx I could get paragraph and tables but couldn't get images and header footer style. seriously need some help – prisesh Nov 29 '17 at 00:30
-
-
Hi Jason, Thanks for the follow up. after all the discussions, project was put in to hold. so at present I'm unaware when project will kick start gain! – prisesh Feb 26 '18 at 05:46