Search code examples
javapdfms-officeopenxmllibreoffice

Java API to update MS word headers/footers and convert to PDF


I need a API to support changing header/footer of doc, docx, xls, xlsx. I have a huge code written for libreoffice, but the problem is the final document is with broken style and that is a big issue. Similar results are obtained with other open source projects so i am looking for some paid version probably like Aspose but could you give me alternative soltutions as well.

The other aspect of the problem is that i need a convertions from any office document, mail, msg to pdf.

I am looking also for solutions including C# but most probably it will be run under linux so java is preffered.


Solution

  • Using C# I know for a fact you can access the microsoft word com object. If you are loading all of these in the newest Microsoft word, you can tell it to convert to pdf right there and be done with it How do I convert Word files to PDF programmatically? this is what i used to get me up and running with C#. Apache POI, I have had nothing but problems with. Open Office and its UNO Api I have found to work for me in most cases, sometimes the docs do come out funky. So all in all I found C# the best. I hope this helps!