The Java sample provided in this section uses the Muhimbi PDF Converter Services to convert (if needed) a file and apply PDF Security settings (Disable printing, disable content copying etc). Additional sample code to convert, merge, watermark, secure and OCR files can be found here.
For background details about applying PDF Security using Java, see this Knowledge Base Article.
Any questions? Drop us a line, we love to help.
For an overview of the prerequisites for the various platforms, including software to install as well as how to download this sample code, see the overview page for all Java sample code.
Although compiled binaries are supplied with the sample code, once you decide to use this code in your own applications you may want to change the namespace of the proxy classes. Points 1 and 2 are optional and only needed if you wish to generate proxy classes yourself.
If the Muhimbi PDF Converter Services is installed on the same machine that is running this sample code, it can be executed straight away by running the run.sh
(for Linux) or the run.bat
script file for Java versions 7 to 10.
❗ For Java 11 the Maven project has to be compiled first in order to pull dependencies which have been removed from Java 11. Go straight to point 3. ❗
❗ Don't forget to make the various .sh files executable using chmod +x *.sh
❗
- Edit the
GenerateJavaWSProxies.sh
(for Linux) or theGenerateJavaWSProxies.bat
(for Windows) script and changelocalhost
to the name or ip-address of the server running the Muhimbi Conversion Service. - Execute the
GenerateJavaWSProxies.sh
(for Linux) or theGenerateJavaWSProxies.bat
(for Windows) script to generate proxy classes for the web service. - Modify the
src/com/muhimbi/app/WsClient.java
source file so theDOCUMENTCONVERTERSERVICE_WSDL_LOCATION
constant points to the WSDL of the Muhimbi PDF Converter Services - Execute the
compile.sh
(for Linux),compile_maven.sh
(for Maven / Java 11+) or thecompile.bat
(for Windows) script - Execute the
run.sh
(for Linux),run_maven.sh
(for Maven / Java 11+) or therun.bat
(for Windows) script
Any questions? Drop us a line, we love to help.