In early June we told you about public availability of libmspub — a library for reading Microsoft Publisher files and converting them to OpenDocument and SVG. It's time for an update.

Work on this library, including reverse engineering of PUB files, is a Google Summer of Code 2012 project. Brennan Vincent is the primary developer and GSoC student who is mentored by Fridrich Štrba (LibreOffice) and Valek Filippov (re-lab).

Conversion to OpenDocument: a sample template from stocklayouts.com

Now that midterm evaluations in the program are over (more on that soon), the library has seen its first official release, and even an update to it.

What's changed?

Quite a lot has changed in the last 6 weeks. Here's a brief overview:

many more shapes supported;

master pages;

text in shapes, including margins;

better support for styles, fills;

groups and nested groups;

better support for transformations of single objects and groups: rotations, flips.

improved reading of images.

There's also partial support for line spacing now, which doesn't always work due to a LibreOffice bug. Here is an excerpt from the example above:

Conversion to OpenDocument: line spacing bug in LibreOffice

There still seems to be a problem with displaying groups of objects. Hopefully the team will get to the bottom of it.

If you want to make sure that your files will be supported well enough, send your documents to the team for testing.

Versions

In terms of features coverage, the v2002 file format loader is still leading. The library can handle 97, 98 and 2000 versions, just with less precision. There's no special reverse-engineering work involved there: it's just quite a bit of boring work to be done.

Valek also had a look at recently released public preview of MS Office 2013, and it seems that the file format is identical to v2010. Hence one could say that libmspub supports Publisher 2013 as well.

Downloading and building

The library will be used in upcoming LibreOffice 3.7. As usual, for now it's recommended to fetch source code from Git and build it. The converter to OpenDocument is only available if you build and install writerperfect from Git.

Here is a familiar instruction:

1. Fetch and build libwpd

$ git clone git://libwpd.git.sourceforge.net/gitroot/libwpd/libwpd $ cd libwpd $ ./autogen.sh && ./configure && make && sudo make install

2. Fetch and build libwpg:

$ git clone git://libwpg.git.sourceforge.net/gitroot/libwpg/libwpg $ cd libwpg $ ./autogen.sh && ./configure && make && sudo make install

3. Fetch and build libmspub:

$ git clone git://anongit.freedesktop.org/libreoffice/libmspub $ cd libmspub $ ./autogen.sh && ./configure --prefix=/usr && make && sudo make install

4. Fetch and build writerperfect:

$ git clone git://libwpd.git.sourceforge.net/gitroot/libwpd/writerperfect $ cd writerperfect $ ./autogen.sh && ./configure && make && sudo make install

If you are brave enough to try, let us know how it works for you!

There's still no news from the Scribus team regarding support for Publisher files, but right now they are focusing on getting v1.5 released, so PUB support surely has a much lower priority.