Page 1 of 1

How to inject OpenKM version to Word document content

PostPosted:Tue Sep 03, 2019 7:18 am
by fredczj
Hello !
I am looking for a basic feature that I cannot find anywhere now... :(
For the .doc/.docx documents uploaded, a version in OpenKM is assigned. This version should appear somewhere in the document when this one is collected or read by any authorised user.

How can I modify the .doc/.docx content so that it collects the openKM document version?

Thank you!
Fred

Re: How to inject OpenKM version to Word document content

PostPosted:Wed Sep 04, 2019 5:34 pm
by jllort
You are talking about modifying the document on the fly when downloading. This is not a trivial feature ( it is easiest download as pdf and apply a stamp either modifying the original content ). For it, you need to incorporate a library to modify docx files. I suggest working with docx files either microsoft propietary format ( that not means when you produce docx with Microsoft Office be 100% compliant ).

In case Microsoft Office proprietary format will be better to create a REST service integrated with Microsoft libraries for it ( we have done something in this direction to solve problems with conversion to PDF some rare and malformed documents )

Look in google for "java modify docx".

Re: How to inject OpenKM version to Word document content

PostPosted:Thu Sep 05, 2019 6:53 am
by fredczj
OK, got it. I have to take a look at this.
Are there some automation actions that could be triggered when downloading a document?

Re: How to inject OpenKM version to Word document content

PostPosted:Sat Sep 07, 2019 10:03 am
by jllort
Take a look at AutomationRule, there are automation for EVENT_CONVERSION_PDF. I think you will need to extend the automation with your own and add in DownloadServer and ConverterServlet. Look how has been done for EVENT_CONVERSION_PDF, you might do something similar.