Hello monks, I am doing some OpenOffice automation. For ages I am trying to find the right permutation of style definitions that give me an Impress document with one textbox containing "hello world" with font size 36. Can anyone point me to the right definition? Also I would be happy about some links to real life examples for OpenOffice::OODoc. This is what I tried so far. I figured out that somehow you need a style for the textbox and a separate style for the text itself.
use OpenOffice::OODoc; my $document = ooDocument( file => 'outputfile.odp', create => 'presentation' ); $document->createStyle( "TB", family => "paragraph", parent => "objectwithshadow", properties => { 'style:vertical-pos' => 'from-top', 'style:horizontal-pos' => 'from-left', 'style:vertical-rel' => 'page', 'style:horizontal-rel' => 'page', 'style:font-size' => '36pt', 'style:font-weight' => 'bold', } ); $document->createStyle ( "Colour", family => 'paragraph', parent => 'Standard', properties => { 'fo:margin-left' => '2cm', 'fo:margin-right' => '1.5cm', 'fo:text-align' => 'justify', 'fo:background-color' => '#ff00ff' 'fo:font-size' => '36pt', } ); $para = $document->createParagraph( "hello world", "Colour" ); $slide = $document->getDrawPage(0); $document->createTextBox( attachment => $slide, size => '10cm, 10cm', position => '4cm,4cm', content => $para, style => 'TB', ); $document->save;
*Solved*
OpenOffice::OODoc::Styles says the following on createStyle:

We could provide this new style with additional properties related to the text content of the paragraph. But, in a paragraph style definition, the "text" properties are not stored in the same logical area than the "paragraph" properties, and we can't set both in the same instruction. Fortunately, we can enrich any existing style at any time through the updateStyle() method

It has to be splitted into two statements. I just tested something similar successfully.
$document->createStyle ( "Colour", family => 'paragraph', parent => 'Standard' ); $document->updateStyle( "Colour", family => 'paragraph', parent => 'Standard', properties => { 'fo:margin-left' => '2cm', 'fo:margin-right' => '1.5cm', 'fo:text-align' => 'justify', 'fo:background-color' => '#ff00ff' 'fo:font-size' => '36pt', } );

print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});

In reply to OpenOffice::OODoc howto set size for textboxes by codeacrobat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.