How to embed a TIFF image with LAB color space?

Q:

Can you confirm whether there is a different way to embed Tiff images
into a pdf document?

Your sample project use the following code

bmp = New System.Drawing.Bitmap(input_path + "Lab8Test.tif")
img = Image.Create(doc.GetSDFDoc(), bmp)
element = f.CreateImage(img, New Matrix2D(bmp.Width, 0, 0, bmp.Height,
10, 50))
writer.WritePlacedElement(element)

However the Tiff file I need to insert is a print quality image using
Spot colours, these are required for the printing process. The
problem we have is that the System.Drawing.Bitmap class does not
support this type of tiff image and returns an error ' Parameter is
not valid.'

I need to find a way to insert the image without using the line

bmp = New System.Drawing.Bitmap(input_path + "Lab8Test
-----
A:

Yes, this is one of limitations of Bitmap class in MS .NET Framework.

To go around this you could use a third party image library that
supports TIFF (you may want try using libtiff - http://
www.libtiff.org/ or freeimage - http://freeimage.sourceforge.net).

Assuming that you extract LAB image data in 'lab_data' byte array, you
can pass it to PDFNet as follows:

Obj* lab_dict = pdftron.SDF.Obj.CreateDict();

// Set LAB white point
Obj* white_point = Obj.CreateArray();
white_point.PushBack(Obj.CreateNumber(0.9505));
white_point.PushBack(Obj.CreateNumber(1));
white_point.PushBack(Obj.CreateNumber(1.089));
lab_dict.Put("WhitePoint", white_point);

// Optional set LAB Range & BlackPoint ...

// Create LAB Color space from SDF array...
Obj lab_arr = doc.CreateIndirectArray();
lab_arr.PushBack(lab_dict);
ColorSpace cs = new ColorSpace(lab_arr);

// Create PDF Lab image
Image img = Image.Create(doc, lab_data,
width, height, 8, cs, Image.InputFilter.e_none);