Q: I am trying to embed a small monochrome tif file using the
Image.Create() where you pass a buffer with the image data.
const char* image_data,
int width, int height, int bpc,
Do you have a specific example of using this version?
A: Image.Create() method you mentioned (with the image buffer in the
argument) is used to embed a raw, decompressed image data.
There is also another variant of this method:
Image.Create (SDFDoc doc, const char *image_data, ULong
image_data_size, int width, int height, int bpc, ColorSpace
color_space, InputFilter input_format)
This method can be used to directly embed image data that is already
compressed using the InputFilter format (i.e. e_none, e_jpeg, e_jp2,
e_flate, e_g3, e_g4 , and e_ascii_hex). In this case PDFNet will
directly embedded the image data without any recompression etc. TIF
format is not on the list because TIFs can't be directly embedded in
PDF (i.e. TIF images must be re-compressed). Also, users should
exercise caution when _directly_ embedding anything but uncompressed
stream (in this case PDFNet is not in the charge of recompressing the
image and making sure that the stream is compatible with all versions
of PDF format).
To create a PDF image from TIF use Image.Create(SDFDoc doc, const