List and print all supported file types

The Supported file formats page lists all file formats supported by GroupDocs.Viewer.

To list or print out all the supported file formats within your application, follow these steps:

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

The following code snippet shows how to list supported file formats in the console:

using System;
using System.Collections.Generic;
using GroupDocs.Viewer;
// ...

// Get list of file types.
IEnumerable<FileType> supportedFileTypes = FileType.GetSupportedFileTypes();

// Display list of file types
foreach (FileType fileType in supportedFileTypes)
{
    Console.WriteLine(fileType);
}
Imports System
Imports System.Collections.Generic
Imports GroupDocs.Viewer
' ...

Module Program
    Sub Main(args As String())
        ' Get list of file types.
        Dim supportedFileTypes As IEnumerable(Of FileType) = FileType.GetSupportedFileTypes()
    
        ' Display list of file types
        For Each fileType As FileType In supportedFileTypes
            Console.WriteLine(fileType)
        Next
    End Sub
End Module

The following image shows a sample console output: