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 py3o.renderserver But can be used outside it if you wish.

Note for end-users

If you just search for an easy way to render LibreOffice files to PDF or DOCX, with ot without templating capabilities, you should directly look at py3o.fusion

py3o.fusion is a packaged webservice that lets you send a template, a target format and your data

and will return the resulting file.

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)

  • OpenJDK 7 and LibreOffice 4.2.4.2 on Linux (Ubuntu 14.04)

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.7.zip (14.9 kB view details)

Uploaded Source

py3o.renderers.juno-0.7.tar.gz (9.0 kB view details)

Uploaded Source

Built Distributions

py3o.renderers.juno-0.7-py2.7.egg (12.5 kB view details)

Uploaded Source

py3o.renderers.juno-0.7-py2-none-any.whl (12.1 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for py3o.renderers.juno-0.7.zip
Algorithm Hash digest
SHA256 64cde7f70a6979d5f9e92c02c821942dd9f41f00df0d6fad8a8c855daec27b3c
MD5 34809365a79810162c1e66df95ad6fa1
BLAKE2b-256 1e1f00d0301f62a0548f6778c69e5f439385b0ca1f56d47dae7af73e195c22b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py3o.renderers.juno-0.7.tar.gz
Algorithm Hash digest
SHA256 c897fde872f03ba7bb5647118fc9f3cff43a49ce47ecbedcd31c9e70a505d285
MD5 a3ca20ba068ffa2ba2e4309f5539f420
BLAKE2b-256 9855da47bda4475d2e5943a5a8913a753c3eb193c6d8c49fb5cd485ad97afede

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py3o.renderers.juno-0.7-py2.7.egg
Algorithm Hash digest
SHA256 4f0753bac3bd0ffdeec0ec741ae60dae967f1cda0a4a7e8b6dfa7f87b14edf11
MD5 3179570833e1e0d29737413f5609afda
BLAKE2b-256 6e58c5ab63fe5f9fa933d72c0b8b4557115aa3d838578c68e03fdb80a6ede03b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py3o.renderers.juno-0.7-py2-none-any.whl
Algorithm Hash digest
SHA256 3f1e4d9c9ab240aa818619a9553bb757425e6ee464c83b16b188ffaa31433203
MD5 606d31391af34677b16c502c9e3c3924
BLAKE2b-256 2031f2b47bb7ffeb6163c2f238a1fe814448aeb83081a97b646482f40105ed07

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