VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
In This Topic
    Codecs: How to convert JBIG2 to TIFF?
    In This Topic
    VintaSoft Imaging .NET SDK allows to convert JBIG2 file to a TIFF file using 2 ways: DocumentConverter or ImageCollection.
    Usage of DocumentConverter class provides the best performance because DocumentConverter class uses multi-threading.

    Here is C#/VB.NET code that shows how to convert JBIG2 document to TIFF file using DocumentConverter class:
    /// <summary>
    /// Converts JBIG2 file to a TIFF file using Vintasoft.Imaging.DocumentConverter class.
    /// </summary>
    public static void ConvertJbig2ToTiff_DocumentConverter(string jbig2FileName, string tiffFileName)
    {
        Vintasoft.Imaging.DocumentConverter.Convert(jbig2FileName, tiffFileName);
    }
    
    ''' <summary>
    ''' Converts JBIG2 file to a TIFF file using Vintasoft.Imaging.DocumentConverter class.
    ''' </summary>
    Public Shared Sub ConvertJbig2ToTiff_DocumentConverter(jbig2FileName As String, tiffFileName As String)
        Vintasoft.Imaging.DocumentConverter.Convert(jbig2FileName, tiffFileName)
    End Sub
    


    Here is C#/VB.NET code that shows how to convert JBIG2 document to TIFF file using ImageCollection class:
    public static void ConvertJbig2ToTiff_ImageCollection(string jbig2FileName, string tiffFileName)
    {
        // create image collection
        using (Vintasoft.Imaging.ImageCollection imageCollection = 
            new Vintasoft.Imaging.ImageCollection())
        {
            // add JBIG2 file to collection
            imageCollection.Add(jbig2FileName);
            // create Tiff encoder
            using (Vintasoft.Imaging.Codecs.Encoders.TiffEncoder tiffEncoder = 
                new Vintasoft.Imaging.Codecs.Encoders.TiffEncoder())
            {
                // set Tiff compression to ZIP
                tiffEncoder.Settings.Compression = 
                    Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip;
                // add pages of JBIG2 document to TIFF file using Tiff encoder
                imageCollection.SaveSync(tiffFileName, tiffEncoder);
            }
        }
    }
    
    Public Shared Sub ConvertJbig2ToTiff_ImageCollection(jbig2FileName As String, tiffFileName As String)
        ' create image collection
        Using imageCollection As New Vintasoft.Imaging.ImageCollection()
            ' add JBIG2 file to collection
            imageCollection.Add(jbig2FileName)
            ' create Tiff encoder
            Using tiffEncoder As New Vintasoft.Imaging.Codecs.Encoders.TiffEncoder()
                ' set Tiff compression to ZIP
                tiffEncoder.Settings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip
                ' add pages of JBIG2 document to TIFF file using Tiff encoder
                imageCollection.SaveSync(tiffFileName, tiffEncoder)
            End Using
        End Using
    End Sub