1

I am trying to add a custom footer to pdfs created from docx files on my liferay6.2 installation. Specifically I have linked up open office, and I am successfully converting the documents from docx to pdf to embed them in my portal, but I want to add a 'pdf created on ' message as a footer.

I am open to doing this through liferay/java or through a setting in open office, but I can't find a way to do either at this time.

Thanks, Joe

1 Answers1

0

You will need to implement your own OpenOfficeDocumentConverter. The current implementation does this:

XComponent document = loadDocument(inputUrl, loadProperties);
refreshDocument(document);
storeDocument(document, outputUrl, storeProperties);

You could overwrite refreshDocument and do what you would like to do with the document (check the UNO API to find out how to change the document to add the footer).

Unfortunately you can't inject your converter with the spring configuration or portal.properties. Either you create an ext-plugin and replace the whole OpenOfficeDocumentConverter with your own implementation. Or you set DocumentConversionUtil._documentConverter using reflection to your extension.

Tobias Liefke
  • 8,637
  • 2
  • 41
  • 58