VintaSoft Imaging .NET SDK 15.2: Документация для .NET разработчика
В этом разделе
Кодеки: Как преобразовать TIFF в JBIG2?
В этом разделе
VintaSoft Imaging .NET SDK позволяет сконвертировать TIFF-файл в JBIG2-файл используя класс DocumentConverter или ImageCollection. Использование класса DocumentConverter обеспечивает наилучшую производительность, поскольку класс DocumentConverter использует многопоточность.

Вот C#/VB.NET код, который демонстрирует, как преобразовать TIFF-файл в JBIG2-файл с помощью класса DocumentConverter:
/// <summary>
/// Converts TIFF file to a JBIG2 file using Vintasoft.Imaging.DocumentConverter class.
/// </summary>
public static void ConvertTiffToJbig2_DocumentConverter(string tiffFileName, string jbig2FileName)
{
    Vintasoft.Imaging.DocumentConverter.Convert(tiffFileName, jbig2FileName);
}
''' <summary>
''' Converts TIFF file to a JBIG2 file using Vintasoft.Imaging.DocumentConverter class.
''' </summary>
Public Shared Sub ConvertTiffToJbig2_DocumentConverter(tiffFileName As String, jbig2FileName As String)
    Vintasoft.Imaging.DocumentConverter.Convert(tiffFileName, jbig2FileName)
End Sub


Вот C#/VB.NET код, который демонстрирует, как преобразовать TIFF-файл в JBIG2-файл с помощью классов ImageCollection и Jbig2Encoder:
public static void ConvertTiffToJBIG2_ImageCollection(string tiffFileName, string jbig2FileName)
{
    // create image collection
    using (Vintasoft.Imaging.ImageCollection imageCollection = 
        new Vintasoft.Imaging.ImageCollection())
    {
        // add Tiff file to collection
        imageCollection.Add(tiffFileName);
        // create JBIG2 encoder using default compression settings
        using (Vintasoft.Imaging.Codecs.Encoders.Jbig2Encoder jbig2Encoder = 
            new Vintasoft.Imaging.Codecs.Encoders.Jbig2Encoder())
        {
            // add pages of TIFF file to JBIG2 document using encoder
            imageCollection.SaveSync(jbig2FileName, jbig2Encoder);
        }
    }
}
Public Shared Sub ConvertTiffToJBIG2_ImageCollection(tiffFileName As String, jbig2FileName As String)
    ' create image collection
    Using imageCollection As New Vintasoft.Imaging.ImageCollection()
        ' add Tiff file to collection
        imageCollection.Add(tiffFileName)
        ' create JBIG2 encoder using default compression settings
        Using jbig2Encoder As New Vintasoft.Imaging.Codecs.Encoders.Jbig2Encoder()
            ' add pages of TIFF file to JBIG2 document using encoder
            imageCollection.SaveSync(jbig2FileName, jbig2Encoder)
        End Using
    End Using
End Sub