Skip to main content

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

py3o.renderers.juno-0.6.zip (15.3 kB view details)

Uploaded Source

py3o.renderers.juno-0.6.tar.gz (9.2 kB view details)

Uploaded Source

Built Distributions

py3o.renderers.juno-0.6-py2.7.egg (12.6 kB view details)

Uploaded Source

py3o.renderers.juno-0.6-py2-none-any.whl (12.4 kB view details)

Uploaded Python 2

File details

Details for the file py3o.renderers.juno-0.6.zip.

File metadata

File hashes

Hashes for py3o.renderers.juno-0.6.zip
Algorithm Hash digest
SHA256 51d119ebcc4c315d3f014b3ee6fbaf3d865f2f4790138cfd81b62e4193ce5d13
MD5 330375daa168b91d0612571898c1914a
BLAKE2b-256 adcd3a04566cc30f02926a07c7442382d62c580434b7cc3d6c743db2bb2ef87a

See more details on using hashes here.

File details

Details for the file py3o.renderers.juno-0.6.tar.gz.

File metadata

File hashes

Hashes for py3o.renderers.juno-0.6.tar.gz
Algorithm Hash digest
SHA256 3b7df45bd42426d96b7646397fe682c47125bf3252ade6e8c6ef6fcfc59ff1b8
MD5 cedf035c4c980f6befe42b6f3fbc01f8
BLAKE2b-256 8ced20cc87eaa87d2cc02c75e9a29a9c337be0c6b52c91b8a0130b8e645c95e1

See more details on using hashes here.

File details

Details for the file py3o.renderers.juno-0.6-py2.7.egg.

File metadata

File hashes

Hashes for py3o.renderers.juno-0.6-py2.7.egg
Algorithm Hash digest
SHA256 51477348683679bd738862dfd80f43db6e3d53abdfb5bf053744b4f96c118d2f
MD5 57e544fe774c1e51816ab39164c83657
BLAKE2b-256 ce46fbf202b27176fd38967cd0eca30544eaf8f2c575771841127612bb2782f3

See more details on using hashes here.

File details

Details for the file py3o.renderers.juno-0.6-py2-none-any.whl.

File metadata

File hashes

Hashes for py3o.renderers.juno-0.6-py2-none-any.whl
Algorithm Hash digest
SHA256 f11c1ae5f6dde9b00d6469738bd830b024a273c49e97dfba4d1561b205b7d4c0
MD5 69fea868882100ea1f0cb61303602c81
BLAKE2b-256 1dd698c4a99724aa3524bcc9f2d1fd74d56bf78b46e3cbc1776fa53d997879e7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page