cancel
Showing results for 
Search instead for 
Did you mean: 

Adding metadata to a PDF or Word when downloading a document

magnusfs
Champ in-the-making
Champ in-the-making
Hello everyone.

I have a for us very important question regarding Alfresco Share. I have for weeks tried looking for solutions in the forum, but I suspect I may use the wrong keywords to answer my question…

What I would like Alfresco to do is to extract certain metadata that is defined after it is uploaded, to a PDF or Word document when it is downloaded (and then printed).

This could e.g. be the version number with related information and document type. The reasons is that we are using it as a document management system and we want to go for a ISO 9001 certification, and with this in mind it is important that we specify on the document the version number and some other information.

We could of course add this manually when we upload the new document, however it would be an even more practical solution if Alfresco could at this when it is downloaded.
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
To do this you would need to provide behaviour on Read of the document content. Generally it is better to do this on Create or Update for obvious reasons - which is why most things are done this way… You have a couple of options, either provide Java level Behaviour that fires on every Read of a document content. Or, override the appropriate WebScript that is used to download the content and do the work in there. There is a class org.alfresco.repo.web.scripts.content.ContentGet that is responsible for streaming the content to a GET request for a document from Share. That is just a Spring Bean backing the content.get.desc.xml webscript - so you could override that bean and perform additional work in it.

Hope this helps,

Kev

magnusfs
Champ in-the-making
Champ in-the-making
Hello Kevin,

Unfortunately I am not technically skilled so the solutions provided I have to bring further to someone that has the knowledgde and can help me do this.

Your answer got me thinking that maybe it is the best solution is to manually update the footer in the word document when for example uploading a new version..I have to think and discuss with my colleauges some more and maybe I will return with further questions on the topic.

Thank you for taking your time to respond.

Magnus