2022-08-15 23:57:31 -05:00
|
|
|
+++
|
|
|
|
title = "LibreOffice"
|
|
|
|
weight = 4
|
|
|
|
+++
|
|
|
|
|
2022-08-17 11:42:44 -05:00
|
|
|
### fonts
|
2022-08-15 23:57:31 -05:00
|
|
|
|
2022-08-17 11:42:44 -05:00
|
|
|
Devolver todas las fuentes visibles en LibreOffice. Mire [FontDescriptor][1]
|
2022-08-15 23:57:31 -05:00
|
|
|
|
|
|
|
```python
|
2022-08-17 11:42:44 -05:00
|
|
|
fonts = app.fonts()
|
|
|
|
for f in fonts:
|
|
|
|
app.debug(f'Nombre: {f.Name} - Estilo: {f.StyleName}')
|
2022-08-15 23:57:31 -05:00
|
|
|
```
|
2022-08-17 11:42:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
### filters
|
|
|
|
|
|
|
|
Devolver todos los filtros soportados en LibreOffice. Mire la [ayuda][2] y en [API FilterFactory][3] para más detalles.
|
|
|
|
|
|
|
|
```python
|
|
|
|
filtros = app.filters()
|
|
|
|
for f in filtros:
|
|
|
|
info = f"Nombre UI: {f['UIName']} - Nombre: {f['Name']} - Tipo: {f['Type']}"
|
|
|
|
app.debug(info)
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### dispatch
|
|
|
|
|
|
|
|
Ejecutar cualquier comando `UNO` de LibreOffice, mire la [lista de comandos][4] y [API dispatch][5].
|
|
|
|
|
|
|
|
Este método automáticamente agrega el prefijo necesario: `.uno:`
|
|
|
|
|
|
|
|
```python
|
|
|
|
doc = app.active
|
|
|
|
comando = 'Gallery'
|
|
|
|
app.dispatch(doc, comando)
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
[1]: https://api.libreoffice.org/docs/idl/ref/structcom_1_1sun_1_1star_1_1awt_1_1FontDescriptor.html
|
|
|
|
[2]: https://help.libreoffice.org/latest/en-US/text/shared/guide/convertfilters.html
|
|
|
|
[3]: https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1document_1_1FilterFactory.html
|
|
|
|
[4]: https://wiki.documentfoundation.org/Development/DispatchCommands
|
|
|
|
[5]: https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1frame_1_1XDispatch.html#a42beb1ea2ddae35c076b6e65867025ea
|