Page 1 of 1

WordprocessingMLPackage to file object

PostPosted: Fri Oct 23, 2015 12:32 am
by sreedhar
Hi friends,

I face a problem please help me,

I have a WordprocessingMLPackage object I need to set it in zip folder for that I need to convert it into a file object or fileinputstream object, please help me how to convert WordprocessingMLPackage object to any one of file or fileinputstream object.

Thanks,
Sreedhar

Re: WordprocessingMLPackage to file object

PostPosted: Fri Oct 23, 2015 7:28 am
by jason
You mean you want to save it as a plain old docx file?

Or you want something else eg save it unzipped?

Re: WordprocessingMLPackage to file object

PostPosted: Fri Oct 23, 2015 6:02 pm
by sreedhar
Currently im downloading wordmlpackage as document now I want to download it as wordmlpackage as Zip file. Could you please help me on this.

Re: WordprocessingMLPackage to file object

PostPosted: Fri Oct 23, 2015 9:23 pm
by jason
Still not sure I understand what you mean. A docx is a zip file. But you want to make foo.zip which when unzipped contains just the docx file?

Re: WordprocessingMLPackage to file object

PostPosted: Sat Oct 24, 2015 1:03 am
by sreedhar
Thanks for your quick reply.

Currently I am able to download a word document using docx4j. Required final output is to download a zip folder which contains the word document. Is there a way I can achieve it using docx4j

Re: WordprocessingMLPackage to file object

PostPosted: Sat Oct 24, 2015 7:30 am
by jason
Of course you can do that, but you do it with your own java code, not with any method provided by docx4j.

Are you using a stream? See for example http://stackoverflow.com/questions/5516 ... to-browser