Zumbs' Blog

The truth may be out there, but lies are inside your head

Archive for the ‘LibreOffice’ Category

Bulk conversion using LibreOffice

Posted by Zumbs on April 22, 2012

I do a lot of tabletop roleplaying. As a Game Master, I play with two different groups in the same world. The oldest running campaign has been running for more than a decade. The notes populate more than three large binders. As we do not play at my flat, it is infeasible for me to carry all that to the game. Rather, I try to pick out the important portions and leave the rest be.

A significant portion of my notes are stored on my computer in different formats. The newer documents are stored as odts, but older documents were created using various versions of WordPad and Word.

Over the last few years, the quality and functionality of ebook readers have been improving. Most of these handle formats like pdf. So, if I could convert my notes to pdf, I could bring an ebook reader with all the notes that I did not have room for in my bag. Some of the better ebook readers I have been looking at, even allow adding notes and handwriting as a new layer to existing pdfs, so I can make notes in the documents during play.

But I still need to convert all my files to pdf. There are more than 200 files involved, so doing it by hand is way to time consuming (and nigh impossible to maintain). My office program of choice, LibreOffice, comes with a nifty command line utility that is able to convert files from one format to another. Unfortunately, LibreOffice does not currently support bulk conversion on Windows.

And then there are all the custom needs, things that would be nice:

  • Keeping the same folder structure
  • Copying time stamps from the original file to the copy
  • Sync of files that are not odts (e.g. maps)
  • Ability to set metadata for generated pdfs

In the end, I wrote my own little utility program in .NET that have those features. It’s available on Sourceforge. LibreOffice 3.5 is required, but not bundled. The screenshot below shows the user interface.


Screenshot of the Bulk Converter Using LibreOffice utility. The upper part of the window is used to configure what the bulk converter should do. Move your mouse over the different options to get more information on what it does. The big, white space in the bottom is a text box that is used to write output from the converter. Press Go to start and Cancel to stop the current run.

As noted above, the utility only supports conversions from doc to odt and from odt to pdf. LibreOffice supports a lot of conversions that I have not enabled. Partly because I do not use them, and partly because it would require extensive testing to enable all of them. But I am open for requests 🙂

Posted in ebook, ebook readers, LibreOffice, Roleplaying games | Leave a Comment »

Figures for Latex with OpenOffice Draw

Posted by Zumbs on October 4, 2009

There are numerous options for making figures to use with Latex. I usually use pdflatex, and, thus, prefer using figures in pdf format. This gives a few problems. Many programs either do not come with the ability to export to pdf, and even if they do, they export the entire page, and not a cropped figure. Another option is to take a screenshot of your figure, but that often looks ugly and does not scale very well.

OpenOffice comes with a pdf exporter, but it does not automatically crop the page to only contain the figure. It is, however, easy to rectify, as it is easy to change the size of the paper to whatever dimensions you want.

This is handled through the Page Setup dialog, which can be opened by Format->Page, as shown below:


This brings up the Page Setup dialog, where you can edit the width and height of the drawing. When you are done, press ok and investigate if the figure is cropped to your liking.


After having cropped the drawing to your liking, it can be exported to pdf by using File->Export as PDF… and clicking Export in the dialogue. Your new pdf figure can be imported into your Latex document using this small bit of code:

\caption{This is my new pdf figure.} \label{fig:pdffigure}

Usage of \includegraphics requires that you add \usepackage{graphicx} to the header of your latex document. The described procedure works with LibreOffice as well.

Posted in Latex, LibreOffice, OpenOffice, pdflatex | Tagged: , , , , | 2 Comments »