0

We are converting word to pdf using the openoffice(3.4.1 version) in java with JODConverter.

below is the code used.

OpenOfficeConnection connection = new SocketOpenOfficeConnection(2100); try { connection.connect();

  DocumentConverter converter = 
    new OpenOfficeDocumentConverter(connection);
  converter.convert(inputFile, outputFile);

  connection.disconnect();
  return "Sucess  " + DestinationPath + DestinationFileName;
}
catch (Exception localException1) {
}

The problem is that after random no of days the converted PDF contains the garbled fonts. like # # ! $ $ " % & The only solution we have so far is to restart the server. System guys are saying the the problem is with Open Office. We are using open office to convert the document since it converts the doc files exactly including all the formatting and table structure. what could be the solution to this.

Dev Sahu
  • 13
  • 2

1 Answers1

0

So OpenOffice can be a little temperamental when running on a server, especially as it isn't multi-threaded and you end up having to run a pool of OpenOffice processes - see How can I use OpenOffice in server mode as a multithreaded service?.

Added to that often the rendering is off when converting to PDF - see https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=68865 which is why you may want to consider using a conversion service to automate the conversion tasks for you ?

For complete transparency I work for Zamzar (an online file conversion service), we have recently released a developer API - https://developers.zamzar.com/ that allows you to convert between a multitude of file types, specifically applicable to you here in that we support both doc and docx to pdf with little or not loss in the way the PDF is rendered. It maybe worth a look to see if this is a better alternative to trying to run your own solution through OpenOffice on a server.

Community
  • 1
  • 1
MJWStack
  • 1
  • 1