A Java based driver for py3o
Project description
Juno for py3o
py3o.renderers.juno is a Java driver for py3o to transform an OpenOffice document into a PDF
It is intended to be used in conjunction with http://bitbucket.org/faide/py3o.renderserver But can be used outside it if you wish.
Prerequisites
Since this is a Java implementation you will need to install jpype and to have a recent Java runtime on the rendering machine. You will also need a running OpenOffice instance. (If you are on windows this can be addressed by using the py3o.renderserver Open Office service.)
This has been tested to build correctly with:
Oracle JDK 1.6 and OpenOffice 3.2.1 on Windows 7 and Windows server 2003
Oracle JDK 1.6 and LibreOffice 3.4 on Windows 7 64bit
OpenJDK 6 and LibreOffice 3.4 on Linux (Ubuntu and RHEL 5)
OpenJDK 7 and LibreOffice 4.0.4 on Linux (Ubuntu 13.04) with some deprecation warnings but it still works
For example if you are on Ubuntu you should run this command:
$ sudo apt-get install default-jdk
Usage
from py3o.renderers.juno import start_jvm, Convertor, formats import datetime # first arg is the jvm.so or .dll # second arg is the basedir where we can find the basis3.3/program/classes/unoil.jar # third argument it the ure basedir where we can find ure/share/java/*.jar containing # java_uno.jar, juh.jar, jurt.jar, unoloader.jar # the fourth argument was the openoffice version but is no more used # fifth argument is the max memory you want to give to the JVM start_jvm( "/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so", "/usr/lib/libreoffice", "/usr/lib", "", 140) c = Convertor("127.0.0.1", "8997") t1 = datetime.datetime.now() c.convert("py3o_example.odt", "py3o_example.pdf", formats['PDF']) t2 = datetime.datetime.now()
For more information please read the example provided in the examples dir and read the API documentation.
Installation
$ pip install –upgrade py3o.renderers.juno
Requirements
We just made a change of requirement from jpype to jpype1 in version 0.6 which should be pip installable by anyone with the correct toolchain. This means all requirements should now install automatically on a development machine.
Driver compilation and installation
NOTE: this is optionnal and reserved for developpers who want to compile the jar file by themselves
If you want to install from source you’ll need to clone our repository:
$ hg clone http://bitbucket.org/faide/py3o.renderers.juno $ cd py3o.renderers.juno/java/py3oconvertor $ ./compilelibroffice.sh $ cd ../../ $ python setup.py develop
Please note how you must first compile the jar file with our script (some more example scripts are available for windows and OpenOffice). If something fails, first try to edit the script and find if all referenced jar files are present on your system.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file py3o.renderers.juno-0.6.1.zip
.
File metadata
- Download URL: py3o.renderers.juno-0.6.1.zip
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dae44e822dd6d222fe6fdd81df84da5dcae2241e3e7236b61183ce6f6bb8e34c |
|
MD5 | bd1c26605320b7f33d87fba3fba899ab |
|
BLAKE2b-256 | b153066cea9d579a55fd11db0d3dac392d22cd9f5534e2ab03f8404a3d754a01 |
File details
Details for the file py3o.renderers.juno-0.6.1.tar.gz
.
File metadata
- Download URL: py3o.renderers.juno-0.6.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76287b4de33c07f0c73a5f5ef2ab2d8665bedf2643b9796d81d4c5b2a43008fc |
|
MD5 | d6f8b4a19a8b3d4ba7d4fa4cee1393a5 |
|
BLAKE2b-256 | 498561f21f946dacc792c7a5a9c3e3a417652ffed7d6f65c1be2d564b2abab2d |
File details
Details for the file py3o.renderers.juno-0.6.1-py2.7.egg
.
File metadata
- Download URL: py3o.renderers.juno-0.6.1-py2.7.egg
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2365aedaad92f445f3ba99a64c1045e81485fe295b086764bf8d92e64813940e |
|
MD5 | 1f7cab6b97511baec0e743c051755ac9 |
|
BLAKE2b-256 | 72d464701b26e9b702fd3c55f8970c5c8a85edc69bc65dd6deadf497e2151ea0 |
File details
Details for the file py3o.renderers.juno-0.6.1-py2-none-any.whl
.
File metadata
- Download URL: py3o.renderers.juno-0.6.1-py2-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c4592ea35b9fbdc562e023f8c1925b8531b1807735e83625312e81c9cb5d158 |
|
MD5 | 8e586e5e94a736bfa0c06e2dfabe0bab |
|
BLAKE2b-256 | ec30a8b5e189e8a599f4a8ce9e225dc5161f1cfe1dc3c6342336e70992f6fcf6 |