OpenOffice::OODoc 1.2

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

The new OpenOffice::OODoc distribution, V 1.203, is available from CPAN

This pure Perl module allows direct read/write access to
files, without using the API. It provides an object
representation of the OOo documents, with a lot of methods to get,
create, update or delete any content or presentation element.

The most recent new features are:

- While the previous releases allowed only read/write operations in
previously existing documents, the present one can create new OOo
documents from scratch; the user has just to provide an additional
"create" option giving the document class in the main object
constructor. For ex, to create a new spreadsheet (i.e. OpenOffice Calc)
document that will be stored in a "doc.sxc" file, the constructor is:

    my $doc = ooDocument
            file => "doc.sxc",
            create => "spreadsheet"

The new documents are generated from a set of XML templates; if needed,
each application can select user-provided templates instead of the
default ones

- The createImageElement() method has been improved to allow easy image
import in drawing and presentation documents as well as in text or
spreadsheet documents. Ex:

        description    => "The Kilimanjaro",
        page        => 3,
        position    => "4.2cm, 5cm"
        size        => "3cm, 4cm",
        style        => "MyGraphics"

- The OOo date fields (stored in ISO-8601 format) can be easily
translated to/from Perl localtime() dates, due to new conversion functions;

- Symbolic color names (like "blue" or "yellow") and not only raw
hexadecimal RGB codes, are allowed for text and background colors. So,
to color in dark blue with a yellow background every paragraph or item
matching "OpenOffice" (or any other string or regex), the code is more

    # define the colored style
        properties    =>
            'fo:color' => rgb2oo("dark blue"),
            'fo:background-color' => rgb2oo("yellow")
    # give the colored style to the selected elements
    $doc->setStyle($_, "Outstanding")
        for $doc->selectElementsByContent("OpenOffice");

- Bug fixes and functional improvements in the localization; the local
character sets seems to be properly supported; the user's local
character (iso-8859-1 by default) can be selected either at the
installation level or separately in each application.

The previous text-focused methods (search/replace/create/remove) are

Please see for details

Thanks for comments

Site Timeline