Docmosis-Java Code Samples

This page contains a collection of code samples using Docmosis-Java.

You will also need to download the latest release from the Resources section.

** PLEASE NOTE: These examples use features available from version 4.0.3 onwards.  If you are trialling an earlier version of Docmosis-Java, please upgrade to use these examples, or contact This email address is being protected from spambots. You need JavaScript enabled to view it. with any questions you may have.

 

Simple Render - producing your first document.



The ZIP contains:

  • SimpleRender.java
  • WeclomeTemplate.doc
  • readme.txt (instructions on getting started)

This example shows the simpliest way to create a PDF document based on the WelcomeTemplate.doc.

Remote Render - separating dependencies and load distribution.



This code sample connects to a remote converter to produce a document.

You must run the remote converter first, using the runConverter script.

Running remote converters allows you to shift processing load to a different server from where you application is running.  It also means that you only need to have OpenOffice/LibreOffice on the server that the converter is running.

The ZIP contains:

  • RemoteRender.java
  • runConverter.bat
  • runConverter.sh
  • docmosis.properties
  • WeclomeTemplate.doc
  • readme.txt (instructions on setup)

Properties Files - configuring Docmosis using files.



This example shows how to configure Docmosis using properties and config files.

The ZIP contains:

  • DocmosisConfigFiles.java
  • docmosis.properties
  • converterPoolConfig.xml
  • WeclomeTemplate.doc
  • readme.txt (instructions on setup)

The licence key, OpenOffice/LibreOffice install location and other settings will be read from the docmosis.properties file.

The converterPoolConfig.xml file explains how to set up one embedded converter.

The extras directory contains more detailed examples of the docmosis.properties and converterPoolConfig.xml files.