There are 3 ways you can use BuildVu with Python:
- Using the command line, via
- Hosting BuildVu on an application server and running it as a web service you can interact with via a REST API.
- Using a framework such as Py4J to create a 'bridge' between Python and Java and interact with BuildVu.
Option 1: Running BuildVu from the command line using subprocess
This option requires Java to be installed.
The following code will run the specified command and output the result to the console:
from subprocess import call
cmd = 'java -jar path/to/buildvu.jar path/to/input.pdf path/to/output/directory'
Conversion settings are controlled by passing in system properties with the command. You can find more information here.
Option 2: Running BuildVu via an application server
pip install buildvu
Option 3: Running BuildVu directly using Py4J
This option requires Java to be installed, as well as basic knowledge of Java.
Alternatively, with a little Java coding, you can use a framework such as Py4J to interact with BuildVu, as described in our blog article on running Java code from other languages.