Closed YouvenZ closed 8 months ago
I am not sure of the solution for this just yet. At this time OooDev
does not have anything built in for this.
I am not even sure this is part of the LibreOffice API.
I did just today add an export Calc Range as Image. The demo is in this repo here.
The method to acomplish this uses filters. See my source for this here.
I am saying this because I suspect that the implemention you are looking for is similar for Draw.
In OooDev
See docs on Info.get_filter_names() and Info.get_filter_props() to get more information on filters.
See also https://ask.libreoffice.org/t/export-as-png-with-macro/74337/11 and https://ask.libreoffice.org/t/how-to-export-cell-range-to-images/57828/2
Thanks for the answer! In the the example with Calc, the dict event_data
seems to have exactly what I need. I will take a look at the documentation to understand filters and try. I will also try to post the example if I find the correct workaround.
I have been attempting to work out filters and add them to OooDev
. So far it seems to be challenging and there may be bugs in Python around filters and Image export.
I starteded a post on Ask: Basic works, Python fails same task. Exporting image fails for other resolutions. Why?
A new version of OooDev
has been released to day, version 0.23.0
.
Now it is possible to export Draw Page and Impress Pages with filters. This should give you what you need.
The Impress Slide to Image example has been updated to reflect the usage of filters.
Also there is an Impress Slide to Image 2 example that shows how export pages using filters in a different way.
Support has been added for exporting indivitual shapes a images too. The Export Shape as Image demonstrates this.
Hi @Amourspirit !
I would like to get acces to the option presented when saving a draw/Impress doc
First I tried to change the size slide directly by changing the property height and weight
but I was wrong it change actual size of the draw not the resolution. I want to change the resolution and the transparency of the image saved. could you provide some guidance on this please.