Littérature à emporter

Home / Accueil

Ebooks / Elivres


Tools / Outils


Problems / Problèmes


ODT2PML

This OpenOffice extension exports a Writer document into eReader files.

Last update: 2nd february 2009


Brief description

Download and install

You will need these programs:

Where are the extension icons?

Preparation of your file

The .pml file´s info fields

Picture conversion

Image size reduction

Table of contents

Text export

Note for Linux users

Can you answer these questions?

Thanks

Contact

Brief description

odt2pml exports a Writer document into a "Palm Markup Language" tagged plain text file, ready to be processed by DropBook for eReader.

Version 4.1 is available in the following languages: English, French, German, Italian, Spanish (depending on the OpenOffice user interface language).

Optionally, DropBook can be called automatically in order to create a .pdb file ready for eReader. This works only:

Three helper macros are included:

This extension is compatible with OpenOffice 2.4 or higher.

Download and install

Download the extension here.

To install this extension:

For more information, see this page.

After installing odt2pml, please close OpenOffice completely (also the Quickstarter, if you are using it) and restart it, so the extension´s toolbar and help pages will show up correctly in Writer.

You will need these programs:

All versions can be placed in the same subdirectory without any problem (DropBook 1.6 needs to be installed first, copy then dropbookpro.exe with the two others, you can now uninstall the 1.6 version you have just installed). You will have to choose between one of these three versions when you will call odt2pml: I seldom use v1.5.2 because this program have some bugs.

To configure Dropbook 1.6, double-click on it´s icon and check Build unencrypted book.

To reduce your document´s pictures, you will need an image converter such as XnView, it´s free and has my preference. Of course you are free to use the image converter of your choice, but it must be able to save the images in the 256 colors png format without interlacing and transparency. The Windows Paint program does not include the necessary features.

Where are the extension icons?

Open any Writer document and you will see the following icons in your toolbar:

Please save your document in OpenOffice Writer´s .odt format before clicking any of the icons if it has a different file format.

Preparation of your file

In this tutorial we will be using "Le chasseur de rats" ("The rat-hunter") by Gustave Aimard, available on Ebooks libres et gratuits (free ebooks in French language in formats for almost all platforms: MS-Word, OpenOffice, Palm eReader, MobiPocket, Acrobat and Epub).

In order not to overload the group´s server:

The .pml file´s info fields

You may define up to four fields for the resulting .pml file:

just by editing the document´s properties:

In the properties box (see above), write the author´s name in the first field, the editor´s name (or yours) in the second, and a copyright date or phrase in the third field.

The fourth field may contain the name of your future .pdb file, without pathname or extension. If you don´t write anything in this field the .pdb file name will be the .odt filename (with the pdb extension).

Assigning a specific name to the future .pdb file is quite useful for the following reasons

The first one corresponds to what I have written in the fourth info field. Should I have left it empty, I would have obtained the second one. The problem is with the word "source": a pdb file shouldn´t be used as a source!

 

If you open the .pml file produced by odt2pml in a text editor, you will see something like this:

What are those fields used for?

On Palm : nothing!

If you use the Windows version or eReader (under Linux, you can use it with the Wine emulator), you may see these informations:

Picture conversion

OpenOffice Writer may contain:

The novel "Le chasseur de rats" has only embedded images. The "Picture Converter" macro will extract these images, save them as .png images in the subdirectory expected by DropBook, and insert the corresponding links in the Writer document. Due to OpenOffice limitations, it can´t save those images with 256 colors (see the next chapter Image size reduction).

You will find the "Picture Converter" on the second left icon. On clicking, a dialog with 3 buttons opens. Click on the "Help" buttons, if necessary, and the on the "Continue" button.

After some time, one of these dialogs will show:

The first one just says that it did not find any pictures in your document. In that case, you can continue directly with the next step (Table of contents).

The other dialog indicates where the pictures are saved, with a remainder to convert them to the 256 colors png format.

Image size reduction

A little further in this tutorial we will see that it is possible to launch DropBook directly after the text extraction.

DropBook expects pictures in your document to be in png format, max. 256 colors, without interlacing nor transparency. The picture files can´t have more than 64 KB (65505 bytes). If any of these conditions is not met, DropBook will refuse to create the .pdb file.

You can use the image conversion program of your choice, for this tutorial I will use XnView. (A newer version is available, but the process is still the same.)

When you open an image with XnView, its characteristics are shown in the status bar: file name, image dimensions (width, height and depth, this last one in bits and words, here: 24 and true colors), and file size in KB.

Here you may see how to convert an image into 256 colors:

If necesSary, reduce the image size until the file size is less than 64 KB:

In the Screen Size zone, modify either the image´s width or height, keeping the "Keep Ratio" box checked:

If the file size is still too large, cancel the resize procedure and start again with different values. Resizing many times damages the picture much more than resizing only once.

Save the picture:

Uncheck the boxes "Interlaced" and "Set the transparency value". Do not modify the compression level.

Click on "OK", then on "Save".

Proceed in the same way for all images.

Table of contents

The Ebooks libres et gratuits files contains a table of contents wich is useless for eReader, you can erase the one in your document (you are still working with a copy, don´t you?) before or after the text export.

eReader´s table of contents is build with paragraph styles "Heading 1" to "Heading 4" and "Heading 5" to "Heading 8" (the entries built with the four last styles will be seen in the eReader´s table of contents but not in your text body).

Text export

Click on the most right button in the od2pml toolbar ( see the image in case of doubt).

The "Configuration" dialog will open directly on the first call of odt2pml. Afterwards, you may always click the "Configuration" button:

If you do not want direct DropBook execution, uncheck the checkbox.

For this example, we will launch DropBook at the end of the macro. Enter its location directly, or search for it with the "Browse" button. Check the checkbox, and click on "OK"

Click on the "Continue" button and wait some time... (don´t worry: it won´t be long)

The ebook title cannot include colons (:), and must not exceed 29 characters. Otherwise, a dialog box will open asking you to change it:

DropBook will be launched at the end of the macro. You will have to close DropBook´s report window, so that odt2pml may finish correctly.

Althought there are a lot of warnings, I can assure you that everything is OK. DropBook checks the chapters title length and warns if more than 80 characters are used, but, once again, everything is fine for this ebook.

You may edit the .pml file manually, if there are any errors in the .pdb file. Afterwards, you can call DropBook directly for this file (double click on DropBook icon to open it, or drag and drop the .pml file icon on DropBook´s icon).

If you want to learn more about PML tags, you may see this page: ereader.com (in English) or this one Mastik (in French, more complete).

The macro finishes with this dialog:

Or with this one if DropBook was not called:

Note for Linux users

In my Linux tests, DropBook v1.3 did not work with Wine. Version 1.5.2 of this program worked ok. Regrettably there is no Linux version of DropBook.

Can you answer these questions?

Thanks

Thanks to Walter H., from Switzerland, who notified me that the good configuration of Dropbook 1.6 was missing

Contact

Send any question or comment about this tutorial to:

litteratureaemporterNO_SPAM_PLEASEfree.fr

(Replace NO_SPAM_PLEASE with @)