Get supported file formats

On this page

GroupDocs.Comparison allows you to get the list of all supported file formats. To do this, follow these steps:

  1. Call the getSupportedFileTypes method of the FileType class.
  2. Enumerate through the collection of the FileType objects.

The following code snippet shows how to obtain a list of supported file formats:

import groupdocs.comparison as gc

def run():
    try:
        # Retrieve the supported file types
        supported_file_types = gc.result.FileType.get_supported_file_types()

        for file_type in sorted(supported_file_types, key=lambda x: x.extension):
            print(file_type)

        print("\nSupported file types retrieved successfully.")
        
    except Exception as error:
        print("An error occurred while retrieving supported file types:", error)

The result is as follows:

On this page