【发布时间】:2014-07-17 12:02:39
【问题描述】:
我有一个 python 脚本,它使用 PyUNO 成功地在 OpenOffice Writer 文档中进行搜索和替换。请问如何获取找到的文本的坐标?
import string
search = document.createSearchDescriptor()
search.SearchString = unicode('find')
#search.SearchCaseSensitive = True
#search.SearchWords = True
found = document.findFirst(search)
if found:
#log.debug('Found %s' % find)
## any code here help to get the coordinate of found text?
pass
【问题讨论】:
-
“坐标”是什么意思?文档中文本的位置取决于页面/字符大小和其他事实(屏幕/打印分辨率)。你想用这些值做什么?
-
目的问题是我想在odt文件中添加“指定”文本,并检测该文本的位置以调整页面大小。
标签: python openoffice-writer pyuno