Java Sample Code
Details about using the Muhimbi PDF Converter Services from Java can be found below. Further information, including the object model, can be found in the Developer Guide and in the Muhimbi Knowledge Base.
Any questions? Drop us a line, we love to help.
Table of Contents
Using the PDF Converter in combination with Java requires JDK 7 or later. Exact deployment and configuration steps for the various platforms vary slightly.
There are multiple options for compiling and executing Java code on Linux. The examples provided in this section have been tested with Ubuntu 18.0.4 and Java versions 7 to 11 using both OpenJDK and Oracle Java. For example, install the OpenJDK version of Java 8 as follows:
sudo apt install openjdk-8-jdk-headless
sudo apt install maven
For Windows developers we recommend using Oracle's official JDK. The examples provided in this section have been tested on Windows with this JDK.
Sample code, and related files, for the various facilities provided by the service can be found below. It is recommended to copy all samples to your local system using one of the following options:
Git: Use the following command to clone the entire repository to your system. This will download all files associated with this repository, and is most likely overkill, but it is the only easy way to download files using Git. Once downloaded, you can find the examples under the
git clone https://github.com/Muhimbi/PDF-Converter-Services/
SVN: A common trick to download only part of a Git repository is to use
svn. Download only the Java client and sample code using the following command.
svn export https://github.com/Muhimbi/PDF-Converter-Services/trunk/Java
ZIP: Download a ZIP archive of the entire repository. Once downloaded, you can find the examples under the
A full overview can be found below.
|Convert and Merge||Combine multiple files, and URLs, into a single PDF (Based on Java wsimport).|
|Convert and Secure||Convert a document into PDF and apply security settings, passwords and restrictions to the PDF. (Based on Java wsimport)|
|Convert and Watermark||Convert a document into PDF and apply watermarks. (Based on Java wsimport)|
|Convert using Axis||Convert a document into PDF using proxy classes generated by Apache Axis2|
|OCR PDF||Use Optical Character Recognition to convert a fax, scan or other image into a text PDF.|
Any questions? Drop our friendly support desk a line, we love to help.