Introducing vipdf

Sun 09 March 2014 by Peter Ward

I mentioned in an earlier post (almost a year ago now, eep!) that I had some more software to release to the world, and as promised, this is the next one. The word “introducing” in the title is perhaps a bit misleading— I’ve written (but not released) several similar programs to this, and I’ve been using this particular program for a few years now, so it’s not really new.

But enough of that, let’s get on to what this thing is.

Rationale

The rationale for vipdf is that I’m unhappy with a lot of existing presentation software, for a variety of reasons, and I realised I could solve a lot of these problems with a vi-style keyboard mapping for navigating presentations.

The things which I wanted specifically were:

  • Moving to an arbitrary slide. If you get to the end of a presentation and then someone in your audience asks you a question about something on slide 15, you should be able to go directly to that slide— you shouldn’t have to move through all the intermediate slides.
  • Skipping over slides. Suppose you’re giving a talk, and you realise that you haven’t got time to talk about something in depth. No matter, your software should let you just skip over the next slide (or two), without flashing those slides at your audience.
  • Keyboard controls. If I have to use a mouse while giving a presentation, I’m going to accidentally click things I didn’t mean to and miss things that I meant to click on. Since I can touch-type, it makes sense to control everything by the keyboard, and by using familiar vi-style keybindings, I can reduce the cognitive overhead of remembering shortcuts.

At the moment, vipdf only supports PDFs (just in case the name didn’t make that obvious), which makes it great for pairing with beamer (as much as I dislike TeX, I haven’t found anything better yet), but you can easily export PDFs from most other presentation software (Microsoft Powerpoint, Keynote and LibreOffice Impress all have this functionality).

Yes, this will remove the gratuitous animations you had carefully wasted time setting up. No, there’s no support for embedded videos (in case you didn’t know, yes, you can do that with PDFs).

Controls

As I mentioned, there are vi-style keyboard controls:

<Left>
Move to the previous slide
N <Left>
Go back N slides (e.g. 3<Left> will move you back 3 slides)
<Right>
Move to the next slide
N <Right>
Go forward N slides (e.g. 2<Right> will skip forward over a slide)
N g
Goto slide N (e.g. 33g takes you to slide 33)
b
Toggle blackout

Yeah, I didn’t map hjkl. If you feel strongly about that, you should let me know in the comments what the mapping should be (should both h and j move back, or only h?)

There’s also controls for auto-advancing slides (t is for timer, btw):

t
Toggle auto-advance on or off.
N t
Start auto-advance (if not already started), and set the time interval to advance every N seconds. The default time interval is 5 seconds.
N [
Set the start slide to slide N, or unset if N is 0.
N ]
Set the end slide to slide N, or unset if N is 0. If auto-advance reaches the end slide, it will loop back to the start slide if one is set, otherwise it will turn off that auto-advance.

API

There’s also a DBUS api available for use, and there’s also a sample control script provided so you can write your own scripts to control your presentation:

$ vipdf-control list
# will give you a list of viewer ids, though at the moment there's just one
# you should take that and pass it into the following commands

$ vipdf-control next $viewerid
# advances by 1 slide

$ vipdf-control next $viewerid 2
# advances by 2 slides

$ vipdf-control prev $viewerid
# goes back 1 slide

$ vipdf-control goto $viewerid 10
# goto slide 10

Unfortunately, the API doesn’t make a lot of sense at the moment, as you can’t have more than one presentation open in a vipdf instance at a time.

Implementation

vipdf is written in Vala, using Poppler and Clutter. You can find the code here.

Quick build instructions for Debian:

$ sudo aptitude install valac libgee-dev libpoppler-glib-dev libclutter-1.0-dev
$ make
...
$ bin/vipdf /path/to/file.pdf

I’ve also written a web interface for it (which also integrates with pjlink).


Comments