我有一个简单的任务,即添加一个包含一些格式化文本的段落。我无法弄清楚如何对文本进行风格化。
示例输出:John Smith 200 Main Street 单曲
my $doc = odfDocument(file=> 'outputfile.odt',create=> 'text');
$doc->appendParagraph(text => "John Smith 200 Main Street single", style => "optionalParagraphStyle");
$doc->save;
我一直在阅读有关 CPAN 的文档http://search.cpan.org/~jmgdoc/OpenOffice-OODoc/ 我看到我可以使用textStyle(element [, style])来更改现有元素的样式。我必须先添加文本才能对其进行样式设置吗?