This example demonstrates how to export metadata properties to an Excel workbook. The ExportManager constructor takes a list of MetadataProperty objects, so collect the properties you want (here, the whole tree via find_properties) and wrap the result in list(...). ExportFormat also supports CSV, JSON and XML.
fromgroupdocs.metadataimportMetadatafromgroupdocs.metadata.exportimportExportManager,ExportFormatdefexporting_metadata_properties():withMetadata("input.pdf")asmetadata:# Collect the whole metadata tree as a list of propertiesproperties=list(metadata.find_properties(lambdap:True))# Export them to an Excel workbookExportManager(properties).export("export.xlsx",ExportFormat.XLSX)print(f"Exported {len(properties)} properties to export.xlsx")if__name__=="__main__":exporting_metadata_properties()
input.pdf is the sample file used in this example. Click here to download it.