Display Documents on mobile, tablet and desktop

The world’s most flexible document viewing solution

Download Trial Request a quote

Converting Office Documents to HTML5

Although JPDF2HTML5’s primary function is to convert PDF files to HTML5, it is also possible to enable conversion of Office documents to HTML5 by utilising LibreOffice to convert office documents to PDF.

Prerequisites:

  • LibreOffice must be installed
  • You must know the absolute file path of the LibreOffice executable
  • A PDF file with the same filename as the office document must not already exist in the same directory

Command Line Usage:

Simply pass in the absolute path to the LibreOffice executable as a system property to enable conversion of Office documents to HTML5 from command line.

java -Dorg.jpedal.pdf2html.libreOfficeExecutablePath=”/path/to/soffice” -jar jpdf2html.jar /inputDir/ /outputDir/

Conversion will fail if a PDF file with the same filename as the office document already exists.

Java Code Usage:

The DocumentToPDFConverter class can be used to invoke LibreOffice to preprocess Office documents so that you don’t have to.

It is recommended to read the Javadoc. The source code for the DocumentToPDFConverter class is also available to view online.

IDRSolutions Limited 1999-2016