Creates a new instance of the JBIG2 class.

Namespace:  SautinSoft
Assembly:  SautinSoft.JBIG2 (in SautinSoft.JBIG2.dll) Version: 1.0.6.25 (1.0.6.25)

Syntax

      
 C#  Visual Basic 
public JBIG2()
Public Sub New

Examples

CopyHow to decode JB2 to Multipage-Tiff using C#
using System;
using System.IO;
using System.Collections.Generic;
using SautinSoft;

namespace Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            // Decode JB2 file to multipage-Tiff file
            string jb2File = Path.GetFullPath(Environment.CurrentDirectory + @"..\..\..\..\..\..\Testing Files\13.jb2");
            byte[] jb2Data = File.ReadAllBytes(jb2File);

            SautinSoft.JBIG2 jbDecoder = new SautinSoft.JBIG2();

            // First element of the list will store all pages as single Multipage-Tiff
            List<byte[]> TiffData = jbDecoder.DecodeToImages(jb2Data, false, JBIG2.OutputImageFormat.MultipageTiff);

            string TiffFile = String.Format(@"{0}\Result.tiff", Path.GetDirectoryName(jb2File));
            File.WriteAllBytes(TiffFile, TiffData[0]);
            System.Diagnostics.Process.Start(TiffFile);

        }
    }
}
CopyHow to decode JB2 to Multipage-Tiff using VB.Net
Imports System.IO
Imports System.Text
Imports System.Collections.Generic
Imports SautinSoft


Namespace SampleConvert
    Friend Class sample
        Shared Sub Main(ByVal args() As String)
            ' Decode JB2 file to multipage-Tiff file
            Dim jb2File As String = Path.GetFullPath(Environment.CurrentDirectory & "..\..\..\..\..\..\Testing Files\13.jb2")
            Dim jb2Data() As Byte = File.ReadAllBytes(jb2File)

            Dim jbDecoder As New SautinSoft.JBIG2()

            ' First element of the list will store all pages as single Multipage-Tiff
            Dim TiffData As List(Of Byte()) = jbDecoder.DecodeToImages(jb2Data, False, JBIG2.OutputImageFormat.MultipageTiff)

            Dim TiffFile As String = String.Format("{0}\Result.tiff", Path.GetDirectoryName(jb2File))
            File.WriteAllBytes(TiffFile, TiffData(0))
            System.Diagnostics.Process.Start(TiffFile)
        End Sub
    End Class
End Namespace

See Also