How to embed TIFF using JBIG2 compression?

Q:

We understand that PDFNet SDK can embed TIFF and optimize existing PDF
documents to use JBIG2 compression:

  1. Can Tiff => PDF

Can it also in one step embed TIFF as monochrome JBIG2?

  1. Can PDF => PDF (jbig2)

If yes how?

A:

Using PDFNet SDK you can also embed TIFF (i.e. 1 bit per pixel -
monochrome images) using JBIG2 compression.

For an example of how to embed monochrome TIFF using JBIG2
compression, please take a look at AddImage sample project
http://www.pdftron.com/net/samplecode.html#AddImage.

In C# the code would look as follows:

// JBIG2 Encoder hint --------------------------------
Obj jbig2_hint = Obj.CreateArray() ;
jbig2_hint.PushBack(Obj.CreateName(“JBIG2”));

System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(input_path +
“multipage.tif”);
pdftron.PDF.Image img = Image.Create(pdfdoc, bmp, jbig2_hint);
pdftron.PDF.Element element = f.CreateImage(img, new Matrix2D(612, 0,
0, 794, 0, 0));

In PDFNet SDK there are some other options to work with JBIG2 but the
above approach is the simplest and the most straightforward.