Enum OoxmlCompressionType

OoxmlCompressionType enumeration

The Ooxml compression type

public enum OoxmlCompressionType

Values

NameValueDescription
Level11The fastest but least effective compression.
Level22A little slower, but better, than level 1.
Level33A little slower, but better, than level 2.
Level44A little slower, but better, than level 3.
Level55A little slower than level 4, but with better compression.
Level66A good balance of speed and compression efficiency.
Level77Pretty good compression!
Level88Better compression than Level7!
Level99The “best” compression, where best means greatest reduction in size of the input data stream. This is also the slowest compression.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using System;

    public class OoxmlCompressionTypeDemo
    {
        public static void OoxmlCompressionTypeExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add some data to the worksheet
            worksheet.Cells["A1"].PutValue("Sample Data");
            worksheet.Cells["A2"].PutValue(123);
            worksheet.Cells["A3"].PutValue(456);

            // Create OoxmlSaveOptions and set the compression type
            OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
            saveOptions.CompressionType = OoxmlCompressionType.Level6; // A good balance of speed and compression efficiency

            // Save the workbook with the specified compression type
            workbook.Save("OoxmlCompressionTypeExample.xlsx", saveOptions);

            Console.WriteLine("Workbook saved with OoxmlCompressionType.Level6 compression.");
        }
    }
}

See Also