VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
In This Topic
Codecs: How to convert XLSX to TIFF?
In This Topic
VintaSoft Imaging .NET SDK can convert pages of XLSX document to the raster images and save rendered images to a multipage TIFF file.

For executing code below it is necessary:
Here is C#/VB.NET code that shows how to convert XLSX document to a TIFF file using ImageCollection and TiffEncoder:
/// <summary>
/// Converts XLSX document to TIFF file using ImageCollection and TiffEncoder classes.
/// XLSX document is rendered with specified resolution.
/// </summary>
public static void ConvertXlsxToTiff(string xlsxFileName, string tiffFileName, float dpi)
{
    // specify that VintaSoft Imaging .NET SDK should use GDI+ for drawing of 2D graphics
    Vintasoft.Imaging.Drawing.Gdi.GdiGraphicsFactory.SetAsDefault();
    // specify that VintaSoft Imaging .NET SDK should use SkiaSharp for drawing of 2D graphics
    //Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault();

    // create image collection
    using (Vintasoft.Imaging.ImageCollection imageCollection = new Vintasoft.Imaging.ImageCollection())
    {
        // add XLSX document to collection
        imageCollection.Add(xlsxFileName);

        // set rendering settings
        imageCollection.SetRenderingSettings(new Vintasoft.Imaging.Codecs.Decoders.RenderingSettings(dpi, dpi));

        // create TiffEncoder
        using (Vintasoft.Imaging.Codecs.Encoders.TiffEncoder tiffEncoder = 
            new Vintasoft.Imaging.Codecs.Encoders.TiffEncoder(true))
        {
            // set TIFF compression to Zip
            tiffEncoder.Settings.Compression = 
                Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip;

            // save images of image collection to TIFF file using TiffEncoder
            imageCollection.SaveSync(tiffFileName, tiffEncoder);
        }

        // dispose images
        imageCollection.ClearAndDisposeItems();
    }
}
''' <summary>
''' Converts XLSX document to TIFF file using ImageCollection and TiffEncoder classes.
''' XLSX document is rendered with specified resolution.
''' </summary>
Public Shared Sub ConvertXlsxToTiff(xlsxFileName As String, tiffFileName As String, dpi As Single)
    ' specify that VintaSoft Imaging .NET SDK should use GDI+ for drawing of 2D graphics
    Vintasoft.Imaging.Drawing.Gdi.GdiGraphicsFactory.SetAsDefault()
    ' specify that VintaSoft Imaging .NET SDK should use SkiaSharp for drawing of 2D graphics
    'Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault()

    ' create image collection
    Using imageCollection As New Vintasoft.Imaging.ImageCollection()
        ' add XLSX document to collection
        imageCollection.Add(xlsxFileName)

        ' set rendering settings
        imageCollection.SetRenderingSettings(New Vintasoft.Imaging.Codecs.Decoders.RenderingSettings(dpi, dpi))

        ' create TiffEncoder
        Using tiffEncoder As New Vintasoft.Imaging.Codecs.Encoders.TiffEncoder(True)
            ' set TIFF compression to Zip
            tiffEncoder.Settings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip

            ' save images of image collection to TIFF file using TiffEncoder
            imageCollection.SaveSync(tiffFileName, tiffEncoder)
        End Using

        ' dispose images
        imageCollection.ClearAndDisposeItems()
    End Using
End Sub