Three contradicting
requirement needs to be considered during image processing: quality, size, and speed.
The settings can be selected according to the priorities. The code samples provide
examples for the following priorities:
Quality, size, speed
Size, quality, speed
Speed
// load image as data stream
kRecLoadImgDataStreamF(sid, jpgfile, &hPage, 0);
// save image into FF_PDF format – preserving compression quality and size
kRecSaveImgF(sid, outpdf, FF_PDF, hPage, II_ORIGINAL, false);
// load image as data stream
kRecLoadImgDataStreamF(sid, jpgfile, &hPage, 0);
kRecDecompressImgDataStream(sid, hPage); // decompress DataStream only for preprocessing
kRecPreprocessImg(sid, hPage); // perform the necessary transformations
// save image into FF_PDF format - still the DataStream will be saved but with transformations!
kRecSaveImgF(sid, outpdf, FF_PDF, hPage, II_CURRENT, false);
kRecSetDTXTFormat(sid, DTXT_IOTPDF);
// load image as data stream
kRecLoadImgDataStreamF(sid, jpgfile, &hPage, 0);
// decompress DataStream only for internal processing
kRecDecompressImgDataStream(sid, hPage);
kRecPreprocessImg(sid, hPage);
kRecRecognize(sid, hPage, NULL);
// create searchable PDF preserving compression quality, with readable orientation (II_CURRENT)
kRecConvert2DTXTEx(sid, &hPage, 1, II_CURRENT, outpdf); // use II_ORIGINAL for original orientation