perl - OpenOffice::OODoc stylize text within a paragraph -


I have a simple task to add a paragraph in which it has some formatted text, I can not understand the text to style Example Production: John Smith 200 Main Street Single

  My $ doc = odfDocument (file = & gt; 'Outputfile.odt', Create = & gt; 'Text'); $ Doc- & gt; Append paragraph (text = & gt; "John Smith 200 main street single", style => "optional paragraph style"); $ Doctor & gt; Save;  

I am reading documentation on CPAN I see that I can use the text style (element [, style]) to change the style of the existing element. Do I have to add text first in style?

Please see and in documentation.

Here is an example that you want:

  Use OpenOffice :: OODoc; My $ doc = odfDocument (file = & gt; 'outputfile.odt', create => 'text'); $ Doc- & gt; CreateStyle ("strong", family = & gt; "text", attribute = & gt; {"fo: font-weight" = & gt; "bold"}); $ Doc- & gt; CreateStyle ("em", family = & gt; "text", property = & gt; {"fo: font-style" => "italic"}); My $ p = $ doc- & gt; Append paragraph (text => gt; style = & gt; "optional paragraph style"); $ Doc- & gt; Expanded text ($ p, "John Smith"); $ Doc- & gt; Expanded text ($ p, "200 Main Street", "Strong"); $ Doc- & gt; Expansion text ($ p, "single", "m"); My $ p = $ doc- & gt; Append paragraph (text = & gt; "John Smith 200 Main Street Single", style => "Optional paragraph style"); $ Doc- & gt; SetSpain ($ p, "200 Main Street", "Strong"); $ Doc- & gt; Setspan ($ p, "single", "m"); $ Doctor & gt; Save;  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -