• This repository has been archived on 01/Dec/2023
  • Stars
    star
    359
  • Rank 118,537 (Top 3 %)
  • Language
    Python
  • License
    Other
  • Created over 12 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python script to automate document conversions using LibreOffice/OpenOffice.org

PyODConverter

PyODConverter (for Python OpenDocument Converter) is a Python script that automates office document conversions from the command line using LibreOffice or Apache OpenOffice.

The script was written as a simpler alternative to JODConverter for command line usage.

Usage

PyODConverter requires LibreOffice/Apache OpenOffice to be running as a service and listening on port (by default) 2002; this can be achieved e.g. by starting it from the command line as

$ soffice "--accept=socket,port=2002;urp;"

The script expects exactly 2 parameters: an input and an output file names. The document formats are inferred from the file extensions.

Since it uses the Python/UNO bridge, the script requires the UNO modules to be already present in your Python installation. Most of the time this means you need to use the Python version installed with LibreOffice, e.g. on Windows

> "C:\Program Files\LibreOffice\program\python" DocumentConverter.py test.odt test.pdf

or on Linux

$ /opt/libreoffice7.1/program/python DocumentConverter.py test.odt test.pdf

If you want to write your own scripts in Python, PyODConverter can also act as a Python module, exporting a DocumentConverter class with a very simple API.

ChangeLog

v2.0 - 2021-03-27

  • Converted to Python 3 using 2to3 Python2 to Python3 converter script

v1.2 - 2012-03-10

  • Changed default port to 2002
  • Moved to GitHub

v1.1 - 2009-11-14

  • Fixed HTML import issues by adding FAMILY_WEB
  • Support for specifying input formats and options
  • Support for passing filter options to output formats
  • Added CSV and TXT as input and output formats
  • Support for overriding Page Style properties, especially useful for specifying how spreadsheets should fit into pages when exporting to PDF

v1.0.0 - 2008-05-05

  • Let OOo determine the input document type, rather than using the file extension. This means all OOo-supported input types should now be accepted without any additional configuration.

More Repositories

1

jodconverter

JODConverter automates document conversions using LibreOffice/OpenOffice.org
Java
463
star
2

graphipedia

Creates a Neo4j graph of Wikipedia links.
Java
253
star
3

angular2-course-webpack-starter

Simple Angular 2 + TypeScript + Webpack starter project used in the Angular 2 From The Ground Up course.
JavaScript
44
star
4

next-reviews

Application used in the Next.js by Example course
JavaScript
41
star
5

next-blog

Blog app for the Next.js by Example course
JavaScript
36
star
6

next-shop

Shop app for the Next.js by Example course
JavaScript
32
star
7

notarealdb

A "fake" database for Node.js that stores data in local JSON files, for testing and sample applications.
TypeScript
30
star
8

ionic2-webpack2-starter

Ionic 2 starter project based on Webpack 2
CSS
25
star
9

graphql-job-board

JavaScript
25
star
10

buildchatbot

Python script that monitors Jenkins builds and notifies a Skype chat
Python
22
star
11

ionic2-by-example

Code samples for the "Ionic 2 by Example" course
20
star
12

graphql-hello-world

JavaScript
20
star
13

ionix-sqlite

Makes it easier to use SQLite in your Ionic 2 app.
TypeScript
11
star
14

graphql-chat

JavaScript
7
star
15

ionic2-with-angular-cli

Sample project showing how to use Ionic 2 in a project generated with the Angular CLI
CSS
7
star
16

fakebase

A "fake" database for Node.js that stores data in local JSON files, for testing and sample applications.
TypeScript
7
star
17

maven-dependency-sanity-plugin

Java
5
star
18

seriala

Serialization for Scala.
Scala
5
star
19

graphql-examples

JavaScript
4
star
20

traversable-csv

A simple CSV parser written in Scala leveraging the Traversable trait.
Scala
3
star
21

jenkins-slack-bot

Monitor Jenkins builds and notify a Slack channel
JavaScript
2
star
22

ionic-react-hello-world

Hello World example for the Ionic React course
JavaScript
1
star
23

test-workspace-addon

JavaScript
1
star
24

jersik

Json-Encoded Remote Service Invocation Kit
Scala
1
star
25

ionic-react-daily-moments

Sample app for the Ionic React course
TypeScript
1
star
26

ionic-capacitor3-datetime

TypeScript
1
star