使用pyUno将文本写入Libre/OpenOffice Writer [英] Using pyUno to write text into Libre/OpenOffice Writer

查看:157
本文介绍了使用pyUno将文本写入Libre/OpenOffice Writer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Python中的一些文本导出到我根据这些创建的Libre/OpenOffice Writer文档中说明.

I am trying to export some text from Python into a Libre/OpenOffice Writer document which I created according to these instructions.

例如,使用

cursor.setPropertyValue("CharHeight", 20)
cursor.setPropertyValue("CharWeight", 150)
document.Text.insertString(cursor, "This Is Heading One", 0)

我可以使一行文本看起来像一个标题,但这只是文本,而不是实际的标题.我必须修改哪些属性值才能生成为目录选择的标题行?

I can make a line of text look like a heading, but it's just text and not an actual heading. What property values do I have to modify to generate a heading line that's picked up for the TOC?

通常,属性的文档在哪里,以及通常如何导航Writer文档?我很难挖掘所有东西!

In general, where is the documentation for the properties, and how to navigate the Writer document in general? I'm having a very hard time digging up anything at all!

推荐答案

我想这对

I guess this hasn't attracted much interest on stackoverflow :) Neither has it in the forum over at LibreOffice.

幸运的是,OpenOffice上的人们有一些很好的指导,而具有上述问题和更多问题的主题是

Fortunately, the folks over at OpenOffice had a few good pointers, and a thread with above questions and more is here. I'm going to keep discussing various aspects of document creation over there.

这篇关于使用pyUno将文本写入Libre/OpenOffice Writer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆