A “presenter view” for OpenOffice presentations on Linux

Earlier this week I was at @media Ajax, and it was great — more in an upcoming post. First, though, a quick bit of scripting I did. You see, it’s become apparent to me that I need a “presenter view” when I’m presenting; I have my laptop running dualscreen, so that the view I get on the laptop screen is not the view that appears on the projector. I need this, because I’m not Derek Featherstone; I can’t just see the slides and remember everything that I need to say. My slides are often just a single word, or a picture, and I can’t remember the thread of what I’m aiming at without notes.* So, I used to have notes on a bit of paper. The way I create presentations is:

  1. Write out, longhand, everything I intend to say, word-for-word, like it’s an essay or a playscript
  2. Go through my longhand script and identify all the slides I want to put in to bolster the points
  3. Spend some time with Flickr’s Creative Commons image search finding the images that I want for slides
  4. Put together a presentation
  5. Make notes for each slide expressing the bullet points of what I want to say, with notes to myself to remind me of any particular phrases I want to specifically remember
  6. Throw away the longhand script

The final step, after that lot, used to be “write out all of the notes in big writing on bits of A4 paper”. Then it occurred to me: why not use the presenter view to put my notes on? I used S5, Eric Meyer’s in-browser HTML/CSS/JavaScript based presentation system, for a long time to make my talks, and it has a presenter view. However, I got increasingly hacked off with it being slow and annoying, and so I resolved to use OpenOffice for presentations; it’s just easier. OpenOffice, though, doesn’t have a presenter view (there’s a spec for it, but it doesn’t yet exist). After a bit of casting about, I discovered that (a) OpenOffice will export presentations to PDF, and (b) Evince, the Gnome document viewer, has a presentation mode. So, thought I, I could use that instead. OpenOffice allows you to export the notes pages too into your PDF: if you’ve got three slides in your presentation*, each with notes, and you elect to include notes pages in the PDF export, then you get six pages in the resultant PDF — the first three are just the slides, and the second three are the slides at the top of the page with the notes below.
So the idea appeared in my head: why not open the PDF twice, put PDF-1 on page 1 and display it on the projector, and PDF-2 on page 4 (the first notes page) and display it on my screen? Then just get them to advance in lockstep — when I advance the projector PDF by one page, it advances the notes view on my laptop screen by one page as well — and lo, I have a presenter view.
Those of you with (a) modern versions of PowerPoint or (b) whatever the Mac presentation thing is called are doubtless laughing your heads off right now, and rightfully so. I can’t wait for the OpenOffice people to make this happen properly.

Anyway, to do the advancing, you need a little script. This little script uses dogtail to provide the presenter view, and I used it on Monday and it worked perfectly. Be warned: this is not a proper solution. It’s a crappy hack, and if it de-bones your cat and deletes everything on your hard drive, don’t come crying to me. Almost certainly requires Linux, requires dogtail (and accessibility mode turned on in Gnome (NFI whether KDE has the same features, but it probably does; if you use something other than Gnome or KDE then you’re on your own, you freak)), requires Python and PyGtk, requires Evince (which should be called “Document Viewer”), requires a PDF (that has been exported from OpenOffice.org Impress with notes page included) on the command line, requires a laptop that can do dualhead (mine seems to set up the two screens as One Big Screen, so I don’t know what happens if you have something that actually does it properly), probably requires the phase of the moon to be right as well. Enjoy.

Evince presenter view

import gtk, sys, random, shutil, os, time
from dogtail.tree import root

pdf = sys.argv[1]
# copy pdf to /tmp
pdfcopyname = "pdf.%s.pdf" % random.random()
pdfcopy = "/tmp/" + pdfcopyname
shutil.copy(pdf, pdfcopy)

# start two evinces
os.system("evince --presentation --page-label=1 %s &" % pdf)
os.system("evince %s &" % pdfcopy)

# find them with dogtail
time.sleep(2)
from dogtail.tree import root
evince = root.application("evince")
pdfw = evince.window(os.path.split(pdf)[1])
pdfcopyw = evince.window(pdfcopyname)
halfpages = int(pdfw.child(roleName="tool bar").child(roleName="label").text.split()[1]) / 2
pdfpageel = pdfw.child(roleName="tool bar").child(roleName="text")
pdfcopypageel = pdfcopyw.child(roleName="tool bar").child(roleName="text")

def ping():
  global pdfw, pdfcopyw, halfpages, pdfpageel, pdfcopypageel
  try:
    pdfpage = int(pdfpageel.text)
    pdfcopypage = int(pdfcopypageel.text)
  except ValueError:
    # pdf window has been destroyed, probably
    raise "die"
  if (pdfpage + halfpages) != pdfcopypage:
    pdfcopypage = pdfpage + halfpages
    pdfcopypageel.text = str(pdfcopypage)
    pdfcopypageel.doAction("activate")

  return True

pingobj = gtk.timeout_add(500, ping)
try:
  gtk.main()
except:
  os.unlink(pdfcopy)

7 Responses to “A “presenter view” for OpenOffice presentations on Linux”

  1. Actually, OpenOffice already supports multiple monitors. You can already send the presentation to one screen and view something else on another one. See (closed) bug report #12719.

    However, the real presentation view with a clock and further notes is not yet implemented. The bug which tracks the development is #18486. There you can also find a link to first screenshots of the new feature.

    liquidat
  2. Well, of course, you should just reimplement S5. I really don’t know why someone hasn’t done that already; it’s not a particularly difficult piece of code. And whatever is going on with its weird speed things, I’m sure they could be resolved.

    I haven’t rewritten it either, but damn… well, I’m really close to rewriting it. Why won’t someone do this for me already?

    Ian Bicking
  3. Uber hacker Elliot (townx.org) wrote Flickrlilli.org.uk to do CC searches on flickr (before they implemented it) but is a little more flexible and automatically pulls the metadata you need to attribute CC stuff correctly.

    pscoop
  4. pscoop: I know about flickrlilli but I can never remember how to spell “lilli” :)

    sil
  5. downloaded it, installed dogtail via apt-get, but the evince-presenter-view.py script crashes and tells me:*

    “Dogtail requires that Assistive Technology support be enabled. Aborting…”

    Do we need to gring an activation key to use it? ;)

    No'
  6. No’: you need to enable assistive technology support :) See http://people.redhat.com/zcerza/dogtail/docs.html for details on how (it’s just a tickbox).

    sil
  7. [...] Linux Web Hosting, Java , Jsp, J2Ee, Struts, Servlets And Jboss Web Hosting Users Blog wrote an interesting post today!.Here’s a quick excerptA “presenter view” for OpenOffice presentations on Linux November 22nd, 2007 Earlier this week I was at @media Ajax, and it was great — more in an upcoming post. First, though, a quick bit of scripting I did. You see, it’s become apparent to me that I need a “presenter view” when I’m presenting; I have my laptop running dualscreen, so that the view I get on the laptop screen is not the view that appears on the projector. I need this, because I’m not Derek Featherstone; I can’t just see the sl [...]

    Blogging Business Live, everything about markets! » A “presenter view” for OpenOffice presentations on Linux

Leave a Reply

OpenID is a decentralised authentication system. If you use LiveJournal or Vox you already have an OpenID; just use the URL of your homepage there. See also how to get yourself an OpenID.