在Python中使用LibreOffice:I / O过滤器


使用的版本

  • LibreOffice 6.4.4
  • 的Python 3.7.7

总览

使用LibreOffice读取或写入文档时,文件格式和内部数据由输入/输出过滤器转换。
当使用--convert-to开关从命令行转换文件格式以及从宏或程序读取和写入文件时,过滤器由过滤器名称和过滤器选项指定。
过滤器列表可以从LibreOffice安装目录或UNO界面下的文件中获取。

从Python-UNO桥使用I / O过滤器

阅读文档

文档由com.sun.star.frame.Desktop接口从XComponentLoader接口继承的loadComponentFromURL()方法加载。
您可以在第4个参数Arguments中指定过滤器名称和过滤器选项。参数的类型为sequence< com::sun::star::beans::PropertyValue >,但在Python-UNO桥的情况下,它是com.sun.star.beans.PropertyValue实例的元组。
参数称为com::sun::star::document::MediaDescriptor
它说FilterName必须匹配TypeDetection的配置,但实际上它需要匹配FilterFactory服务的Element,而不是TypeDetection。从同一页面链接的过滤器名称列表似乎也不正确。

如果未在

参数中指定过滤器名称,则将根据文件内容自动确定过滤器名称。

1
2
3
4
5
import uno

url = uno.systemPathToFileUrl('test.ods')
desktop = XSCRIPTCONTEXT.getDesktop()
document = desktop.loadComponentFromURL(url, '_blank', 0, ())

自动判断并不总是有效的,如果您指定CSV文件,将启动"计算CSV导入"对话框。
您可以通过指定过滤器名称和过滤器选项以编程方式指定导入方法。

1
2
3
4
5
6
7
8
import uno
from com.sun.star.beans import PropertyValue

url = uno.systemPathToFileUrl('test.csv')
desktop = XSCRIPTCONTEXT.getDesktop()
argument = (PropertyValue(Name='FilterName', Value='Text - txt - csv (StarCalc)'),
        PropertyValue(Name='FilterOptions', Value='44,34,76'))
document = desktop.loadComponentFromURL(url, '_blank', 0, argument)

文件汇出

使用XComponent接口继承的XStorable接口的store(),storeAsURL()和storeToURL()方法编写文档。
由于store()写入等效于从GUI保存的已加载文件,因此使用与加载相同的过滤器。
storeAsURL()等效于另存为,并通过指定导出目标文件进行保存。导出目标文件和过滤器作为新文件和过滤器记录在文档中。要使用的过滤器必须具有输入(导入)和输出(导出)功能。
通过指定导出目标文件,storeToURL()等效于导出和导出。文档文件名和过滤器不会更新。可以使用仅输出过滤器。
如果未指定过滤器,则将使用默认过滤器。输出文件格式为ODF。

1
2
3
4
5
6
7
8
import uno
from com.sun.star.beans import PropertyValue

document = XSCRIPTCONTEXT.getDocument()
url = uno.systemPathToFileUrl('test.csv')
argument = (PropertyValue(Name='FilterName', Value='Text - txt - csv (StarCalc)'),
        PropertyValue(Name='FilterOptions', Value='44,34,76,,,,,,true'))
document.storeAsURL(url, argument)

可用的过滤器名称

从Python-UNO桥

获得

I / O筛选器可以在FilterFactory服务中列出。
每个过滤器均按名称标识。过滤器属性在Apache OpenOffice Wiki上的过滤器属性中描述。
除LibreOffice最初拥有的过滤器外,FilterFactory服务还共同管理由扩展添加的过滤器。

DocumentService属性标识感兴趣的文档的类型。 com.sun.star.text.TextDocument的Writer文档和com.sun.star.sheet.SpreadsheetDocument的Calc电子表格。这与每个文档的getIdentifier()方法返回的值匹配。
Type属性标识正在输入和输出的文件的类型。此属性保存类型的名称,对于每种类型,您都可以使用TypeDetection服务获取该属性。
Flags属性是多个标志的组合。 IMPORT标志表明它是输入过滤器,而EXPORT标志表明它是输出过滤器。 DEFAULT过滤器指示它是DocumentService的默认过滤器,而PREFERRED过滤器指示它是优先于Type使用的过滤器。

TypeDetection服务定义文件的类型。
每种类型均由名称标识。
扩展名属性列出了目标文件的扩展名。

下面是从FilterFactory服务获得的过滤器列表,一些属性表和相应Type的某些属性。标志仅限于IMPORT,EXPORT,DEFAULT和DMA。

<表格>

名称

文档服务

UIName

标志

类型

扩展名

MediaType


<身体>

StarSuite XML(基本)报告图表

com.sun.star.chart2.ChartDocument

OpenOffice.org 1.0报告图

导入导出默认值

StarBaseReportChart

odc

应用程序/ vnd.sun.xml.report.chart

StarSuite XML(图表)

com.sun.star.chart2.ChartDocument

OpenOffice.org 1.0图形

导入

chart_StarOffice_XML_Chart

sxs

应用程序/ vnd.sun.xml.chart

chart8

com.sun.star.chart2.ChartDocument

ODF图

导入导出默认PLL

chart8

odc

应用程序/ vnd.oasis.opendocument.chart

BMP --MS Windows

com.sun.star.drawing.DrawingDocument

BMP --Windows位图

导入

bmp_MS_Windows

bmp

图片/ x-MS-bmp

ClarisWorks_Draw

com.sun.star.drawing.DrawingDocument

ClarisWorks / AppleWorks工程图

导入PLL

draw_ClarisWorks

cwk

应用程序/ clarisworks

Corel Draw文档

com.sun.star.drawing.DrawingDocument

Corel抽奖

导入PLL

draw_CorelDraw_Document

cdr

应用程序/ vnd.corel-draw

Corel Presentation Exchange

com.sun.star.drawing.DrawingDocument

Corel Presentation Exchange

导入PLL

draw_Corel_Presentation_Exchange

cmx

图片/ x-cmx

DXF --AutoCAD互换

com.sun.star.drawing.DrawingDocument

DXF --AutoCAD交换格式

导入

dxf_AutoCAD_Interchange

dxf

图片/ vnd.dxf

EMF --MS Windows图元文件

com.sun.star.drawing.DrawingDocument

EMF-增强型图元文件

导入

emf_MS_Windows_Metafile

emf

图片/ x-emf

EPS-封装的PostScript

com.sun.star.drawing.DrawingDocument

EPS-封装的PostScript

导入

eps_Encapsulated_PostScript

eps

图片/ x-eps

写意文档

com.sun.star.drawing.DrawingDocument

Adob??e / Macromedia写意

导入PLL

draw_Freehand_Document

fh fh1 fh2 fh3 fh4 fh5 fh6 fh7 fh8 fh9 fh10 fh11

图片/ x写意

GIF-图形交换

com.sun.star.drawing.DrawingDocument

GIF-图形交换格式

导入

gif_Graphics_Interchange

gif

图片/ gif

JPG --JPEG

com.sun.star.drawing.DrawingDocument

JPEG-联合图像专家组

导入

jpg_JPEG

jpg jpeg jfif jif jpe

图片/ jpeg

MET --OS / 2图元文件

com.sun.star.drawing.DrawingDocument

MET --OS / 2图元文件

导入

meta_OS2_Metafile

遇见

图片/ x-met

MOV --MOV

com.sun.star.drawing.DrawingDocument

MOV --QuickTime文件格式

导入

mov_MOV

mov MOV

应用程序/电影

MWAW_Bitmap

com.sun.star.drawing.DrawingDocument

旧Mac位图

导入PLL

MWAW_Bitmap

*


MWAW_Drawing

com.sun.star.drawing.DrawingDocument

旧Mac绘图格式

导入PLL

MWAW_Drawing

*


OpenDocument绘图平面XML

com.sun.star.drawing.DrawingDocument

平面XML ODF图纸

导入导出

draw_ODG_FlatXML

fodg odg xml

应用程序/ vnd.oasis.opendocument.graphics-flat-xml

PBM-便携式位图

com.sun.star.drawing.DrawingDocument

PBM-便携式位图

导入

pbm_Portable_Bitmap

pbm

图片/ x便携式位图

PCT --Mac Pict

com.sun.star.drawing.DrawingDocument

PCT --Mac Pict

导入

pct_Mac_Pict

pct pict

图片/ x点

PCX-Zsoft Paintbrush

com.sun.star.drawing.DrawingDocument

PCX-Zsoft Paintbrush

导入

pcx_Zsoft_Paintbrush

pcx

图片/ x-pcx

PGM-便携式灰度图

com.sun.star.drawing.DrawingDocument

PGM-便携式灰度图

导入

pgm_Portable_Graymap

pgm

图片/ x-portable-graymap

PNG-便携式网络图形

com.sun.star.drawing.DrawingDocument

PNG-便携式网络图形

导入

png_Portable_Network_Graphic

png

图片/ png

PPM-便携式像素图

com.sun.star.drawing.DrawingDocument

PPM-便携式像素图

导入

ppm_Portable_Pixelmap

ppm

图片/ x-portable-pixmap

PSD-Adobe Photoshop

com.sun.star.drawing.DrawingDocument

PSD-Adobe Photoshop

导入

psd_Adobe_Photoshop

psd

图片/ vnd.adobe.photoshop

PageMaker文档

com.sun.star.drawing.DrawingDocument

Adob??e PageMaker

导入PLL

draw_PageMaker_Document

p65 pm pm6 pmd

应用程序/ x-pagemaker

发布者文档

com.sun.star.drawing.DrawingDocument

Microsoft Publisher 98-2010

导入PLL

draw_Publisher_Document

pub

应用程序/ x-mspublisher

QXP文档

com.sun.star.drawing.DrawingDocument

QuarkXPress

导入PLL

draw_QXP_Document

qxd qxt


RAS --Sun Rasterfile

com.sun.star.drawing.DrawingDocument

RAS --Sun光栅图像

导入

ras_Sun_Rasterfile

ras

图片/ x-cmu-raster

SVG-比例矢量图形绘制

com.sun.star.drawing.DrawingDocument

SVG-可缩放矢量图形

导入PLL

svg_Scalable_Vector_Graphics_Draw

svg svgz

图片/ svg xml

SVM --StarView图元文件

com.sun.star.drawing.DrawingDocument

SVM --StarView图元文件

导入

svm_StarView_Metafile

svm

图片/ x-svm

StarSuite XML(绘图)

com.sun.star.drawing.DrawingDocument

OpenOffice.org 1.0绘图

导入PLL

draw_StarOffice_XML_Draw

sxd

应用程序/ vnd.sun.xml.draw

StarSuite_Drawing

com.sun.star.drawing.DrawingDocument

旧版StarSuite图纸

导入PLL

StarSuite_Drawing

sda


TGA --Truevision TARGA

com.sun.star.drawing.DrawingDocument

TGA --Truevision Targa

导入

tga_Truevision_TARGA

tga

图片/ x-targa

TIF-标记图像文件

com.sun.star.drawing.DrawingDocument

TIFF-标记图像文件格式

导入

tif_Tag_Image_File

tif tiff

图片/ tiff

Visio文档

com.sun.star.drawing.DrawingDocument

Microsoft Visio 2000-2013

导入PLL

draw_Visio_Document

vdx vsd vsdm vsdx

应用程序/ vnd.visio

WMF --MS Windows图元文件

com.sun.star.drawing.DrawingDocument

WMF --Windows图元文件

导入

wmf_MS_Windows_Metafile

wmf

图片/ x-wmf

WordPerfect图形

com.sun.star.drawing.DrawingDocument

WordPerfect图形

导入PLL

draw_WordPerfect_Graphics

wpg

图片/ x-wpg

XBM --X-财团

com.sun.star.drawing.DrawingDocument

XBM --X位图

导入

xbm_X_Consortium

xbm

图片/ x-xbitmap

XHTML绘图文件

com.sun.star.drawing.DrawingDocument

XHTML

导出

XHTML_File

html xhtml

应用程序/ xhtml xml

XPM

com.sun.star.drawing.DrawingDocument

XPM --X PixMap

导入

xpm_XPM

xpm

图片/ x-xpixmap

ZMF文档

com.sun.star.drawing.DrawingDocument

Zoner Callisto /工程图

导入PLL

draw_ZMF_Document

zmf


draw8

com.sun.star.drawing.DrawingDocument

ODF图纸

导入导出默认PLL

draw8

odg

应用程序/ vnd.oasis.opendocument.graphics

draw8_template

com.sun.star.drawing.DrawingDocument

ODF绘图模板

导入导出

draw8_template

otg

应用程序/ vnd.oasis.opendocument.graphics-template

draw_PCD_Photo_CD_Base

com.sun.star.drawing.DrawingDocument

PCD-柯达Photo CD(768x512)

导入

pcd_Photo_CD_Base

pcd

图片/ x-photo-cd

draw_PCD_Photo_CD_Base16

com.sun.star.drawing.DrawingDocument

PCD-柯达Photo CD(192x128)

导入

pcd_Photo_CD_Base16

pcd

图片/ x-photo-cd

draw_PCD_Photo_CD_Base4

com.sun.star.drawing.DrawingDocument

PCD-柯达Photo CD(384x256)

导入

pcd_Photo_CD_Base4

pcd

图片/ x-photo-cd

draw_StarOffice_XML_Draw_Template

com.sun.star.drawing.DrawingDocument

OpenOffice.org 1.0绘图模板

导入

draw_StarOffice_XML_Draw_Template

std

应用程序/ vnd.sun.xml.draw.template

draw_bmp_Export

com.sun.star.drawing.DrawingDocument

BMP --Windows位图

导出

bmp_MS_Windows

bmp

图片/ x-MS-bmp

draw_emf_Export

com.sun.star.drawing.DrawingDocument

EMF-增强型图元文件

导出

emf_MS_Windows_Metafile

emf

图片/ x-emf

draw_eps_Export

com.sun.star.drawing.DrawingDocument

EPS-封装的PostScript

导出

eps_Encapsulated_PostScript

eps

图片/ x-eps

draw_flash_Export

com.sun.star.drawing.DrawingDocument

Macromedia Flash(SWF)

导出

graphic_SWF

swf


draw_gif_Export

com.sun.star.drawing.DrawingDocument

GIF-图形交换格式

导出

gif_Graphics_Interchange

gif

图片/ gif

draw_html_Export

com.sun.star.drawing.DrawingDocument

HTML文档(绘图)

导出

graphic_HTML

html htm

文本/ html

draw_jpg_Export

com.sun.star.drawing.DrawingDocument

JPEG-联合图像专家组

导出

jpg_JPEG

jpg jpeg jfif jif jpe

图片/ jpeg

draw_pdf_Export

com.sun.star.drawing.DrawingDocument

PDF-便携式文档格式

导出

pdf_Portable_Document_Format

pdf

应用程序/ pdf

draw_pdf_addstream_import

com.sun.star.drawing.DrawingDocument

PDF-便携式文档格式

导入

pdf_Portable_Document_Format

pdf

应用程序/ pdf

draw_pdf_import

com.sun.star.drawing.DrawingDocument

PDF-便携式文档格式(绘图)

导入PLL

pdf_Portable_Document_Format

pdf

应用程序/ pdf

draw_png_Export

com.sun.star.drawing.DrawingDocument

PNG-便携式网络图形

导出

png_Portable_Network_Graphic

png

图片/ png

draw_svg_Export

com.sun.star.drawing.DrawingDocument

SVG-比例矢量图形

导出

svg_Scalable_Vector_Graphics

svg svgz

图片/ svg xml

draw_tif_Export

com.sun.star.drawing.DrawingDocument

TIFF-标记图像文件格式

导出

tif_Tag_Image_File

tif tiff

图片/ tiff

draw_wmf_Export

com.sun.star.drawing.DrawingDocument

WMF --Windows图元文件

导出

wmf_MS_Windows_Metafile

wmf

图片/ x-wmf

MathML XML(数学)

com.sun.star.formula.FormulaProperties

MathML 2.0

导入导出

math_MathML_XML_Math

mml

应用程序/ mathml xml

MathType 3.x

com.sun.star.formula.FormulaProperties

MathType3.x

导入导出

math_MathType_3x

xxx


StarSuite XML(数学)

com.sun.star.formula.FormulaProperties

OpenOffice.org 1.0公式

导入

math_StarOffice_XML_Math

sxm

应用程序/ vnd.sun.xml.math

math8

com.sun.star.formula.FormulaProperties

ODF公式

导入导出默认值

math8

odf

应用程序/ vnd.oasis.opendocument.formula

math_pdf_Export

com.sun.star.formula.FormulaProperties

PDF-便携式文档格式

导出

pdf_Portable_Document_Format

pdf

应用程序/ pdf

Apple Keynote

com.sun.star.presentation.PresentationDocument

Apple Keynote

导入PLL

impress_AppleKeynote

应用程序/ x-iwork-keynote-sffkey

CGM-计算机图形图元文件

com.sun.star.presentation.PresentationDocument

CGM-计算机图形图元文件

导入

impress_CGM_Computer_Graphics_Metafile

cgm

图片/ cgm

ClarisWorks_Impress

com.sun.star.presentation.PresentationDocument

ClarisWorks / AppleWorks演示文稿

导入PLL

impress_ClarisWorks

cwk

应用程序/ clarisworks

留下深刻印象的MS PowerPoint 2007 XML

com.sun.star.presentation.PresentationDocument

PowerPoint 2007–365

导入导出PLL

MS PowerPoint 2007 XML

pptx

应用程序/ vnd.openxmlformats-officedocument.presentationml.presentation

留下深刻印象的MS PowerPoint 2007 XML自动播放

com.sun.star.presentation.PresentationDocument

PowerPoint 2007–365自动播放

导入导出PLL

MS PowerPoint 2007 XML自动播放

ppsx

应用程序/ vnd.openxmlformats-officedocument.presentationml.slideshow

留下深刻印象的MS PowerPoint 2007 XML模板

com.sun.star.presentation.PresentationDocument

PowerPoint 2007–365模板

导入导出PLL

MS PowerPoint 2007 XML模板

potx potm

应用程序/ vnd.openxmlformats-officedocument.presentationml.template

留下深刻印象的MS PowerPoint 2007 XML VBA

com.sun.star.presentation.PresentationDocument

PowerPoint 2007–365 VBA

导入导出PLL

MS PowerPoint 2007 XML VBA

pptm

应用程序/ vnd.ms-powerpoint.presentation.macroEnabled.main xml

给Office Open XML留下深刻印象

com.sun.star.presentation.PresentationDocument

Office Open XML演示文稿

导入导出PLL

Office Open XML演示文稿

pptx pptm

应用程序/ vnd.openxmlformats-officedocument.presentationml.presentation

打动Office Open XML自动播放

com.sun.star.presentation.PresentationDocument

Office Open XML演示文稿自动播放

导入导出PLL

Office Open XML演示文稿自动播放

ppsx

应用程序/ vnd.openxmlformats-officedocument.presentationml.slideshow

打动Office Open XML模板

com.sun.star.presentation.PresentationDocument

Office Open XML演示模板

导入导出PLL

Office Open XML演示模板

potx potm

应用程序/ vnd.openxmlformats-officedocument.presentationml.template

MS PowerPoint 97

com.sun.star.presentation.PresentationDocument

PowerPoint 97–2003

导入导出

impress_MS_PowerPoint_97

ppt dps

应用程序/ vnd.ms-powerpoint

MS PowerPoint 97自动播放

com.sun.star.presentation.PresentationDocument

PowerPoint 97–2003自动播放

导入导出

impress_MS_PowerPoint_97_AutoPlay

pps

应用程序/ vnd.ms-powerpoint

MS PowerPoint 97 Vorlage

com.sun.star.presentation.PresentationDocument

PowerPoint 97–2003模板

导入导出

impress_MS_PowerPoint_97_Vorlage

锅dpt

应用程序/ vnd.ms-powerpoint

MWAW_Presentation

com.sun.star.presentation.PresentationDocument

旧Mac演示文稿

导入PLL

MWAW_Presentation

*


OpenDocument Presentation Flat XML

com.sun.star.presentation.PresentationDocument

平面XML ODF表示

导入导出

impress_ODP_FlatXML

fodp odp xml

应用程序/ vnd.oasis.opendocument.presentation-flat-xml

PowerPoint 3

com.sun.star.presentation.PresentationDocument

Microsoft PowerPoint 1-4和95

导入

impress_PowerPoint3

ppt罐


SVG-比例矢量图形

com.sun.star.presentation.PresentationDocument

SVG-比例矢量图形

导入PLL

svg_Scalable_Vector_Graphics

svg svgz

图片/ svg xml

StarSuite XML(印象)

com.sun.star.presentation.PresentationDocument

OpenOffice.org 1.0演示文稿

导入PLL

impress_StarOffice_XML_Impress

sxi

应用程序/ vnd.sun.xml.impress

StarSuite_Presentation

com.sun.star.presentation.PresentationDocument

旧版StarSuite演示文稿

导入PLL

StarSuite_Presentation

sdd


UOF演示文稿

com.sun.star.presentation.PresentationDocument

统一Office格式演示

导入导出

Unified_Office_Format_presentation

uop uof


XHTML印象文件

com.sun.star.presentation.PresentationDocument

XHTML

导出

XHTML_File

html xhtml

应用程序/ xhtml xml

impress8

com.sun.star.presentation.PresentationDocument

ODF演示

导入导出默认PLL

impress8

odp

应用程序/ vnd.oasis.opendocument.presentation

impress8_draw

com.sun.star.presentation.PresentationDocument

ODF图(印象)

导入导出

draw8

odg

应用程序/ vnd.oasis.opendocument.graphics

impress8_template

com.sun.star.presentation.PresentationDocument

ODF演示模板

导入导出

impress8_template

otp

应用程序/ vnd.oasis.opendocument.presentation-template

impress_StarOffice_XML_Draw

com.sun.star.presentation.PresentationDocument

OpenOffice.org 1.0绘图(印象)

导入

draw_StarOffice_XML_Draw

sxd

应用程序/ vnd.sun.xml.draw

impress_StarOffice_XML_Impress_Template

com.sun.star.presentation.PresentationDocument

OpenOffice.org 1.0演示模板

导入

impress_StarOffice_XML_Impress_Template

sti

应用程序/ vnd.sun.xml.impress.template

impress_bmp_Export

com.sun.star.presentation.PresentationDocument

BMP --Windows位图

导出

bmp_MS_Windows

bmp

图片/ x-MS-bmp

impress_emf_Export

com.sun.star.presentation.PresentationDocument

EMF-增强型图元文件

导出

emf_MS_Windows_Metafile

emf

图片/ x-emf

impress_eps_Export

com.sun.star.presentation.PresentationDocument

EPS-封装的PostScript

导出

eps_Encapsulated_PostScript

eps

图片/ x-eps

impress_flash_Export

com.sun.star.presentation.PresentationDocument

Macromedia Flash(SWF)

导出

graphic_SWF

swf


impress_gif_Export

com.sun.star.presentation.PresentationDocument

GIF-图形交换格式

导出

gif_Graphics_Interchange

gif

图片/ gif

impress_html_Export

com.sun.star.presentation.PresentationDocument

HTML文档(印象深刻)

导出

graphic_HTML

html htm

文本/ html

impress_jpg_Export

com.sun.star.presentation.PresentationDocument

JPEG-联合图像专家组

导出

jpg_JPEG

jpg jpeg jfif jif jpe

图片/ jpeg

impress_pdf_Export

com.sun.star.presentation.PresentationDocument

PDF-便携式文档格式

导出

pdf_Portable_Document_Format

pdf

应用程序/ pdf

impress_pdf_addstream_import

com.sun.star.presentation.PresentationDocument

PDF-便携式文档格式

导入

pdf_Portable_Document_Format

pdf

应用程序/ pdf

impress_pdf_import

com.sun.star.presentation.PresentationDocument

PDF-便携式文档格式(Impress)

导入PLL

pdf_Portable_Document_Format

pdf

应用程序/ pdf

impress_png_Export

com.sun.star.presentation.PresentationDocument

PNG-便携式网络图形

导出

png_Portable_Network_Graphic

png

图片/ png

impress_svg_Export

com.sun.star.presentation.PresentationDocument

SVG-比例矢量图形

导出

svg_Scalable_Vector_Graphics

svg svgz

图片/ svg xml

impress_tif_Export

com.sun.star.presentation.PresentationDocument

TIFF-标记图像文件格式

导出

tif_Tag_Image_File

tif tiff

图片/ tiff

impress_wmf_Export

com.sun.star.presentation.PresentationDocument

WMF --Windows图元文件

导出

wmf_MS_Windows_Metafile

wmf

图片/ x-wmf

StarSuite XML(基础)报告

com.sun.star.report.ReportDefinition

ODF数据库报告

导入导出默认值

StarBaseReport

orp

应用程序/ vnd.sun.xml.report

StarSuite XML(基础)

com.sun.star.sdb.OfficeDatabaseDocument

ODF数据库

导入默认值

StarBase

odb

应用程序/ vnd.sun.xml.base

ADO行集XML

com.sun.star.sheet.SpreadsheetDocument

ADO行集XML

导入

calc_ADO_rowset_XML

xml


苹果号码

com.sun.star.sheet.SpreadsheetDocument

苹果号码

导入PLL

calc_AppleNumbers

数字

应用程序/ x-iwork-numbers-sffnumbers

Calc MS Excel 2007 Binary

com.sun.star.sheet.SpreadsheetDocument

Microsoft Excel 2007 Binary

导入PLL

MS Excel 2007二进制

xlsb


Calc MS Excel 2007 VBA XML

com.sun.star.sheet.SpreadsheetDocument

Excel 2007–365(启用宏)

导入导出PLL

MS Excel 2007 VBA XML

xlsm

应用程序/ vnd.ms-excel.sheet.macroEnabled.12

Calc MS Excel 2007 XML

com.sun.star.sheet.SpreadsheetDocument

Excel 2007–365

导入导出PLL

MS Excel 2007 XML

xlsx

应用程序/ vnd.openxmlformats-officedocument.spreadsheetml.sheet

Calc MS Excel 2007 XML模板

com.sun.star.sheet.SpreadsheetDocument

Excel 2007–365模板

导入导出

MS Excel 2007 XML模板

xltx xltm

应用程序/ vnd.openxmlformats-officedocument.spreadsheetml.template

Calc Office Open XML

com.sun.star.sheet.SpreadsheetDocument

Office Open XML电子表格文档

导入导出PLL

Office Open XML电子表格

xlsx xlsm

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Calc Office Open XML Template com.sun.star.sheet.SpreadsheetDocument Office Open XML 表計算ドキュメントテンプレート IMPORT Office Open XML Spreadsheet Template xltx xltm application/vnd.openxmlformats-officedocument.spreadsheetml.template ClarisWorks_Calc com.sun.star.sheet.SpreadsheetDocument ClarisWorks/AppleWorks 表計算ドキュメント IMPORT PREFERRED calc_ClarisWorks cwk application/clarisworks Claris_Resolve_Calc com.sun.star.sheet.SpreadsheetDocument ClarisResolve ドキュメント IMPORT PREFERRED calc_Claris_Resolve cwk application/clarisworks DIF com.sun.star.sheet.SpreadsheetDocument Data Interchange Format IMPORT EXPORT calc_DIF dif Gnumeric Spreadsheet com.sun.star.sheet.SpreadsheetDocument Gnumeric 表計算ドキュメント IMPORT PREFERRED Gnumeric XML gnumeric gnm application/x-gnumeric HTML (StarCalc) com.sun.star.sheet.SpreadsheetDocument HTML ドキュメント (Calc) IMPORT EXPORT generic_HTML html xhtml htm text/html Lotus com.sun.star.sheet.SpreadsheetDocument Lotus 1-2-3 IMPORT PREFERRED calc_Lotus wk1 wks 123 application/vnd.lotus-1-2-3 MS Excel 2003 XML com.sun.star.sheet.SpreadsheetDocument Microsoft Excel 2003 XML EXPORT calc_MS_Excel_2003_XML xml xls MS Excel 2003 XML Orcus com.sun.star.sheet.SpreadsheetDocument Microsoft Excel 2003 XML IMPORT PREFERRED calc_MS_Excel_2003_XML xml xls MS Excel 4.0 com.sun.star.sheet.SpreadsheetDocument Microsoft Excel 4.0 IMPORT PREFERRED calc_MS_Excel_40 xls xlw xlc xlm application/vnd.ms-excel MS Excel 4.0 Vorlage/Template com.sun.star.sheet.SpreadsheetDocument Microsoft Excel 4.0 テンプレート IMPORT calc_MS_Excel_40_VorlageTemplate xlt application/vnd.ms-excel MS Excel 5.0/95 com.sun.star.sheet.SpreadsheetDocument Microsoft Excel 5.0 IMPORT PREFERRED calc_MS_Excel_5095 xls xlc xlm xlw application/vnd.ms-excel MS Excel 5.0/95 Vorlage/Template com.sun.star.sheet.SpreadsheetDocument Microsoft Excel 5.0 テンプレート IMPORT calc_MS_Excel_5095_VorlageTemplate xlt application/vnd.ms-excel MS Excel 95 com.sun.star.sheet.SpreadsheetDocument Microsoft Excel 95 IMPORT PREFERRED calc_MS_Excel_95 xls xlc xlm xlw application/vnd.ms-excel MS Excel 95 Vorlage/Template com.sun.star.sheet.SpreadsheetDocument Microsoft Excel 95 テンプレート IMPORT calc_MS_Excel_95_VorlageTemplate xlt application/vnd.ms-excel MS Excel 97 com.sun.star.sheet.SpreadsheetDocument Excel 97–2003 IMPORT EXPORT PREFERRED calc_MS_Excel_97 xls xlc xlm xlw xlk et application/vnd.ms-excel MS Excel 97 Vorlage/Template com.sun.star.sheet.SpreadsheetDocument Excel 97–2003 テンプレート IMPORT EXPORT calc_MS_Excel_97_VorlageTemplate xlt ett application/vnd.ms-excel MS_Works_Calc com.sun.star.sheet.SpreadsheetDocument Microsoft Works ドキュメント IMPORT calc_MS_Works_Document wks wdb MWAW_Database com.sun.star.sheet.SpreadsheetDocument 古いMacのデータベース IMPORT PREFERRED MWAW_Database * MWAW_Spreadsheet com.sun.star.sheet.SpreadsheetDocument 古いMacの表計算 IMPORT PREFERRED MWAW_Spreadsheet * Mac_Works_Calc com.sun.star.sheet.SpreadsheetDocument Microsoft Works for Mac 表計算ドキュメント (v1 - v4) IMPORT PREFERRED calc_Mac_Works wps application/vnd.ms-works Microsoft Multiplan com.sun.star.sheet.SpreadsheetDocument Microsoft Multiplan IMPORT PREFERRED calc_MS_Multiplan mp OpenDocument Spreadsheet Flat XML com.sun.star.sheet.SpreadsheetDocument Flat XML ODF 表計算ドキュメント IMPORT EXPORT calc_ODS_FlatXML fods ods xml application/vnd.oasis.opendocument.spreadsheet-flat-xml Quattro Pro 6.0 com.sun.star.sheet.SpreadsheetDocument Quattro Pro 6.0 IMPORT PREFERRED calc_QPro wb2 Rich Text Format (StarCalc) com.sun.star.sheet.SpreadsheetDocument Rich Text Format (Calc) IMPORT writer_Rich_Text_Format rtf application/rtf SYLK com.sun.star.sheet.SpreadsheetDocument SYLK IMPORT EXPORT calc_SYLK slk sylk text/spreadsheet StarOffice XML (Calc) com.sun.star.sheet.SpreadsheetDocument OpenOffice.org 1.0 表計算ドキュメント IMPORT calc_StarOffice_XML_Calc sxc application/vnd.sun.xml.calc StarOffice_Spreadsheet com.sun.star.sheet.SpreadsheetDocument 古い StarOffice 表計算ドキュメント IMPORT PREFERRED StarOffice_Spreadsheet sdc Text - txt - csv (StarCalc) com.sun.star.sheet.SpreadsheetDocument テキスト CSV IMPORT EXPORT generic_Text csv tsv tab txt text/plain UOF spreadsheet com.sun.star.sheet.SpreadsheetDocument Unified Office Format 表計算ドキュメント IMPORT EXPORT Unified_Office_Format_spreadsheet uos uof WPS_Lotus_Calc com.sun.star.sheet.SpreadsheetDocument Lotus ドキュメント IMPORT calc_WPS_Lotus_Document wk1 wk3 wk4 123 WPS_QPro_Calc com.sun.star.sheet.SpreadsheetDocument QuattroPro ドキュメント IMPORT calc_WPS_QPro_Document wb1 wb2 wq1 wq2 XHTML Calc File com.sun.star.sheet.SpreadsheetDocument XHTML EXPORT XHTML_File html xhtml application/xhtml xml calc8 com.sun.star.sheet.SpreadsheetDocument ODF 表計算ドキュメント IMPORT EXPORT DEFAULT calc8 ods application/vnd.oasis.opendocument.spreadsheet calc8_template com.sun.star.sheet.SpreadsheetDocument ODF 表計算ドキュメントテンプレート IMPORT EXPORT calc8_template ots application/vnd.oasis.opendocument.spreadsheet-template calc_HTML_WebQuery com.sun.star.sheet.SpreadsheetDocument Webページ クエリー (Calc) IMPORT PREFERRED generic_HTML html xhtml htm text/html calc_StarOffice_XML_Calc_Template com.sun.star.sheet.SpreadsheetDocument OpenOffice.org 1.0 表計算ドキュメントテンプレート IMPORT calc_StarOffice_XML_Calc_Template stc application/vnd.sun.xml.calc.template calc_jpg_Export com.sun.star.sheet.SpreadsheetDocument JPEG - Joint Photographic Experts Group EXPORT jpg_JPEG jpg jpeg jfif jif jpe image/jpeg calc_pdf_Export com.sun.star.sheet.SpreadsheetDocument PDF - Portable Document Format EXPORT pdf_Portable_Document_Format pdf application/pdf calc_pdf_addstream_import com.sun.star.sheet.SpreadsheetDocument PDF - Portable Document Format IMPORT pdf_Portable_Document_Format pdf application/pdf calc_png_Export com.sun.star.sheet.SpreadsheetDocument PNG - Portable Network Graphic EXPORT png_Portable_Network_Graphic png image/png calc_svg_Export com.sun.star.sheet.SpreadsheetDocument SVG - Scalable Vector Graphics EXPORT svg_Scalable_Vector_Graphics svg svgz image/svg xml dBase com.sun.star.sheet.SpreadsheetDocument dBASE IMPORT EXPORT calc_dBase dbf Text (encoded) (StarWriter/GlobalDocument) com.sun.star.text.GlobalDocument 文書 - エンコードの選択 (マスタードキュメント) IMPORT EXPORT generic_Text csv tsv tab txt text/plain writer_globaldocument_StarOffice_XML_Writer com.sun.star.text.GlobalDocument OpenOffice.org 1.0 文書ドキュメント writer_StarOffice_XML_Writer sxw application/vnd.sun.xml.writer writer_globaldocument_StarOffice_XML_Writer_GlobalDocument com.sun.star.text.GlobalDocument OpenOffice.org 1.0 マスタードキュメント IMPORT PREFERRED writer_globaldocument_StarOffice_XML_Writer_GlobalDocument sxg application/vnd.sun.xml.writer.global writer_globaldocument_pdf_Export com.sun.star.text.GlobalDocument PDF - Portable Document Format EXPORT pdf_Portable_Document_Format pdf application/pdf writerglobal8 com.sun.star.text.GlobalDocument ODF マスタードキュメント IMPORT EXPORT PREFERRED writerglobal8 odm application/vnd.oasis.opendocument.text-master writerglobal8_HTML com.sun.star.text.GlobalDocument HTML (Writer/Global) EXPORT generic_HTML html xhtml htm text/html writerglobal8_template com.sun.star.text.GlobalDocument ODF マスタードキュメントテンプレート IMPORT EXPORT writerglobal8_template otm application/vnd.oasis.opendocument.text-master-template writerglobal8_writer com.sun.star.text.GlobalDocument ODF 文書ドキュメント EXPORT DEFAULT writer8 odt application/vnd.oasis.opendocument.text AbiWord com.sun.star.text.TextDocument AbiWord ドキュメント IMPORT writer_AbiWord_Document abw zabw application/x-abiword Apple Pages com.sun.star.text.TextDocument Apple Pages IMPORT PREFERRED writer_ApplePages pages application/x-iwork-pages-sffpages BroadBand eBook com.sun.star.text.TextDocument BroadBand eBook IMPORT PREFERRED writer_BroadBand_eBook lrf application/x-sony-bbeb ClarisWorks com.sun.star.text.TextDocument ClarisWorks/AppleWorks 文書ドキュメント IMPORT PREFERRED writer_ClarisWorks cwk application/clarisworks DocBook File com.sun.star.text.TextDocument DocBook IMPORT EXPORT writer_DocBook_File xml application/docbook xml DosWord com.sun.star.text.TextDocument Microsoft Word for DOS IMPORT writer_DosWord doc EPUB com.sun.star.text.TextDocument EPUB文書 EXPORT writer_EPUB_Document epub application/epub zip FictionBook 2 com.sun.star.text.TextDocument FictionBook 2.0 IMPORT PREFERRED writer_FictionBook_2 fb2 zip application/x-fictionbook xml HTML (StarWriter) com.sun.star.text.TextDocument HTML ドキュメント (Writer) IMPORT EXPORT generic_HTML html xhtml htm text/html LotusWordPro com.sun.star.text.TextDocument Lotus WordPro ドキュメント IMPORT PREFERRED writer_LotusWordPro_Document lwp application/vnd.lotus-wordpro MS WinWord 5 com.sun.star.text.TextDocument Microsoft WinWord 1/2/5 IMPORT writer_MS_WinWord_5 doc application/msword MS WinWord 6.0 com.sun.star.text.TextDocument Microsoft Word 6.0 IMPORT writer_MS_WinWord_60 doc application/msword MS Word 2003 XML com.sun.star.text.TextDocument Word 2003 XML IMPORT EXPORT writer_MS_Word_2003_XML xml doc MS Word 2007 XML com.sun.star.text.TextDocument Word 2007–365 IMPORT EXPORT writer_MS_Word_2007 docx application/msword MS Word 2007 XML Template com.sun.star.text.TextDocument Word 2007–365 テンプレート IMPORT EXPORT writer_MS_Word_2007_Template dotx dotm application/msword MS Word 2007 XML VBA com.sun.star.text.TextDocument Word 2007–365 VBA IMPORT EXPORT writer_MS_Word_2007_VBA docm application/msword MS Word 95 com.sun.star.text.TextDocument Microsoft Word 95 IMPORT writer_MS_Word_95 doc application/msword MS Word 95 Vorlage com.sun.star.text.TextDocument Microsoft Word 95 テンプレート IMPORT writer_MS_Word_95_Vorlage dot application/msword MS Word 97 com.sun.star.text.TextDocument Word 97–2003 IMPORT EXPORT PREFERRED writer_MS_Word_97 doc wps application/msword MS Word 97 Vorlage com.sun.star.text.TextDocument Word 97–2003 テンプレート IMPORT EXPORT writer_MS_Word_97_Vorlage dot wpt application/msword MS_Works com.sun.star.text.TextDocument Microsoft Works ドキュメント IMPORT writer_MS_Works_Document wps application/vnd.ms-works MS_Write com.sun.star.text.TextDocument Microsoft Write IMPORT writer_MS_Write wri application/x-mswrite MWAW_Text_Document com.sun.star.text.TextDocument 古いMacの文書ドキュメント IMPORT PREFERRED MWAW_Text_Document * MacWrite com.sun.star.text.TextDocument MacWrite ドキュメント IMPORT PREFERRED writer_MacWrite mw mcw application/macwriteii Mac_Word com.sun.star.text.TextDocument Microsoft Word for Mac (v1 - v5) IMPORT PREFERRED writer_Mac_Word doc application/msword Mac_Works com.sun.star.text.TextDocument Microsoft Works for Mac 文書ドキュメント (v1 - v4) IMPORT PREFERRED writer_Mac_Works wps application/vnd.ms-works Mariner_Write com.sun.star.text.TextDocument Mariner Write Mac Classic v1.6 - v3.5 IMPORT PREFERRED writer_Mariner_Write mwd Office Open XML Text com.sun.star.text.TextDocument Office Open XML 文書 IMPORT EXPORT writer_OOXML docx docm application/vnd.openxmlformats-officedocument.wordprocessingml.document Office Open XML Text Template com.sun.star.text.TextDocument Office Open XML 文書テンプレート IMPORT writer_OOXML_Text_Template dotx dotm application/vnd.openxmlformats-officedocument.wordprocessingml.template OpenDocument Text Flat XML com.sun.star.text.TextDocument Flat XML ODF 文書ドキュメント IMPORT EXPORT writer_ODT_FlatXML fodt odt xml application/vnd.oasis.opendocument.text-flat-xml PalmDoc com.sun.star.text.TextDocument PalmDoc eBook IMPORT PREFERRED writer_PalmDoc pdb application/x-aportisdoc Palm_Text_Document com.sun.star.text.TextDocument Palm 文書ドキュメント IMPORT PREFERRED Palm_Text_Document pdb application/vnd.palm Plucker eBook com.sun.star.text.TextDocument Plucker eBook IMPORT PREFERRED writer_Plucker_eBook pdb application/prs.plucker Rich Text Format com.sun.star.text.TextDocument Rich Text IMPORT EXPORT PREFERRED writer_Rich_Text_Format rtf application/rtf StarOffice XML (Writer) com.sun.star.text.TextDocument OpenOffice.org 1.0 文書ドキュメント IMPORT PREFERRED writer_StarOffice_XML_Writer sxw application/vnd.sun.xml.writer StarOffice_Writer com.sun.star.text.TextDocument 古い StarOffice 文書ドキュメント IMPORT PREFERRED StarOffice_Writer sdw T602Document com.sun.star.text.TextDocument T602 ドキュメント IMPORT PREFERRED writer_T602_Document 602 txt application/x-t602 Text com.sun.star.text.TextDocument テキスト IMPORT EXPORT PREFERRED generic_Text csv tsv tab txt text/plain Text (encoded) com.sun.star.text.TextDocument 文書 - エンコードの選択 IMPORT EXPORT generic_Text csv tsv tab txt text/plain UOF text com.sun.star.text.TextDocument Unified Office Format テキスト IMPORT EXPORT Unified_Office_Format_text uot uof WordPerfect com.sun.star.text.TextDocument WordPerfect ドキュメント IMPORT PREFERRED writer_WordPerfect_Document wpd application/vnd.wordperfect WriteNow com.sun.star.text.TextDocument WriteNow ドキュメント IMPORT PREFERRED writer_WriteNow wn nx^d XHTML Writer File com.sun.star.text.TextDocument XHTML EXPORT XHTML_File html xhtml application/xhtml xml writer8 com.sun.star.text.TextDocument ODF 文書ドキュメント IMPORT EXPORT DEFAULT PREFERRED writer8 odt application/vnd.oasis.opendocument.text writer8_template com.sun.star.text.TextDocument ODF 文書ドキュメントテンプレート IMPORT EXPORT writer8_template ott application/vnd.oasis.opendocument.text-template writer_MIZI_Hwp_97 com.sun.star.text.TextDocument Hangul WP 97 IMPORT writer_MIZI_Hwp_97 hwp application/x-hwp writer_StarOffice_XML_Writer_Template com.sun.star.text.TextDocument OpenOffice.org 1.0 文書ドキュメントテンプレート IMPORT writer_StarOffice_XML_Writer_Template stw application/vnd.sun.xml.writer.template writer_jpg_Export com.sun.star.text.TextDocument JPEG - Joint Photographic Experts Group EXPORT jpg_JPEG jpg jpeg jfif jif jpe image/jpeg writer_layout_dump com.sun.star.text.TextDocument Writer Layout XML EXPORT writer_layout_dump_xml xml writer_pdf_Export com.sun.star.text.TextDocument PDF - Portable Document Format EXPORT pdf_Portable_Document_Format pdf application/pdf writer_pdf_addstream_import com.sun.star.text.TextDocument PDF - Portable Document Format IMPORT pdf_Portable_Document_Format pdf application/pdf writer_pdf_import com.sun.star.text.TextDocument PDF - Portable Document Format (Writer) IMPORT PREFERRED pdf_Portable_Document_Format pdf application/pdf writer_png_Export com.sun.star.text.TextDocument PNG - Portable Network Graphic EXPORT png_Portable_Network_Graphic png image/png writer_svg_Export com.sun.star.text.TextDocument SVG - Scalable Vector Graphics EXPORT svg_Scalable_Vector_Graphics svg svgz image/svg xml HTML com.sun.star.text.WebDocument HTML ドキュメント IMPORT EXPORT PREFERRED generic_HTML html xhtml htm text/html Text (StarWriter/Web) com.sun.star.text.WebDocument 文書 (Writer/Web) IMPORT EXPORT generic_Text csv tsv tab txt text/plain Text (encoded) (StarWriter/Web) com.sun.star.text.WebDocument 文書 - エンコードの選択 (Writer/Web) IMPORT EXPORT generic_Text csv tsv tab txt text/plain writer_web_HTML_help com.sun.star.text.WebDocument Help コンテンツ IMPORT writer_web_HTML_help writer_web_StarOffice_XML_Writer com.sun.star.text.WebDocument OpenOffice.org 1.0 文書ドキュメント (Writer/Web) EXPORT writer_StarOffice_XML_Writer sxw application/vnd.sun.xml.writer writer_web_StarOffice_XML_Writer_Web_Template com.sun.star.text.WebDocument OpenOffice.org 1.0 HTML テンプレート IMPORT writer_web_StarOffice_XML_Writer_Web_Template stw application/vnd.sun.xml.writer.web writer_web_jpg_Export com.sun.star.text.WebDocument JPEG - Joint Photographic Experts Group EXPORT jpg_JPEG jpg jpeg jfif jif jpe image/jpeg writer_web_pdf_Export com.sun.star.text.WebDocument PDF - Portable Document Format EXPORT pdf_Portable_Document_Format pdf application/pdf writer_web_png_Export com.sun.star.text.WebDocument PNG - Portable Network Graphic EXPORT png_Portable_Network_Graphic png image/png writerweb8_writer com.sun.star.text.WebDocument 文書 (Writer/Web) EXPORT writer8 odt application/vnd.oasis.opendocument.text writerweb8_writer_template com.sun.star.text.WebDocument HTML ドキュメントテンプレート IMPORT EXPORT writerweb8_writer_template oth application/vnd.oasis.opendocument.text-web

この表を出力するのには以下のマクロを使用した。
このマクロは LibreOffice Calc のスプレッドシートを作成するので CSV に出力して MarkDown に編集した。

filters.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
"""list import/expot filters from FilterFactory and TypeDetection services
"""

"""
  (C) Copyright 2020 Shojiro Fushimi, all rights reserved

  Redistribution and use in source and binary forms, with or
  without modification, are permitted provided that the following
  conditions are met:

   - Redistributions of source code must retain the above
    copyright notice, this list of conditions and the following
    disclaimer.

   - Redistributions in binary form must reproduce the above
    copyright notice, this list of conditions and the following
    disclaimer in the documentation and/or other materials
    provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS''
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  OF SUCH DAMAGE.
"""

from functools import reduce

import uno
from com.sun.star.awt.FontWeight import BOLD

ALL_FIELDS = False
FIELDS = ['DocumentService', 'UIName', 'Flags']
ALL_FLAGS = False
FLAGS = ['IMPORT', 'EXPORT', 'DEFAULT', 'PREFERRED']
KEY_FIELD = 'DocumentService'

SHOW_TYPE_FIELDS = True
ALL_TYPE_FIELDS = False
TYPE_FIELDS = ['Extensions', 'MediaType']

# Flags are defined in <source directory>/include/comphelper/documentconstants.hxx
# with exception of3RDPARTYFILTER is STARONEFILTER and READONLY is OPENREADONLY there
FLAG_LABELS = [(0x00000001, 'IMPORT'),
               (0x00000002, 'EXPORT'),
               (0x00000004, 'TEMPLATE'),
               (0x00000008, 'INTERNAL'),
               (0x00000010, 'TEMPLATEPATH'),
               (0x00000020, 'OWN'),
               (0x00000040, 'ALIEN'),
               (0x00000100, 'DEFAULT'),
               (0x00000400, 'SUPPORTSSELECTION'),
               (0x00001000, 'NOTINFILEDIALOG'),
               (0x00010000, 'READONLY'),
               (0x00020000, 'MUSTINSTALL'),
               (0x00040000, 'CONSULTSERVICE'),
               (0x00080000, '3RDPARTYFILTER'),
               (0x00100000, 'PACKED'),
               (0x00200000, 'EXOTIC'),
               (0x00800000, 'COMBINED'),
               (0x01000000, 'ENCRYPTION'),
               (0x02000000, 'PASSWORDTOMODIFY'),
               (0x04000000, 'GPGENCRYPTION'),
               (0x10000000, 'PREFERRED'),
               (0x20000000, 'STARTPRESENTATION'),
               (0x40000000, 'SUPPORTSSIGNING'),
]

def main(*args, **kwds):
    ctx = XSCRIPTCONTEXT.getComponentContext()
    smgr = ctx.ServiceManager
    # get filter information from filter factory
    SERVICE_FILTERFACTORY = 'com.sun.star.document.FilterFactory'
    SERVICE_TYPEDETECTION = 'com.sun.star.document.TypeDetection'
    filter_factory = smgr.createInstanceWithContext(SERVICE_FILTERFACTORY, ctx)
    filter_dict = {}
    for filter_name in filter_factory.getElementNames():
        try:
            property_dict = {}
            for property in filter_factory.getByName(filter_name):
                property_dict[property.Name]  = property.Value
            filter_dict[filter_name] = property_dict
        except:
            continue
    fields = sorted(list(reduce(lambda x,y:x|y,
                                (set(v.keys()) for v in filter_dict.values()),
                                set())))
    if not ALL_FIELDS:
        fields = [f for f in FIELDS if f in fields]
        if SHOW_TYPE_FIELDS and 'Type' not in fields:
            fields.append('Type')
    #
    if SHOW_TYPE_FIELDS:
        type_detection = smgr.createInstanceWithContext(SERVICE_TYPEDETECTION, ctx)
        type_dict = {}
        for type_name in type_detection.getElementNames():
            try:
                property_dict = {}
                for property in type_detection.getByName(type_name):
                    property_dict[property.Name]  = property.Value
                type_dict[type_name] = property_dict
            except:
                continue
        type_fields = sorted(list(reduce(lambda x,y:x|y,
                                         (set(v.keys()) for v in type_dict.values()),
                                         set())))
        if not ALL_TYPE_FIELDS:
            type_fields = [f for f in TYPE_FIELDS if f in type_fields]
    else:
        type_dict = {}
        type_fields = []
    #
    head = ['Name'] + fields + type_fields
    filter_table = []
    for filter_name, property_dict in filter_dict.items():
        filter_values = [filter_name] + [property_dict.get(f) for f in fields]
        if 'Flags' in fields:
            idx = head.index('Flags')
            if filter_values[idx] is not None:
                flag_value = filter_values[idx]
                flag_names = []
                for n, name in FLAG_LABELS:
                    if flag_value & n == n:
                        if ALL_FLAGS or name in FLAGS:
                            flag_names.append(name)
                        flag_value &= ~n
                if flag_value != 0: # found an unknown flag
                    flag_names.append('%8.8x' % flag_value)
                filter_values[idx] = ' '.join(flag_names)
        type_values = [type_dict.get(property_dict.get('Type'), {}).get(n) for n in type_fields]
        if 'Extensions' in type_fields:
            idx = type_fields.index('Extensions')
            if type_values[idx] is not None:
                type_values[idx] = ' '.join(type_values[idx])
        filter_table.append(filter_values + type_values)
    #
    if KEY_FIELD in fields:
        idx = head.index(KEY_FIELD)
        key = lambda r:(r[idx], r)
    else:
        key = None
    filter_table.sort(key=key)
    filter_table.insert(0, head)
    # table to spreadsheet
    NEWSHEET_URL = 'private:factory/scalc'
    desktop = XSCRIPTCONTEXT.getDesktop()
    spreadsheet = desktop.loadComponentFromURL(NEWSHEET_URL, '_blank', 0, ())
    sheet = spreadsheet.getSheets().getByIndex(0)
    for i, row in enumerate(filter_table):
        for j, col in enumerate(row):
            cell = sheet.getCellByPosition(j, i)
            cell.String = str(col)
    # set column width optimal
    columns = sheet.getColumns()
    for i in range(len(head)):
        columns.getByIndex(i).OptimalWidth = True
    # make head line characters bold
    for i in range(len(head)):
        cell = sheet.getCellByPosition(i, 0)
        cell.CharWeight = BOLD
    # freeze head row (column 0, row 1)
    spreadsheet.CurrentController.freezeAtPosition(0, 1)
    # set auto filter
    cell_range = sheet.getCellRangeByPosition(0, 0, len(head) - 1, len(filter_table) - 1)
    range_name = 'filter range'
    spreadsheet.DatabaseRanges.addNewByName(range_name, cell_range.getRangeAddress())
    filter_range = spreadsheet.DatabaseRanges.getByName(range_name)
    filter_range.AutoFilter = True

LibreOffice インストールディレクトリからの取得

FilterFactory, TypeDetection サービスから取得できるのと同内容は、