libreoffice

Remote control or script Open Office to edit Word document from Python

随声附和 提交于 2019-12-01 00:31:50
I want to (preferably on Windows) start Open Office on a particular document, search for a fixed string and replace it with another string selected by my program. How do I do that, from an external Python program? OLE-something? The native Python scripting solution? (The document is in the Word 97-2003 format, but that is probably not relevant?) jro I'd say using the Python-UNO bridge . Does this work for you? import uno ctx = uno.getComponentContext() service_manager = ctx.getServiceManager() desktop = service_manager.createInstanceWithContext("com.sun.star.frame.Desktop", ctx) document =

How do you install or activate PyUno in LibreOffice?

假装没事ソ 提交于 2019-11-30 21:04:34
How do you make Python (any Python) know about PyUno in LibreOffice? When I do: import uno python says that it knows no module "uno". (This question came up re. this question .) As said in the response to your comment there: it's an optional installable component for OpenOffice. See the Introduction to Python on OOo page in OpenOffice's Wiki for installation details I am having the same issue with ubuntu 14.04 and python 2.7.6. But if you are using ubuntu 12.04, try using sudo apt-get install python-uno. Peter Krauss (UPDATING for 2014's) Perhaps the most used UNO application is document

Remote control or script Open Office to edit Word document from Python

倖福魔咒の 提交于 2019-11-30 20:45:17
问题 I want to (preferably on Windows) start Open Office on a particular document, search for a fixed string and replace it with another string selected by my program. How do I do that, from an external Python program? OLE-something? The native Python scripting solution? (The document is in the Word 97-2003 format, but that is probably not relevant?) 回答1: I'd say using the Python-UNO bridge. Does this work for you? import uno ctx = uno.getComponentContext() service_manager = ctx.getServiceManager(

Using variable images with django-webodt

旧街凉风 提交于 2019-11-30 16:06:44
问题 Is anyone using django-webodt? Looking through the documentation, I can't find anything about using images in a document. I want to insert "variable" images (ImageField) in my ODT document. Is this possible? I'm using the OpenOffice backend. 回答1: I don't know if it is a solution for you, I use pod in my projects with nice results, I have never tested to include images but it is documented: Quoting pod doc: Integrating external files or images into the result: the document function The

Using variable images with django-webodt

佐手、 提交于 2019-11-30 16:04:24
Is anyone using django-webodt ? Looking through the documentation, I can't find anything about using images in a document. I want to insert "variable" images (ImageField) in my ODT document. Is this possible? I'm using the OpenOffice backend. I don't know if it is a solution for you, I use pod in my projects with nice results, I have never tested to include images but it is documented: Quoting pod doc : Integrating external files or images into the result: the document function The document function allows you to integrate, into the ODT result, images or files that come from external sources.

docker安装LibreOffice

*爱你&永不变心* 提交于 2019-11-30 12:28:43
Dockerfile:      FROM centos # RUN yum install kde-l10n-Chinese -y # RUN yum install glibc-common -y # RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 RUN yum update -y && yum install telnet -y && yum remove epel-release -y \ && yum update -y \ && yum install epel-release -y \ && yum groupinstall "Fonts" -y \ && yum groupinstall "Input Methods" -y \ && rm -rf /etc/localtime \ && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ && yum -y install kde-l10n-Chinese \ && yum -y reinstall glibc-common && localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 \ && yum clean all ENV LC_ALL zh_CN.utf8 #

How do I make vba code compatible with libre office

拥有回忆 提交于 2019-11-30 12:19:20
I have recently migrated to pclinuxos from windows and seem to like it. The only problem I am facing is that libreoffice, the default spreadsheet package is not compatible with excel macros. Below is the vba code I have: Option VBASupport Sub DeleteToLeft() Selection.SpecialCells(xlBlanks).Delete shift:=xlToLeft End Sub Function SinceLastWash() Application.Volatile WashCount = 0 WearCount = 0 CurrentRow = Application.ThisCell.Row For i = 3 To 35 If Range(Cells(CurrentRow, i), Cells(CurrentRow, i)).Value = "a" Then WearCount = WearCount + 1 End If If Range(Cells(CurrentRow, i), Cells(CurrentRow

How to convert .docx to .odt with Libreoffice on Ubuntu bash

二次信任 提交于 2019-11-30 12:11:15
There is a problem for converting DOCX to PDF using Libreoffice.(in RTL documents) but converting same document saved in ODT format will works fine. Anyone knows how to convert an existing DOCX file to ODT using Ubuntu bash? Then you can use this command directly from command line libreoffice --headless --convert-to odt *.docx You can directly save it to odt format in Libre Office. Click on save as Select ODT as format Name the file Click on ok 来源: https://stackoverflow.com/questions/21845789/how-to-convert-docx-to-odt-with-libreoffice-on-ubuntu-bash

How do you install or activate PyUno in LibreOffice?

三世轮回 提交于 2019-11-30 05:33:45
问题 How do you make Python (any Python) know about PyUno in LibreOffice? When I do: import uno python says that it knows no module "uno". (This question came up re. this question.) 回答1: (UPDATING for 2014's) Perhaps the most used UNO application is document convertion... For this task, in nowadays, you not need UNO, you can use directly libreoffice --convert-to About UNO itself, see the new home page, http://api.libreoffice.org/ A good example of using python3-uno (or python-uno ) is the Docvert

How to convert pptx files to jpg or png (for each slide) on linux?

最后都变了- 提交于 2019-11-30 02:31:55
I want to convert a powerpoint presentation to multiple images. I already installed LibreOffice on my server and converting docx to pdf is no problem. pptx to pdf conversion does not work. I used following command line: libreoffice --headless --convert-to pdf filename.pptx Is there es way to convert pptx to pngs immediately or do I have to convert it to pdf first and then use ghostscript or something? And what about the quality settings? Is there a way to choose the resolution of the resulting images? Thanks in advance! EDIT: According to this link I was able to convert a pdf to images with