Codecs: How to convert TIFF to JBIG2?
In This Topic
VintaSoft Imaging .NET SDK allows to convert TIFF file to a JBIG2 document using
DocumentConverter or
ImageCollection class. 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 TIFF file to JBIG2 document using
DocumentConverter class:
/// <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
Here is C#/VB.NET code that shows how to convert TIFF file to JBIG2 document using
ImageCollection and
Jbig2Encoder classes:
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