home | codereading | contact | math | misc | patches | tech


OpenOffice notes

The keyboard layout is right, but accents don't appear

You configured the keyboard layout with the setxkbmap(1) command (like the br layout, which implements the ABNT2 keyboard layout), but inserting letters with accents using dead-keys don't show up anything.

To me the problem was that $LANG variable was not set. Try to set it according to your system. In my case I needed to execute the following command and then lauch OpenOffice using the same terminal:

export LANG=pt_BR.UTF-8

Inserting c-cedilla with us_intl keyboard layout

If you are using OpenOffice with a us intl keyboard layout (with dead keys), you might get a "ć" instead of a "ç" when pressing ' + c. Again, it is something related to the $LANG variable. Setting it to en_US.UTF-8 enable special characters, but might not put not the right ones you want for your language (the "ć" vs. "ç" case, for instance). Try setting it to your language (in my case, pt_BR.UTF-8).

Converting files from the command line

First, we need to run OpenOffice in headless mode:

soffice -headless -accept="socket,port=8100;urp;"

To make it work, no instance of OpenOffice might be running.

Once it runs, you can use the jodconverter program to convert any file to any format. Locate the file jodconverter-cli-2.2.2.jar and run it:

java -jar jodconverter-cli-2.2.2.jar <input-document> <output-document>

So, for instance:

java -jar jodconverter-cli-2.2.2.jar myfile.ods myfile.html

Troubleshooting: Exception in thread "main" java.lang.NullPointerException

When trying to run jodconverter, I got this error:

Exception in thread "main" java.lang.NullPointerException
        at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:399)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463)

This is because I have to run jodconvert-cli-2.2.2.jar, not jodconvert-2.2.2.jar (see the right one has the cli word in it).