OpenOffice::OODoc 对段落内的文本进行样式化
我有一个简单的任务,即添加一个段落,其中包含一些格式化文本。 我不知道如何使文本风格化。
输出示例:John Smith 200 Main Street single
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]) 来更改现有元素的样式。 我是否必须先添加文本才能设置样式?
I have a simple task of adding a paragraph that has some formatted text within it. I cannot figure out how to stylize the text.
Example output: John Smith 200 Main Street single
my $doc = odfDocument(file=> 'outputfile.odt',create=> 'text');
$doc->appendParagraph(text => "John Smith 200 Main Street single", style => "optionalParagraphStyle");
$doc->save;
I've been reading the documentation on CPAN http://search.cpan.org/~jmgdoc/OpenOffice-OODoc/
I see that I can use textStyle(element [, style]) to change the style of an existing element. Do I have to first add text in order to style it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 extendText() 和 setSpan() 在文档中。
这是一个执行您想要的操作的示例:
Please see extendText() and setSpan() in the Documentation.
Here is an example that does what you want: