Code samples for image processing
-
Quality, size, speed
-
Size, quality, speed
-
Speed
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
FF_JPG/JPG2K
FF_PDF/PDF_MRC
DTXT_IOTPDF/IOTPDF_MRC
kRecSetCompressionLevel(sid, 1); // Level 1
kRecSetCompressionTradeoff(sid, COMPRESSION_ADVANCED);
FF_JPG/JPG2K
FF_PDF/PDF_MRC
DTXT_IOTPDF/IOTPDF_MRC
kRecSetCompressionTradeoff(sid, COMPRESSION_FAST);
If quality is more important than file size, set kRecSetCompressionLevel(sid, 5); // Level 4-5
If file size is more important than quality, set kRecSetCompressionLevel(sid, 1); // Level 1-2
For DTXT_IOTPDF_MRC, set Kernel.OcrMgr.Images.KeepOcrImage = TRUE
The search returns topics that contain terms you enter. If you type more than one term, an OR is assumed, which returns topics where any of the terms are found. Enclose your search terms in quotes for exact-phrase matching.
The search also uses fuzzy matching to account for partial words (such as install and installs). The results appear in order of relevance, based on how many search terms occur per topic. Exact matches are highlighted.
To refine the search, you can use the following operators:
Note that operators cannot be used as search terms: + - * : ~ ^ ' "