How to iterate over objects inside slides, such as e.g. images, tables, etc?
For example, the code below connects to Impress, and retrieves 1st slide. But, how do I e.g. get images on this page?
#!python
import uno
# run libreoffice as:
# soffice --calc --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"
def connectToLO():
# get the uno component context from the PyUNO runtime
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", localContext )
# connect to the running office
ctx = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)
return desktop.CurrentComponent
model = connectToLO()
slide1 = model.DrawPages.getByIndex(0)
print(slide1.Name)