Friday, February 8, 2008

My Destroyed Faith in OpenOffice Presentations

So, I'm working on a presentation for work. I can't bring myself to use PowerPoint, since Microsoft has done such a good job of ruining my software self-esteem. I think to myself, "Well, why not Impress? It uses the OpenDocument Format, which is damn fine computing karma." So, I made my first draft in OOo 2.3.1 on Win32. Then, I attempt to continue working on the same ODP file on OOo 2.3.1 on FreeBSD. It seemingly hangs. No progress after minutes of processing. Fucking great. Running it from an xterm gives me these messages (no idea if they're related):

(process:1152): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function

(process:1152): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed

(process:1152): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed
That doesn't look good. I'm going to let it keep running for a while to see if things improve, but the outlook is poor. In the meantime, I've decided that the best alternative to multi-platform document creation and editing is Google Docs. It's not perfect, but at least you can save your files as PDF, which is what I use for read-only document exchange anyway.

Since I don't have a Microsoft Windows computer at my disposal, I have to figure out someway to get at least the text portion out of my ODP. This is my half-baked solution for extracting the text:
  1. $ mkdir presentation
  2. $ cd presentation
  3. $ cp ~/path_to_presentation/my_presentation.odp .
  4. $ unzip my_presentation.odp
  5. $ > my_presentation.txt

#!/usr/bin/env python2.5
# -- extract the text parts from an ODP's content.xml
import re
for line in open('content.xml', 'r')
for text_part in re.findall(r'<text:p.*?>(.*?)</text.*?>', line):
print text_part.replace('<text:line-break/>', '')

No comments:

Post a Comment