Questions tagged [pyuno]

PyUno is the official Python interface to the OpenOffice component model, UNO.

52 questions
1
vote
1 answer

How to get Text coordinates using PyUNO with OpenOffice writer

I have a python script that successfully does a search and replace in an OpenOffice Writer document using PyUNO. I wanna to ask how to get the coordinate of found text? import string search = document.createSearchDescriptor() search.SearchString =…
Randy
  • 13
  • 3
1
vote
0 answers

How can I intercept the drag and drop inside an openoffice/libre office document in python/pyuno?

I would like to intercept the drag and drop handling inside of a python/pyuno script inside of openoffice/libreoffice, how can this be done?
1
vote
0 answers

How to add TextShape to a document with Python Uno

After connecting to a document I have this code: page = document.getDrawPages().getByIndex( 0 ) textshape = document.createInstance('com.sun.star.drawing.TextShape') textshape.setSize(Size(150, 150)) textshape.setPosition(Point(100,…
user1433877
  • 145
  • 2
  • 8
1
vote
0 answers

Alternative to OpenOffice for converting PowerPoint to PDF

I'm currently using OpenOffice API (pyuno) to convert PowerPoint to PDF. However, the conversions end up looking not very good. I'm wondering if there is a conversion utility that has better output than OpenOffice.
Jordan Reiter
  • 20,467
  • 11
  • 95
  • 161
1
vote
0 answers

Clear Print Range in Pyuno?

I'm using unoconv to convert some xlsx spreadsheets to pdf, and need to clear the print area that's been set in the xlsx, as the pdf only contains those cells in the print area. Looking through the OO docs would suggest that I need to set the…
rdfield
  • 11
  • 1
0
votes
2 answers

use uno (openoffice api) to open spreadsheet *without* recalculation

I'm using pyuno to read an excel spreadsheet (running on linux.) Many cells have formulas referring to addins that are, obviously, not available. However the cell values are what I want. But when I load and read the sheet, it seems those formulas…
c-urchin
  • 4,344
  • 6
  • 28
  • 30
0
votes
0 answers

How to eval all conditional formatting instances that apply to a cell ? (without rewriting excel formula parser in python)

After trying to use openpyxl to try to know which styles is applied in order to get the the actual background color of a cell after the conditional formatting has been applied and realized that I would have to write a formula parser (and it makes no…
Salvador Aceves
  • 348
  • 1
  • 4
  • 13
0
votes
0 answers

How to import RichText/rtf and/or HTML content formatting into OpenOffice documents using PyUno

I'm looking to import RichText and/or HTML formatted text into OpenOffice documents, with the PyUno API. For now, the only solution I've found is to parse the format from source content and applying it to the document using text formatting (cursor's…
0
votes
1 answer

Placing cursor in the document for a given position using PyUNO

I am having Libreoffice7 installed with custom python 3.8.6 in Windows. I want to use PyUNO to navigate the view cursor to a specific position based on the X, Y coordinates(of instance com.sun.star.awt.Point) in a writer document. Is there a way by…
0
votes
1 answer

LibreOffice Tree with columns

I am writing an extension for LibreOffifce. A tree with columns on my sidebar is needed. (example - https://doc.qt.io/qt-5/qtwidgets-itemviews-simpletreemodel-example.html) I found information about Tree Control and module "tree", e.g.…
0
votes
0 answers

Cursor in python macro for LibreOffice Calc doesn't move

I am having difficulties with UNO to create Python macros for LibreOffice. Final Objective: To go one row down to the last row of my table. Table Example: Implemented Code (until now): #!/bin/python3 #Script usado no programa…
0
votes
1 answer

Regular expressions search in LibreOffice writer documents using pyuno extremely greedy

I have a LibreOffice writer document that contains text snippets of the form prefix<...>. In writer I can easily locate them with search for regular expressions: Now I would like to make a python list of all these occurrences using pyuno in a…
Jochen Schwarze
  • 292
  • 6
  • 27
0
votes
1 answer

How to convert a PDF file with NodeJS + Unoconv

I need to convert a docx file to pdf but I don't know very well nodejs, however, I know that the following can be done: There is a project called unoconv-worker and in it, there is a part where the following line appears: var child = spawn…
0
votes
1 answer

Optimizing formula copying in PyUno

LibreOffice 5.2.3.3 I'm trying to port an Excel VBScript program to PyUno. The logic works, but it runs much more slowly than it did in Excel. I made two sheets, Sheet1 and Sheet2. Referencing the below script, I added a button to Sheet1 to call…
Grault
  • 974
  • 12
  • 31
0
votes
1 answer

Opening multiple documents in a same window with UNO

I have script in python using pyuno that extracts data from many excel files. My problem is that for every file I open and close a window with url = unohelper.systemPathToFileUrl(os.path.abspath(file_name)) file = desktop.loadComponentFromURL(url,…
Green
  • 382
  • 3
  • 8