RecAPI
|
Supporting different image file formats. More...
Typedefs | |
typedef struct tagIMGFILEHANDLE * | HIMGFILE |
Handle of image files. | |
Enumerations | |
enum | IMF_FORMAT { FF_TIFNO = 0, FF_TIFPB, FF_TIFHU, FF_TIFG31, FF_TIFG32, FF_TIFG4, FF_TIFLZW, FF_PCX, FF_DCX, FF_SIM, FF_BMP_NO, FF_BMP_RLE8, FF_BMP_RLE4, FF_AWD, FF_JPG_SUPERB, FF_JPG_LOSSLESS = FF_JPG_SUPERB, FF_JPG_GOOD, FF_JPG_MIN, FF_PDA, FF_PNG, FF_XIFF, FF_GIF, FF_MAX_LOSSLESS, FF_MAX_GOOD, FF_MAX_MIN, FF_PGX, FF_PDF_MIN, FF_PDF_GOOD, FF_PDF_SUPERB, FF_PDF_LOSSLESS = FF_PDF_SUPERB, FF_PDF_MRC_MIN, FF_PDF_MRC_GOOD, FF_PDF_MRC_SUPERB, FF_PDF_MRC_LOSSLESS = FF_PDF_MRC_SUPERB, FF_TIFJPGNEW, FF_JPG2K_SUPERB, FF_JPG2K_LOSSLESS = FF_JPG2K_SUPERB, FF_JPG2K_GOOD, FF_JPG2K_MIN, FF_JBIG2_LOSSLESS, FF_JBIG2_LOSSY, FF_XPS, FF_WMP, FF_JBIG, FF_OPG, FF_PDF, FF_PDF_MRC, FF_JPG, FF_JPG2K, FF_TIF, FF_SIZE } |
Image formats. More... | |
enum | IMF_IMAGEQUALITY { IMF_IMAGEQUALITY_MIN = 0, IMF_IMAGEQUALITY_GOOD = 1, IMF_IMAGEQUALITY_SUPERB = 2 } |
Image quality (for DTXT PDF output) More... | |
enum | IMF_MRCLEVEL { IMF_MRCLEVEL_NO = 0, IMF_MRCLEVEL_MIN = 1, IMF_MRCLEVEL_GOOD = 2, IMF_MRCLEVEL_SUPERB = 3 } |
MRC level (for DTXT PDF output) More... | |
enum | COMPRESSION_TRADEOFF { COMPRESSION_ADVANCED, COMPRESSION_FAST } |
Compression tradeoff. More... | |
enum | IMF_PDFCOMPATIBILITY { IMF_PDF_FORCESIZE = 0, IMF_PDF_FORCEQUALITY = 1, IMF_PDF15 = 2, IMF_PDF14 = 3, IMF_PDF13 = 4, IMF_PDF12 = 5, IMF_PDF11 = 6, IMF_PDF10 = 7, IMF_PDFA = 8, IMF_PDFA1B = IMF_PDFA, IMF_PDF16 = 9, IMF_PDF17 = 10, IMF_PDFA2B = 11, IMF_PDFA2U = 12, IMF_PDFA1A = 13, IMF_PDFA2A = 14, IMF_PDFA3B = 15, IMF_PDFA3U = 16, IMF_PDFA3A = 17, IMF_PDF20 = 18 } |
PDF compatibility (for saving PDF with KernelAPI) More... | |
enum | IMF_PDFENCRYPTION { IMF_PDFSECURITY_NONE, IMF_PDFSECURITY_STANDARD, IMF_PDFSECURITY_ENHANCED, IMF_PDFSECURITY_AES, IMF_PDFSECURITY_AES256, IMF_PDFSECURITY_AES256X } |
PDF encryption types. More... | |
enum | ENCRYPT_LEVEL { ENC_NOPAS = 0, ENC_MUSTPAS = 1, ENC_MASTER = 2, ENC_USER = 4, ENC_MUSTUSER = ENC_MUSTPAS | ENC_USER, ENC_MUSTMASTER = ENC_MUSTPAS | ENC_MASTER, ENC_MUSTANY = ENC_MUSTPAS | ENC_MASTER | ENC_USER, ENC_NOACCESS = 8 } |
PDF encryption level. More... | |
Functions | |
RECERR RECAPIKRN | kRecOpenImgFile (LPCTSTR pFilename, HIMGFILE *pHIMGFILE, int mode, IMF_FORMAT filetype) |
Opening an image file. | |
RECERR RECAPIKRN | kRecCloseImgFile (HIMGFILE hIFile) |
Closing an image file. | |
RECERR RECAPIKRN | kRecGetPDFEncLevel (HIMGFILE hIFile, ENCRYPT_LEVEL *pEncLev) |
RECERR RECAPIKRN | kRecSetImfLoadFlags (int sid, DWORD fFlag) |
Setting IMF PDF load flags. | |
RECERR RECAPIKRN | kRecGetImfLoadFlags (int sid, DWORD *pfFlag) |
Getting IMF PDF load flags. | |
RECERR RECAPIKRN | kRecLoadImg (int sid, HIMGFILE hIFile, HPAGE *phPage, int iPage) |
Loading a page from an opened image file. | |
RECERR RECAPIKRN | kRecLoadImgF (int sid, LPCTSTR pFilename, HPAGE *phPage, int nPage) |
Loading a page directly from an image file. | |
RECERR RECAPIKRN | kRecLoadImgDataStream (int sid, HIMGFILE hIFile, HPAGE *phPage, int iPage) |
Loading a page from an opened image file without decompressing the image. | |
RECERR RECAPIKRN | kRecLoadImgDataStreamF (int sid, LPCTSTR pFilename, HPAGE *phPage, int nPage) |
Loading a page directly from an image file without decompressing the image. | |
RECERR RECAPIKRN | kRecDecompressImgDataStream (int sid, HPAGE hPage) |
Decompressing a DataStream. | |
RECERR RECAPIKRN | kRecFreeImgDataStream (int sid, HPAGE hPage) |
Deleting DataStream from an HPAGE. | |
RECERR RECAPIKRN | kRecLoadImgM (int sid, BYTE *lpBitmap, LPCIMG_INFO lpImg, HPAGE *phPage) |
Loading a page directly from a memory buffer. | |
RECERR RECAPIKRN | kRecLoadImgMC (int sid, BYTE *lpBuf, size_t bufLen, LPCCOMPRESSED_IMG_INFO lpCImg, HPAGE *phPage) |
Loading a page directly from a compressed memory buffer. | |
RECERR RECAPIKRN | kRecLoadImgDataStreamMC (int sid, BYTE *lpBuf, size_t bufLen, LPCOMPRESSED_IMG_INFO lpCImg, HPAGE *phPage) |
Loading a page directly from a compressed memory buffer without decompressing the image. | |
RECERR RECAPIKRN | kRecSetCompressionLevel (int sid, int CompressionLevel) |
Setting the compression level. | |
RECERR RECAPIKRN | kRecGetCompressionLevel (int sid, int *pCompressionLevel) |
Getting the compression level. | |
RECERR RECAPIKRN | kRecSetCompressionTradeoff (int sid, COMPRESSION_TRADEOFF CompressionTradeoff) |
Setting the compression trade-off. | |
RECERR RECAPIKRN | kRecGetCompressionTradeoff (int sid, COMPRESSION_TRADEOFF *pCompressionTradeoff) |
Getting the compression tradeoff. | |
RECERR RECAPIKRN | kRecSetMRCCompressionSettingsFromLevel (int sid, int CompressionLevel, COMPRESSION_TRADEOFF CompressionTradeOff) |
Modifying the MRC settings according to the given compression level and tradeoff. | |
RECERR RECAPIKRN | kRecSetJPGQuality (int sid, int nQuality) |
Setting JPEG quality. | |
RECERR RECAPIKRN | kRecGetJPGQuality (int sid, int *pnQuality) |
Getting JPEG quality. | |
RECERR RECAPIKRN | kRecSaveImg (int sid, HIMGFILE hIFile, IMF_FORMAT Imgfileformat, HPAGE hPage, IMAGEINDEX iiImg, INTBOOL bAppend) |
Saving a page. | |
RECERR RECAPIKRN | kRecSaveImgForce (int sid, HIMGFILE hIFile, IMF_FORMAT Imgfileformat, HPAGE hPage, IMAGEINDEX iiImg, INTBOOL bAppend) |
Saving a page with forcing the format. | |
RECERR RECAPIKRN | kRecSaveImgF (int sid, LPCTSTR pFilename, IMF_FORMAT Imgfileformat, HPAGE hPage, IMAGEINDEX img, INTBOOL bAppend) |
Saving a page directly into a file. | |
RECERR RECAPIKRN | kRecSaveImgForceF (int sid, LPCTSTR pFilename, IMF_FORMAT Imgfileformat, HPAGE hPage, IMAGEINDEX iiImg, INTBOOL bAppend) |
Saving a page directly into a file with forcing of the format. | |
RECERR RECAPIKRN | kRecSaveImgArea (int sid, HIMGFILE hIFile, IMF_FORMAT format, HPAGE hPage, IMAGEINDEX iiImg, LPCRECT pRect, INTBOOL append) |
Saving an area of a page. | |
RECERR RECAPIKRN | kRecSaveImgAreaF (int sid, LPCTSTR pFilename, IMF_FORMAT format, HPAGE hPage, IMAGEINDEX iiImg, LPCRECT pRect, INTBOOL append) |
Saving an area of a page directly into a file. | |
RECERR RECAPIKRN | kRecSetPdfPassword (HIMGFILE hIFile, LPCTSTR pwd) |
Setting PDF password. | |
RECERR RECAPIKRN | kRecSetPdfTagInfo (int sid, INTBOOL bUseTagInfo) |
Setting use of PDF tag information. | |
RECERR RECAPIKRN | kRecGetPdfTagInfo (int sid, INTBOOL *pbUseTagInfo) |
Getting the use of PDF tag information. | |
RECERR RECAPIKRN | kRecGetImgFilePageCount (HIMGFILE hIFile, int *lpPageCount) |
Getting the number of pages in an image file. | |
RECERR RECAPIKRN | kRecGetImgFilePageInfo (int sid, HIMGFILE hIFile, int nPage, LPIMG_INFO pImg, IMF_FORMAT *pFormat) |
Getting information about a page of an image file. | |
RECERR RECAPIKRN | kRecCopyImgFilePage (int sid, HIMGFILE hIFileDst, int ndstPage, HIMGFILE hIFileSrc, int nsrcPage) |
Copying a page between TIFF files. | |
RECERR RECAPIKRN | kRecDeleteImgFilePage (int sid, HIMGFILE hIFile, int nPage) |
Removing a page from a TIFF file. | |
RECERR RECAPIKRN | kRecInsertImgFilePage (int sid, HPAGE hPage, IMAGEINDEX iiImg, HIMGFILE hIFile, int nPage, IMF_FORMAT format) |
Inserting a page into a TIFF file. | |
RECERR RECAPIKRN | kRecIsMultipageImgFileFormat (IMF_FORMAT imgfileformat, INTBOOL *bEnabled) |
Checking multi-page capability of an image format. | |
RECERR RECAPIKRN | kRecMatchImgFileFormat (int sid, HPAGE hPage, IMAGEINDEX iiImg, IMF_FORMAT imgfileformat, INTBOOL *match) |
Checking whether an image is suitable for a file format. | |
RECERR RECAPIKRN | kRecPackImgFile (int sid, LPCTSTR pFileName) |
Packing a TIFF file. | |
RECERR RECAPIKRN | kRecUpdateImgFilePage (int sid, HPAGE hPage, IMAGEINDEX iiImg, HIMGFILE hIFile, int nPage, IMF_FORMAT format) |
Replacing a page in a TIFF file. | |
RECERR RECAPIKRN | kRecReplaceImgFilePage (int sid, HIMGFILE hIFileDst, int ndstPage, HIMGFILE hIFileSrc, int nsrcPage) |
Replacing a page in a TIFF file. | |
RECERR RECAPIKRN | kRecGetImgFilePageIndex (HIMGFILE hIFile, int *pIndex) |
Getting the index of the current page. | |
Image file opening modes | |
#define | IMGF_SCANNER (HIMGFILE)-1 |
Image input from scanner. (Use it with kRecLoadImg.) | |
#define | IMGF_READ 0 |
Opening file for reading only. The file can be shared. (Use it with kRecOpenImgFile.) | |
#define | IMGF_RDWR 2 |
Opening file for both reading and writing. The opening is exclusive. The file is appendable. When the file does not exist it creates a new one. (Use it with kRecOpenImgFile.) | |
IMF PDF Load Flags defines for loading PDF file | |
Possible bits of the setting Kernel.Imf.PDF.LoadFlags, which can be set by kRecSetImfLoadFlags. These bits can be combined. The rendered elements appear on the II_ORIGINAL image of the HPAGE.
| |
#define | IMF_PDF_AS_IMAGE 1 |
Disable using PDF text. PDF is loaded as an image (e.g. a TIFF). | |
#define | IMF_PDF_NO_TAGS 2 |
Disable using PDF tags. | |
#define | IMF_PDF_ANN_NOTE (4 << 0) |
Enable rendering sticky-note icons. | |
#define | IMF_PDF_ANN_LINK (4 << 1) |
Enable rendering hyperlinks. | |
#define | IMF_PDF_ANN_TEXT (4 << 2) |
Enable rendering text. | |
#define | IMF_PDF_ANN_LINE (4 << 3) |
Enable rendering straight lines. | |
#define | IMF_PDF_ANN_SQUARE (4 << 4) |
Enable rendering rectangles. | |
#define | IMF_PDF_ANN_CIRCLE (4 << 5) |
Enable rendering ellipses. | |
#define | IMF_PDF_ANN_POLYGON (4 << 6) |
Enable rendering closed and filled polygons. | |
#define | IMF_PDF_ANN_POLYLINE (4 << 7) |
Enable rendering closed polygons. | |
#define | IMF_PDF_ANN_HIGHLIGHT (4 << 8) |
Enable rendering highlights of the document text. | |
#define | IMF_PDF_ANN_UNDERLINE (4 << 9) |
Enable rendering underline of the document text. | |
#define | IMF_PDF_ANN_SQUIGGLY (4 << 10) |
Enable rendering jagged underline of the document text. | |
#define | IMF_PDF_ANN_CROSSOUT (4 << 11) |
Enable rendering crossout of the document text. | |
#define | IMF_PDF_ANN_STAMP (4 << 12) |
Enable rendering stamps. | |
#define | IMF_PDF_ANN_CARET (4 << 13) |
Enable rendering carets. | |
#define | IMF_PDF_ANN_PENCIL (4 << 14) |
Enable rendering freehand drawing. | |
#define | IMF_PDF_ANN_POPUP (4 << 15) |
Enable rendering popup windows. | |
#define | IMF_PDF_ANN_FILEATTACHMENT (4 << 16) |
Enable rendering file attachment icons. | |
#define | IMF_PDF_ANN_SOUND (4 << 17) |
Enable rendering sound icons. | |
#define | IMF_PDF_ANN_MOVIE (4 << 18) |
Enable rendering movie icons. | |
#define | IMF_PDF_ANN_FORM (4 << 19) |
Enable rendering Acro-Form fields. | |
#define | IMF_PDF_ANN_SCREEN (4 << 20) |
Enable rendering screen icons. | |
#define | IMF_PDF_ANN_PRINTERMARK (4 << 21) |
Enable rendering printer's mark icons. | |
#define | IMF_PDF_ANN_TRAPNET (4 << 22) |
Enable rendering trap network icons. | |
#define | IMF_PDF_ANN_WATERMARK (4 << 23) |
Enable rendering watermark. | |
#define | IMF_PDF_ANN_3D (4 << 24) |
Enable rendering 3d icons. | |
Pagenumber defines for loading a page | |
See kRecLoadImg. | |
#define | IMGF_NEXTPAGE -1 |
The next page of a HIMGFILE. | |
#define | IMGF_FIRSTPAGE 0 |
The first page of a HIMGFILE. |
Supporting different image file formats.
This module supports loading and saving different image file formats. Accessible formats are specified by IMF_FORMAT. During loading, the system can automatically detect the file format and compression method of the image files without using file extensions. Both this module, and the Image Handling Module support B/W, grayscale and color images.
CSDK v20 can read the following multi-page image file formats: DCX, MAX, PDF, TIFF and TIFF-FX.
Load input can be an image file already open (kRecOpenImgFile, kRecLoadImg), the image file itself (kRecLoadImgF), or the memory of the integrating application (kRecLoadImgM, kRecLoadImgMC). The first two functions can handle multi-page image files. The former can load a specified page or the next page, while the latter can load only the specified one.
After the file is loaded, the image is forwarded to the Image Handling Module. Saving input is also provided by the Image Handling Module.
On loading, 4-bit greyscale images are converted into the 8-bit greyscale format, and 4-bit palette color images are converted into the 8-bit palette color format.
The working of the Image File Handling Module can be adjusted with settings in some points.
There is a limit for the maximum number of pixels for either the height or width of an image, given by the settings Kernel.Img.Max.Pix.*. Its default value is 8400 pixels, for both the X
and Y
dimensions. The user can process larger images by modifying these values - up to 32000 pixels, both horizontally and vertically. Thus CSDK can reach either A0 size (33" x 46") or 2400 DPI in particular situations (see the indicative table at the end of chapter 1 in the User’s Guide). The default value is fixed so that any workflow can be safely and successfully finished without image size issues. Any image exceeding the pixel limit will be skipped. Using the default value protects high-volume unattended processing from use of high resources.
The inch-based page size limits (Kernel.Img.Max.Inch.*
) are abolished since CSDK 16. There are no module-specific limits to image size. The available memory, the computing environment and properties of individual image files all influence the maximum sizes for successful image processing.
Notes
*.rtf
and *.docx
and *.pptx
file extensions. These formats try to retain the original page size and layout. If you try to save this, you will get an error message and the file will not be saved.X
and Y
limits for the minimum pixel size of the image: Kernel.Img.Min.Pix.*In a standard workflow, saving an image using a lossy compression method loses both the compression level and the quality of the input image even if the output file format is the same as the loaded one. It can be especially annoying when a JPEG image is put into a PDF file for creating a searchable PDF.
OmniPage CSDK 20.20 introduces a new notion called DataStream. This is an optional part of an HPAGE that contains the input image without any decompression. The DataStream can use JPEG or JPEG2000 compression; therefore such a page can be created from JPEG, JPEG2000 and TIFF using 'new style' JPEG files. After loading these types of image files, the HPAGE
does not contain decompressed bitmap, but all CSDK functions can decompress it automatically if the decompressed bitmap is needed. After decompressing the DataStream the HPAGE
contains both the DataStream and the decompressed bitmap. When the HPAGE
is saved, you can specify whether or not to use the DataStream.
To keep compatibility with the previous versions of CSDK, two new settings were introduced:
Kernel.Imf.DataStream.TryToLoad
: bool setting, default is false, andKernel.Imf.DataStream.Save
: bool setting, default is true.If you set Kernel.Imf.DataStream.TryToLoad
to true, the standard image loading functions (kRecLoadImg, kRecLoadImgF) load the DataStream if possible, otherwise they load the decompressed image. There are functions (kRecLoadImgDataStream, kRecLoadImgDataStreamF, kRecLoadImgDataStreamMC), that – regardless of the status of Kernel.Imf.DataStream.TryToLoad
– always load the DataStream, or return error if the input format is not suitable.
If Kernel.Imf.DataStream.Save
is true, and the HPAGE
contains DataStream, the saving operations (any kRecSaveImg*
and also any kRecConvert2DTXT*
) decide whether or not to write the DataStream into the output file.
If a CSDK function changes II_CURRENT
image, the DataStream will be deleted except if the image is rotated or 2d-deskewed or Kernel.Img.KeepOriginalImage
is true.
If you want to force saving the decompressed data, you can set Kernel.Imf.DataStream.Save
to false, or you can delete DataStream calling kRecFreeImgDataStream.
In OmniPage CSDK 19.20 the following image formats were introduced (supported on: Windows, Linux, Embedded Linux):
Note: the mentioned older formats can be used, but the newer ones are suggested.
The older formats provided 3 predefined levels (MIN
, GOOD
, SUPERB
). The newer ones can be used with 5 different predefined levels (1-5) by calling kRecSetCompressionLevel.
In addition for PDF formats a trade-off setting is introduced (COMPRESSION_TRADEOFF, kRecSetCompressionTradeoff), which can speed up the used algorithm (producing a lower quality).
The higher compression level means lower compression and higher quality (i.e. greater file size). The older levels can be reproduced by newer ones if the trade-off is COMPRESSION_ADVANCED:
MIN
- level 1,GOOD
- level 3,SUPERB
- level 5.Furthermore, there is a customization possibility for manual tuning of quality with compression level 0.
The quality of JPEG and JPEG2000 images can be tuned by the setting Kernel.IMF.JPG.Quality
both in older and newer formats (either JPEG, JPEG2000 or non-MRC PDF). However, in newer formats the value of this setting is used only in compression level 0. For the predefined JPEG quality values of different compression levels see kRecSetJPGQuality.
The older formats were customizable by different settings. If these settings were modified, their values were used during file creation.
The newer formats do not use some older settings:
Instead of the above settings new ones were introduced (see detailed descriptions):
Each compression level uses predefined values for these new settings. Selecting a non-0 compression level the predefined values are used during creation of file, even if the value of any new setting were changed manually. However compression level 0 uses the current value of these settings. For putting the predefined values of a non-0 compression level into these settings the function kRecSetMRCCompressionSettingsFromLevel can be used. See notes in the documentation of the function for details.
There are some saving functions that can affect on the orientation of the page, when they create a PDF file (kRecSaveImg, kRecSaveImgF, kRecSaveImgForce, kRecSaveImgForceF, kRecConvert2DTXTEx and kRecMakePagesSearchable). The orientation of the written page depends on the IMAGEINDEX parameter of these functions. In case of PDF output this parameter can get only the following values:
The result of using other IMAGEINDEX
values is undefined.
However there are some exceptions:
II_CURRENT
can be used when kRecPreprocessImg have been already called.II_ORIGINAL
can be used when this image exists. See the lifetime of the different images of the HPAGE
.II_ORIGINAL
can be used also when HPAGE
contains DataStream or when kRecMakePagesSearchable
is called.IMAGEINDEX
parameter. Thus if it creates PDF output, the orientation of the page depends on the setting Kernel.Img.KeepOriginalImage as the followings:FALSE
, the result of the function is the same as the one created by kRecConvert2DTXTEx
using II_CURRENT
image index.TRUE
, the result of the function is the same as the one created by kRecConvert2DTXTEx
using II_ORIGINAL
image index.kRecConvert2DTXTEx
) if its file name parameter is not empty. That's why it is recommended to use kRecConvert2DTXTEx instead. enum COMPRESSION_TRADEOFF |
Compression tradeoff.
This enum gives the possible values of the setting Kernel.Imf.CompressionTradeoff, which determines whether the fast or advanced compression method is used. This setting is used when FF_PDF and FF_PDF_MRC output is created. In both cases
FAST
trade-off indicates usage of JPEG or TIFF G4 compression,ADVANCED
trade-off uses JPEG2000 or JBIG2 compression,according to the bit-depth of the image. In case of FF_PDF_MRC
the trade-off affects on the algorithms used for creating layers as well.
enum ENCRYPT_LEVEL |
PDF encryption level.
PDF files may be protected by two types of password: an open (also known as user) password and a permissions (also known as owner or master) password. The open password protects the opening of the file. When a file requires an open password, OmniPage CSDK cannot open it without this, so an appropriate interface must be provided for the user to supply the password. If a file is protected by a permissions password, it must be supplied in order to grant or deny permissions for different file operations, such as copying content, printing or modifying. When a particular operation is prohibited, OmniPage CSDK does not allow the operation concerned. If text copying is prohibited from a PDF file with a text layer and a permissions password is not given, CSDK opens it as if it were an image-only PDF. If printing is prohibited and a permissions password is not given, the PDF file cannot be opened. When a file is protected by both an open and a permissions password, OmniPage CSDK requires only the permissions password for full access to be granted. See kRecGetPDFEncLevel.
enum IMF_FORMAT |
Image formats.
The supported image formats. The multi-page file types (TIFF, DCX, MAX, PDF, JBIG) can contain pages compressed by different methods in the same file. Thus image format must be given page-by-page.
FF_PDA
, FF_BMP_RLE4
formats are not supported at all.FF_PCX
, FF_DCX
, FF_BMP_NO
, FF_BMP_RLE8
, FF_TIFNO
, FF_TIFPB
, and FF_PNG
are supported by the Engine for both reading and writing and for all image types (B/W, 4-bit grayscale, 8-bit grayscale, 8-bit palette-color and 24-bit true-color).FF_TIFHU
, FF_TIFG31
, FF_TIFG32
, FF_TIFG4
and the FF_SIM
formats support reading and writing B/W images only.FF_TIFJPGNEW
images are supported by the Engine only for 8-bit grayscale and 24-bit color images.FF_TIFNO |
Uncompressed TIFF image format. |
FF_TIFPB |
Packbits TIFF image format. |
FF_TIFHU |
Group 3 Modified TIFF image format. |
FF_TIFG31 |
Standard G3 1D TIFF image format. |
FF_TIFG32 |
Standard G3 2D TIFF image format. |
FF_TIFG4 |
Standard G4 TIFF image format. |
FF_TIFLZW |
TIFF-LZW image format incorporating Unisys compression. |
FF_PCX |
PCX format. |
FF_DCX |
DCX format. |
FF_SIM |
Simple file format. Supported on: Windows, Linux, Embedded Linux, Mac OS X. |
FF_BMP_NO |
Windows bitmap format without compression. |
FF_BMP_RLE8 |
Windows bitmap RLE8 format. |
FF_BMP_RLE4 |
Windows bitmap RLE4 format. Only for reading! |
FF_AWD |
Not supported! |
FF_JPG_SUPERB |
Deprecated (see usage of new formats). JPEG format with negligible information loss. |
FF_JPG_LOSSLESS |
Deprecated, same as FF_JPG_SUPERB. |
FF_JPG_GOOD |
Deprecated (see usage of new formats). JPEG format with average information loss. (Results in medium-size image files when saving.) |
FF_JPG_MIN |
Deprecated (see usage of new formats). JPEG format optimized for minimum image file size. Worst image quality. |
FF_PDA |
Caere's proprietary compound document format. Only for reading! Only images with a single zone are supported! |
FF_PNG |
Portable Image format for Network Graphics. |
FF_XIFF |
TIFF-FX format. Only for reading! Supported on: Windows 32-bit. |
FF_GIF |
GIF image format incorporating Unisys compression. |
FF_MAX_LOSSLESS |
PaperPort MAX file format without information loss. Only for reading! Supported on: Windows 32-bit. |
FF_MAX_GOOD |
PaperPort MAX file format with average information loss. Only for reading! Supported on: Windows 32-bit. |
FF_MAX_MIN |
PaperPort MAX file format optimized for minimum image file size. Only for reading! Supported on: Windows 32-bit. |
FF_PGX |
Only for internal use! |
FF_PDF_MIN |
Deprecated (see usage of new formats). Adobe PDF format. Minimum image file size. Supported on: Windows, Linux, Embedded Linux. |
FF_PDF_GOOD |
Deprecated (see usage of new formats). Adobe PDF format. Results in medium-size image files when saving. Supported on: Windows, Linux, Embedded Linux. |
FF_PDF_SUPERB |
Deprecated (see usage of new formats). Adobe PDF format with negligible information loss. Supported on: Windows, Linux, Embedded Linux. |
FF_PDF_LOSSLESS |
Deprecated, use FF_PDF_SUPERB instead. |
FF_PDF_MRC_MIN |
Deprecated (see usage of new formats). Adobe PDF format with MRC technology. Optimized for minimum image file size. Supported on: Windows, Linux, Embedded Linux. |
FF_PDF_MRC_GOOD |
Deprecated (see usage of new formats). Adobe PDF format with MRC technology. (Results in medium-size image files when saving.) Supported on: Windows, Linux, Embedded Linux. |
FF_PDF_MRC_SUPERB |
Deprecated (see usage of new formats). Adobe PDF format with MRC technology. PDF with small information loss. Supported on: Windows, Linux, Embedded Linux. |
FF_PDF_MRC_LOSSLESS |
Deprecated, use FF_PDF_MRC_SUPERB instead. |
FF_TIFJPGNEW |
New JPG Compressed TIFF image format. |
FF_JPG2K_SUPERB |
Deprecated (see usage of new formats). JPEG2000 file format. Negligible information loss. |
FF_JPG2K_LOSSLESS |
Deprecated, same as FF_JPG2K_SUPERB. |
FF_JPG2K_GOOD |
Deprecated (see usage of new formats). JPEG2000 file format. Results in medium-size image files when saving. |
FF_JPG2K_MIN |
Deprecated (see usage of new formats). JPEG2000 file format. Optimized for minimum image file size. |
FF_JBIG2_LOSSLESS |
JBIG2 file format. Lossless image saving. |
FF_JBIG2_LOSSY |
JBIG2 file format. Optimized for minimum image file size. |
FF_XPS |
XPS file format. Supported on: Windows. |
FF_WMP |
Microsoft HD Photo (Windows Media Photo). Supported on: Windows. |
FF_JBIG |
JBIG format. Only for reading! Supported on: Windows. |
FF_OPG |
"OmniPageCSDK" HPAGE serialization format. One-page format, not appendable. OPG file contains all members of the |
FF_PDF |
Adobe PDF format with changeable compression level (see usage of new formats). Supported on: Windows, Linux, Embedded Linux. |
FF_PDF_MRC |
Adobe PDF format using MRC technology with changeable compression level (see usage of new formats). Supported on: Windows, Linux, Embedded Linux. |
FF_JPG |
JPEG format with changeable compression level (see usage of new formats). Supported on: Windows, Linux, Embedded Linux. |
FF_JPG2K |
JPEG2000 file format with changeable compression level (see usage of new formats). Supported on: Windows, Linux, Embedded Linux. |
FF_TIF |
TIF file format with changeable compression and compression level (see usage of new formats). Supported on: Windows, Linux, Embedded Linux. |
FF_SIZE |
Number of supported image file formats. |
enum IMF_IMAGEQUALITY |
Image quality (for DTXT PDF output)
This enum gives the possible values of Kernel.DTxt.PDF.BWQuality and ...ColorQuality. See also the section PDF output in KernelAPI.
enum IMF_MRCLEVEL |
MRC level (for DTXT PDF output)
This enum gives the possible values of the setting Kernel.DTxt.PDF.UseMRC, which determines the MRC method used for DTXT PDF output. See also the section PDF output in KernelAPI.
enum IMF_PDFCOMPATIBILITY |
PDF compatibility (for saving PDF with KernelAPI)
This enum gives the possible values of the setting Kernel.Imf.PDF.Compatibility
, which is used during saving image-only or image-on-text PDF files. See also the section PDF output in KernelAPI.
enum IMF_PDFENCRYPTION |
PDF encryption types.
PDF files may be saved with different encryption types. The setting Kernel.Imf.PDF.PDFSecurity.Type gets one of the values listed below for specifying the used encryption type. See also the description of saving encrypted PDF.
Closing an image file.
This function closes an image file opened by kRecOpenImgFile.
[in] | hIFile | Handle of the image file. |
RECERR |
RECERR kRecCloseImgFile(IntPtr pHIMGFILE);
RECERR RECAPIKRN kRecCopyImgFilePage | ( | int | sid, |
HIMGFILE | hIFileDst, | ||
int | ndstPage, | ||
HIMGFILE | hIFileSrc, | ||
int | nsrcPage | ||
) |
Copying a page between TIFF files.
The kRecCopyImgFilePage function copies a page from a source TIFF image file and inserts it into a destination TIFF image file.
[in] | sid | Settings Collection ID. |
[in] | hIFileDst | Handle of the destination TIFF image file opened by kRecOpenImgFile for writing. |
[in] | ndstPage | Page number of the page in the destination image file, before which the page should be copied, -1 means append. To insert the page as the first page in the image file, the value zero (0) should be specified. |
[in] | hIFileSrc | Handle of the source TIFF image file opened by kRecOpenImgFile for reading. |
[in] | nsrcPage | Page number of the page in the source image file to be copied from. For a single-page source image file a value of zero (0) should be specified. |
RECERR |
RECERR kRecCopyImgFilePage(int sid, IntPtr hIFileDst, int ndstPage, IntPtr hIFileSrc, int nsrcPage);
Decompressing a DataStream.
This function decompresses the DataStream of the given HPAGE loaded by kRecLoadImgDataStream or kRecLoadImgDataStreamF.
[in] | sid | Settings Collection ID. |
[in] | hPage | Handle of the page containing the DataStream. |
RECERR |
hPage
does not contain DataStream, or DataStream already has been decompressed the function returns REC_OK without doing anything. hPage
will contain both the compressed DataStream and the decompressed image. RECERR kRecDecompressImgDataStream(int sid, IntPtr hPage);
Removing a page from a TIFF file.
The kRecDeleteImgFilePage deletes a page from a TIFF image file.
[in] | sid | Settings Collection ID. |
[in] | hIFile | Handle of the multi-page TIFF image file. |
[in] | nPage | Page number of the page to be deleted. The value zero (0) means the first page of the file. |
RECERR |
RECERR kRecDeleteImgFilePage(int sid, IntPtr hIFile, int nPage);
Deleting DataStream from an HPAGE.
This function deletes the uncompressed DataStream from the HPAGE loaded by kRecLoadImgDataStream or kRecLoadImgDataStreamF.
[in] | sid | Settings Collection ID. |
[in] | hPage | Handle of the page containing the DataStream. |
RECERR |
hPage
does not contain DataStream the function returns API_PARAMETER_ERR. kRecFreeImg function frees the whole HPAGE
(including DataStream), so in typical workflow this function should not be called. RECERR kRecFreeImgDataStream(int sid, IntPtr hPage);
RECERR RECAPIKRN kRecGetCompressionLevel | ( | int | sid, |
int * | pCompressionLevel | ||
) |
Getting the compression level.
This function retrieves the compression level used when an image is saved to specific formats.
[in] | sid | Settings Collection ID. |
[out] | pCompressionLevel | Pointer of a variable to store the current compression level. |
RECERR |
RECERR kRecGetCompressionLevel(int sid, out int CompressionLevel);
RECERR RECAPIKRN kRecGetCompressionTradeoff | ( | int | sid, |
COMPRESSION_TRADEOFF * | pCompressionTradeoff | ||
) |
Getting the compression tradeoff.
This function gets the compression trade-off used when an image is saved to specific formats.
[in] | sid | Settings Collection ID. |
[out] | pCompressionTradeoff | Pointer of a variable to store the current compression tradeoff. |
RECERR |
RECERR kRecGetCompressionTradeoff(int sid, out int CompressionTradeoff);
RECERR RECAPIKRN kRecGetImfLoadFlags | ( | int | sid, |
DWORD * | pfFlag | ||
) |
Getting IMF PDF load flags.
The kRecGetImfLoadFlags function get the current IMF Load Flags.
[in] | sid | Settings Collection ID. |
[out] | pfFlag | The IMF Load Flag combination |
RECERR |
RECERR kRecGetImfLoadFlags(int sid, out uint fFlag);
Getting the number of pages in an image file.
The kRecGetImgFilePageCount function inquires the number of pages in an image file. With this function there is no need to load the pages of an image file to find out their number.
[in] | hIFile | Handle of the image file opened by kRecOpenImgFile to be examined. |
[out] | lpPageCount | Pointer of a variable to get the number of pages. |
RECERR |
RECERR kRecGetImgFilePageCount(IntPtr hIFile, out int pPageCount);
Getting the index of the current page.
This function retrieves the current index of the page counter. The page counter holds the index of the page to be read from a multi-page image file by a subsequent image loader function call kRecLoadImg passing a IMGF_NEXTPAGE parameter.
[in] | hIFile | Handle of the file. |
[out] | pIndex | Pointer of a variable to store the index of the page. It is a zero-based index. If the latest page has been loaded, it is -1. |
RECERR |
RECERR kRecGetImgFilePageIndex(IntPtr hIFile, out int pIndex);
RECERR RECAPIKRN kRecGetImgFilePageInfo | ( | int | sid, |
HIMGFILE | hIFile, | ||
int | nPage, | ||
LPIMG_INFO | pImg, | ||
IMF_FORMAT * | pFormat | ||
) |
Getting information about a page of an image file.
The kRecGetImgFilePageInfo function inquires the size, resolution and other attributes of the specified page of an image file.
[in] | sid | Settings Collection ID. |
[in] | hIFile | Handle of the image file. |
[in] | nPage | Pagenumber of the required page. |
[out] | pImg | Address of the structure to get the page information. |
[out] | pFormat | Pointer of a variable to get the compression format of the page. |
RECERR |
RECERR kRecGetImgFilePageInfo(int sid, IntPtr hIFile, int nPage, out IMG_INFO pImg, out IMF_FORMAT pFormat);
RECERR RECAPIKRN kRecGetJPGQuality | ( | int | sid, |
int * | pnQuality | ||
) |
Getting JPEG quality.
This function retrieves the JPEG quality setting used when images were saved into JPEG or JPEG2000 files.
[in] | sid | Settings Collection ID. |
[out] | pnQuality | JPEG quality. |
RECERR |
RECERR kRecGetJPGQuality(int sid, out int nQuality);
RECERR RECAPIKRN kRecGetPDFEncLevel | ( | HIMGFILE | hIFile, |
ENCRYPT_LEVEL * | pEncLev | ||
) |
This function retrieves the encryption level of the opened PDF. For more information see ENCRYPT_LEVEL and Handling Encrypted PDF Files.
[in] | hIFile | Handle of the image file. |
[out] | pEncLev | Pointer of a variable to store the encryption level. |
RECERR |
RECERR kRecGetPDFEncLevel(IntPtr hIFile, out ENCRYPT_LEVEL pEncLev);
RECERR RECAPIKRN kRecGetPdfTagInfo | ( | int | sid, |
INTBOOL * | pbUseTagInfo | ||
) |
Getting the use of PDF tag information.
This function gets whether the Engine is set to use the tag information of the PDF file or not. For more information see kRecSetPdfTagInfo.
[in] | sid | Settings Collection ID. |
[out] | pbUseTagInfo | Pointer of a variable to store whether the Engine is set to use tag information. If it is TRUE the tag information is used. |
RECERR |
RECERR kRecGetPdfTagInfo(int sid, out bool pbUseTagInfo);
RECERR RECAPIKRN kRecInsertImgFilePage | ( | int | sid, |
HPAGE | hPage, | ||
IMAGEINDEX | iiImg, | ||
HIMGFILE | hIFile, | ||
int | nPage, | ||
IMF_FORMAT | format | ||
) |
Inserting a page into a TIFF file.
The kRecInsertImgFilePage function inserts a compressed image into a TIFF image file.
[in] | sid | Settings Collection ID. |
[in] | hPage | Handle of the page containing the image to be inserted. |
[in] | iiImg | Index of the image to be inserted. |
[in] | hIFile | Handle of the multi-page TIFF image file. |
[in] | nPage | Page number of the page in the image file before which the new page should be inserted. To insert the page as the first page in the image file, the value zero (0) should be specified. |
[in] | format | Image file format (compression) to be applied to the page. Of course, only the TIFF formats can be selected. |
RECERR |
RECERR kRecInsertImgFilePage(int sid, IntPtr hPage, IMAGEINDEX iiImg, IntPtr hIFile, int nPage, IMF_FORMAT format);
RECERR RECAPIKRN kRecIsMultipageImgFileFormat | ( | IMF_FORMAT | imgfileformat, |
INTBOOL * | bEnabled | ||
) |
Checking multi-page capability of an image format.
The kRecIsMultipageImgFileFormat function checks whether the specified image file format can handle multi-page image files.
[in] | imgfileformat | Selected image file format to be checked. |
[out] | bEnabled | Pointer of a Boolean variable to get the information. The returned value of TRUE means that the selected image file format supports multi-page images. |
RECERR |
RECERR kRecIsMultipageImgFileFormat(IMF_FORMAT imgfileformat, out bool bEnabled);
Loading a page from an opened image file.
The kRecLoadImg function loads a page from an image file opened by kRecOpenImgFile into the image management module.
If the image source provides a gray-scale image, this function can convert it to B/W. If the image source provides a 24-bit color image, this function can convert it to gray-scale or B/W. The way this function handles the different image types (such as B/W, gray-scale or 24-bit color images) is called primary image conversion mode. The conversion mode to be applied can be set by the kRecSetImgConvMode API function. This function should also be used for subsequent access to pages of multi-page image files. The kRecLoadImg function activates the PID_IMGINPUT process. The PID_SCANNER_WARMUP process might also be activated by using image file handle IMGF_SCANNER.
[in] | sid | Settings Collection ID. |
[in] | hIFile | Handle of the image file. |
[out] | phPage | Address of a variable to store the handle of the created page. |
[in] | iPage | The page number of the page to be loaded. IMGF_NEXTPAGE means the next page. |
RECERR |
phPage
output parameter contains a NULL value, the image has not been loaded into the Engine. If the function returns an error but phPage
is not NULL then you may have a corrupted image loaded. It gives an IMG_DPI_WARN warning when the resolution is less than 75 DPI or greater than 2400 DPI, but of course the image is loaded and in this case it is not corrupted. It is strongly recommended to handle the return code of this function properly. iPage
) loads the 6th page. RECERR rc; int nPages; HPAGE hPage; char *imgfile = "imgfile.tif"; HIMGFILE hIFile = NULL; rc = kRecOpenImgFile( imgfile, &hIFile, IMGF_READ, (IMF_FORMAT)0); rc = kRecGetImgFilePageCount(hIFile, &nPages); for (int i = 0; i < nPages; i++) { rc = kRecLoadImg(sid, hIFile, &hPage, IMGF_NEXTPAGE); if (rc != REC_OK) { kRecCloseImgFile(hIFile); // . . . Some error handling . . . return; } // . . . // do something // (e.g: save part of the image or call kRecRecognize) // . . . rc = kRecFreeImg(hPage); } kRecCloseImgFile(hIFile);
RECERR kRecLoadImg(int sid, IntPtr hIFile, out IntPtr phPage, int page);
Loading a page from an opened image file without decompressing the image.
The kRecLoadImgDataStream function loads a page from an image file opened by kRecOpenImgFile without decompressing the image.
[in] | sid | Settings Collection ID. |
[in] | hIFile | Handle of the image file. |
[out] | phPage | Address of a variable to store the handle of the created page. |
[in] | iPage | The page number of the page to be loaded. IMGF_NEXTPAGE means the next page. |
RECERR |
HPAGE
does not contain decompressed bitmap. See the details about possible operations and their working in the documentation of DataStream. iPage
) loads the 6th page. RECERR kRecLoadImgDataStream(int sid, IntPtr hIFile, out IntPtr phPage, int page);
Loading a page directly from an image file without decompressing the image.
This function loads a page from the specified image file without decompressing the image.
[in] | sid | Settings Collection ID. |
[in] | pFilename | Path of the image file. |
[out] | phPage | Pointer of a variable to store the handle of the page. |
[in] | nPage | The page number of the page to be loaded. |
RECERR |
HPAGE
does not contain decompressed bitmap. See the details about possible operations and their working in the documentation of DataStream. RECERR kRecLoadImgDataStreamF(int sid, string filename, out IntPtr phPage, int page);
RECERR RECAPIKRN kRecLoadImgDataStreamMC | ( | int | sid, |
BYTE * | lpBuf, | ||
size_t | bufLen, | ||
LPCOMPRESSED_IMG_INFO | lpCImg, | ||
HPAGE * | phPage | ||
) |
Loading a page directly from a compressed memory buffer without decompressing the image.
This function loads a page from the specified compressed memory buffer. The image is not decompressed during the operation, thus the resulted HPAGE contains a DataStream only.
[in] | sid | Settings Collection ID. |
[in] | lpBuf | Buffer of the compressed bitmap to be loaded. |
[in] | bufLen | Length of the buffer containing the compressed bitmap. |
[in] | lpCImg | Compressed image information of the image to be loaded. |
[out] | phPage | Pointer of a variable to store the handle of the page. |
RECERR |
HPAGE
does not contain decompressed bitmap. See the details about possible operations and their working in the documentation of DataStream. RECERR kRecLoadImgDataStreamMC(int sid, [In] byte[] lpBuf, [In] int bufLen, [In] COMPRESSED_IMG_INFO lpCImg, out IntPtr phPage);
Loading a page directly from an image file.
This function loads a page from the specified image file.
If the image source provides a gray-scale image, this function can convert it to B/W. If the image source provides a 24-bit color image, this function can convert it to gray-scale or B/W. The way this function handles the different image types (such as B/W, gray-scale or 24-bit color images) is called primary image conversion mode. The conversion mode to be applied can be set by the kRecSetImgConvMode API function. This function should also be used for subsequent access to pages of multi-page image files. The kRecLoadImgF function activates the PID_IMGINPUT process.
[in] | sid | Settings Collection ID. |
[in] | pFilename | Path of the image file. |
[out] | phPage | Pointer of a variable to store the handle of the page. |
[in] | nPage | The page number of the page to be loaded. |
RECERR |
phPage
output parameter contains a NULL value, the image has not been loaded into the Engine. If the function returns an error but phPage
is not NULL you may have a corrupted image loaded. It gives an IMG_DPI_WARN warning when the resolution is less than 75 DPI or greater than 2400 DPI, but of course the image is loaded and in this case it is not corrupted. It is strongly recommended to handle the return code of this function properly. RECERR kRecLoadImgF(int sid, string filename, out IntPtr phPage, int page);
RECERR RECAPIKRN kRecLoadImgM | ( | int | sid, |
BYTE * | lpBitmap, | ||
LPCIMG_INFO | lpImg, | ||
HPAGE * | phPage | ||
) |
Loading a page directly from a memory buffer.
This function loads a page from the specified memory buffer.
If the image source provides a gray-scale image, this function can convert it to B/W. If the image source provides a 24-bit color image, this function can convert it to gray-scale or B/W. The way this function handles the different image types (such as B/W, gray-scale or 24-bit color images) is called primary image conversion mode. The conversion mode to be applied can be set by the kRecSetImgConvMode API function. The kRecLoadImgM function activates the PID_IMGINPUT process.
[in] | sid | Settings Collection ID. |
[in] | lpBitmap | Buffer of the bitmap to be loaded. |
[in] | lpImg | Image information of the image to be loaded. |
[out] | phPage | Pointer of a variable to store the handle of the page. |
RECERR |
phPage
output parameter contains a NULL value, the image has not been loaded into the Engine. If the function returns an error but phPage
is not NULL you may have a corrupted image loaded. It gives an IMG_DPI_WARN warning when the resolution is less than 75 DPI or greater than 2400 DPI, but of course the image is loaded and in this case it is not corrupted. It is strongly recommended to handle the return code of this function properly. RECERR kRecLoadImgM(int sid, [In] byte[] lpBitmap, [In] IMG_INFO lpImg, out IntPtr phPage);
RECERR RECAPIKRN kRecLoadImgMC | ( | int | sid, |
BYTE * | lpBuf, | ||
size_t | bufLen, | ||
LPCCOMPRESSED_IMG_INFO | lpCImg, | ||
HPAGE * | phPage | ||
) |
Loading a page directly from a compressed memory buffer.
This function loads a page from the specified compressed memory buffer. It decompresses the compressed memory buffer and directly calls kRecLoadImgM to load the page. See kRecLoadImgM for more details!
[in] | sid | Settings Collection ID. |
[in] | lpBuf | Buffer of the compressed bitmap to be loaded. |
[in] | bufLen | Length of the buffer containing the compressed bitmap. |
[in] | lpCImg | Compressed image information of the image to be loaded. |
[out] | phPage | Pointer of a variable to store the handle of the page. |
RECERR |
RECERR kRecLoadImgMC(int sid, [In] byte[] lpBuf, [In] int bufLen, [In] COMPRESSED_IMG_INFO lpCImg, out IntPtr phPage);
RECERR RECAPIKRN kRecMatchImgFileFormat | ( | int | sid, |
HPAGE | hPage, | ||
IMAGEINDEX | iiImg, | ||
IMF_FORMAT | imgfileformat, | ||
INTBOOL * | match | ||
) |
Checking whether an image is suitable for a file format.
The kRecMatchImgFileFormat function checks whether the specified image can be saved in the specified image file format.
[in] | sid | Settings Collection ID. |
[in] | hPage | Handle of the page containing the image to be checked. |
[in] | iiImg | Index of the image to be checked. |
[in] | imgfileformat | Selected image file format. |
[out] | match | Address of a Boolean variable to get the information. The returned value of TRUE means that the selected image file format can be used on the image. |
RECERR |
RECERR kRecMatchImgFileFormat(int sid, IntPtr hPage, IMAGEINDEX iiImg, IMF_FORMAT imgfileformat, out bool match);
RECERR RECAPIKRN kRecOpenImgFile | ( | LPCTSTR | pFilename, |
HIMGFILE * | pHIMGFILE, | ||
int | mode, | ||
IMF_FORMAT | filetype | ||
) |
Opening an image file.
This function opens an image file into the image file management module. Loading an image requires an additional loading step (kRecLoadImg).
[in] | pFilename | File name of the image file. |
[out] | pHIMGFILE | Handle of the image file. |
[in] | mode | Opening mode. See IMGF_READ and IMGF_RDWR. |
[in] | filetype | Type of the created file. This parameter has meaning only when the opening mode is IMGF_RDWR. In this case, it means not the compression mode but the pure file type, for example, it determines that the file type is TIFF, but does not differentiate between FF_TIFG4 and FF_TIFLZW. The precise file format, including compression method, will be determined at saving time (e.g. kRecSaveImg, etc.) |
RECERR |
RECERR kRecOpenImgFile(string pFilename, out IntPtr pHIMGFILE, FILEOPENMODE mode, IMF_FORMAT filetype);
RECERR RECAPIKRN kRecPackImgFile | ( | int | sid, |
LPCTSTR | pFileName | ||
) |
Packing a TIFF file.
The kRecPackImgFile function packs the selected multi-page TIFF image file. It removes any previously deleted or replaced pages from the TIFF file.
[in] | sid | Settings Collection ID. |
[in] | pFileName | Name of the TIFF image file to be packed. |
RECERR |
RECERR kRecPackImgFile(int sid, string pFileName);
RECERR RECAPIKRN kRecReplaceImgFilePage | ( | int | sid, |
HIMGFILE | hIFileDst, | ||
int | ndstPage, | ||
HIMGFILE | hIFileSrc, | ||
int | nsrcPage | ||
) |
Replacing a page in a TIFF file.
The kRecReplaceImgFilePage function replaces a page in a destination multi-page TIFF image file by another page stored in a source TIFF image file.
[in] | sid | Settings Collection ID. |
[in] | hIFileDst | Handle of the destination image file to be changed. |
[in] | ndstPage | Page number of the page in the destination image file to be deleted and replaced. To replace the first page, the value zero (0) should be specified. |
[in] | hIFileSrc | Handle of the source image file. |
[in] | nsrcPage | Page number of the page in the source image file to be copied from. For a single-page source image file a value of zero (0) should be specified. |
RECERR |
RECERR kRecReplaceImgFilePage(int sid, IntPtr hIFileDst, int dstPage, IntPtr hIFileSrc, int nsrcPage);
RECERR RECAPIKRN kRecSaveImg | ( | int | sid, |
HIMGFILE | hIFile, | ||
IMF_FORMAT | Imgfileformat, | ||
HPAGE | hPage, | ||
IMAGEINDEX | iiImg, | ||
INTBOOL | bAppend | ||
) |
Saving a page.
The kRecSaveImg function stores the Engine's page to disk into an image file. The kRecSaveImg function activates the PID_IMGSAVE process.
[in] | sid | Settings Collection ID. |
[in] | hIFile | Handle of the image file opened for writing by kRecOpenImgFile. |
[in] | Imgfileformat | Image file format of the output file. |
[in] | hPage | Handle of the page containing the image to be saved. |
[in] | iiImg | Index of the image to be saved. |
[in] | bAppend | Flag for image append mode. Its TRUE value indicates that the image will be appended to the image file specified by hIFile , if it exists. Appending is successful only if the image file format supports multi-page image files. |
RECERR |
Imgfileformat
supports multi-page images kRecIsMultipageImgFileFormat can be called. hPage
contains DataStream this function may save the page without recompression. See the details in the section about DataStream. RECERR kRecSaveImg(int sid, IntPtr hIFile, IMF_FORMAT Imgfileformat, IntPtr hPage, IMAGEINDEX iiImg, bool bAppend);
RECERR RECAPIKRN kRecSaveImgArea | ( | int | sid, |
HIMGFILE | hIFile, | ||
IMF_FORMAT | format, | ||
HPAGE | hPage, | ||
IMAGEINDEX | iiImg, | ||
LPCRECT | pRect, | ||
INTBOOL | append | ||
) |
Saving an area of a page.
The kRecSaveImgArea function saves a rectangular area of the specified image of a page to an image file opened by kRecOpenImgFile. This function is derived from the kRecSaveImg function. The kRecSaveImgArea function activates the PID_IMGSAVE process.
[in] | sid | Settings Collection ID. |
[in] | hIFile | Handle of the image file opened for writing. |
[in] | format | Image file format for the output file. |
[in] | hPage | Handle of the page containing the image whose area will be saved. |
[in] | iiImg | Index of the image whose area will be saved. |
[in] | pRect | Pointer to the requested area of the image to be saved. If this parameter contains a NULL value, then the entire image will be saved. |
[in] | append | Flag for image append mode. Its TRUE value indicates that the current image will be appended to the given image file, if it exists. Appending is successful only if the specified image file format supports multi-page image files. |
RECERR |
format
supports multi-page images kRecIsMultipageImgFileFormat can be called. hPage
contains DataStream this function may save the page without recompression. See the details in the section about DataStream. RECERR kRecSaveImgArea(int sid, IntPtr hIFile, IMF_FORMAT Imgfileformat, IntPtr hPage, IMAGEINDEX img, RECT pRect, bool bAppend); // or RECERR kRecSaveImgArea(int sid, IntPtr hIFile, IMF_FORMAT Imgfileformat, IntPtr hPage, IMAGEINDEX img, bool bAppend); // pRect is NULL in C/C++
RECERR RECAPIKRN kRecSaveImgAreaF | ( | int | sid, |
LPCTSTR | pFilename, | ||
IMF_FORMAT | format, | ||
HPAGE | hPage, | ||
IMAGEINDEX | iiImg, | ||
LPCRECT | pRect, | ||
INTBOOL | append | ||
) |
Saving an area of a page directly into a file.
The kRecSaveImgAreaF function saves a rectangular area of the specified image of a page to an image file directly. This function is a derivative of the kRecSaveImgF function. The kRecSaveImgAreaF function activates the PID_IMGSAVE process.
[in] | sid | Settings Collection ID. |
[in] | pFilename | Name of the image file to be saved. |
[in] | format | Image file format for the output file. |
[in] | hPage | Handle of the page containing the image whose area will be saved. |
[in] | iiImg | Index of the image whose area will be saved. |
[in] | pRect | Pointer to the requested area of the image to be saved. If this parameter contains a NULL value, then the entire image will be saved. |
[in] | append | Flag for image append mode. Its TRUE value indicates that the current image will be appended to the given image file, if it exists. Appending is successful only if the specified image file format supports multi-page image files. |
RECERR |
format
supports multi-page images kRecIsMultipageImgFileFormat can be called. hPage
contains DataStream this function may save the page without recompression. See the details in the section about DataStream. RECERR kRecSaveImgAreaF(int sid, string pFilename, IMF_FORMAT Imgfileformat, IntPtr hPage, IMAGEINDEX img, RECT pRect, bool bAppend); // or RECERR kRecSaveImgAreaF(int sid, string pFilename, IMF_FORMAT Imgfileformat, IntPtr hPage, IMAGEINDEX img, bool bAppend); // pRect is NULL in C/C++
RECERR RECAPIKRN kRecSaveImgF | ( | int | sid, |
LPCTSTR | pFilename, | ||
IMF_FORMAT | Imgfileformat, | ||
HPAGE | hPage, | ||
IMAGEINDEX | img, | ||
INTBOOL | bAppend | ||
) |
Saving a page directly into a file.
The kRecSaveImgF function stores the Engine's page to disk into an image file directly. The kRecSaveImgF function activates the PID_IMGSAVE process.
[in] | sid | Settings Collection ID. |
[in] | pFilename | Name of the image file to be saved. |
[in] | Imgfileformat | Image file format of the output file. |
[in] | hPage | Handle of the page containing the image to be saved. |
[in] | img | Index of the image to be saved. |
[in] | bAppend | Flag for image append mode. Its TRUE value indicates that the image will be appended to the image file specified by pFilename , if it exists. Appending is successful only if the image file format supports multi-page image files. |
RECERR |
Imgfileformat
supports multi-page images kRecIsMultipageImgFileFormat can be called. hPage
contains DataStream this function may save the page without recompression. See the details in the section about DataStream. RECERR kRecSaveImgF(int sid, string pFilename, IMF_FORMAT Imgfileformat, IntPtr hPage, IMAGEINDEX img, bool bAppend);
RECERR RECAPIKRN kRecSaveImgForce | ( | int | sid, |
HIMGFILE | hIFile, | ||
IMF_FORMAT | Imgfileformat, | ||
HPAGE | hPage, | ||
IMAGEINDEX | iiImg, | ||
INTBOOL | bAppend | ||
) |
Saving a page with forcing the format.
The kRecSaveImgForce function stores the Engine's page to disk into an image file. When the selected image cannot be saved into the specified format the image is converted to one that can receive it. The kRecSaveImgForce function activates the PID_IMGSAVE process.
[in] | sid | Settings Collection ID. |
[in] | hIFile | Handle of the image file opened for writing by kRecOpenImgFile. |
[in] | Imgfileformat | Image file format of the output file. |
[in] | hPage | Handle of the page containing the image to be saved. |
[in] | iiImg | Index of the image to be saved. |
[in] | bAppend | Flag for image append mode. Its TRUE value indicates that the image will be appended to the image file specified by hIFile , if it exists. Appending is successful only if the image file format supports multi-page image files. |
RECERR |
Imgfileformat
supports multi-page images kRecIsMultipageImgFileFormat can be called. hPage
contains DataStream this function may save the page without recompression. See the details in the section about DataStream. RECERR kRecSaveImgForce(int sid, IntPtr hIFile, IMF_FORMAT Imgfileformat, IntPtr hPage, IMAGEINDEX iiImg, bool bAppend);
RECERR RECAPIKRN kRecSaveImgForceF | ( | int | sid, |
LPCTSTR | pFilename, | ||
IMF_FORMAT | Imgfileformat, | ||
HPAGE | hPage, | ||
IMAGEINDEX | iiImg, | ||
INTBOOL | bAppend | ||
) |
Saving a page directly into a file with forcing of the format.
The kRecSaveImgForceF function stores the Engine's page to disk into an image file. When the selected image cannot be saved into the specified format the image is converted to another similar one that can receive it. The kRecSaveImgForceF function activates the PID_IMGSAVE process.
[in] | sid | Settings Collection ID. |
[in] | pFilename | Name of the image file to be saved. |
[in] | Imgfileformat | Image file format of the output file. |
[in] | hPage | Handle of the page containing the image to be saved. |
[in] | iiImg | Index of the image to be saved. |
[in] | bAppend | Flag for image append mode. Its TRUE value indicates that the image will be appended to the image file specified by pFilename , if it exists. Appending is successful only if the image file format supports multi-page image files. |
RECERR |
Imgfileformat
supports multi-page images kRecIsMultipageImgFileFormat can be called. hPage
contains DataStream this function may save the page without recompression. See the details in the section about DataStream. RECERR kRecSaveImgForceF(int sid, string pFilename, IMF_FORMAT Imgfileformat, IntPtr hPage, IMAGEINDEX img, bool bAppend);
RECERR RECAPIKRN kRecSetCompressionLevel | ( | int | sid, |
int | CompressionLevel | ||
) |
Setting the compression level.
This function specifies the compression level used when an image is saved to specific formats.
[in] | sid | Settings Collection ID. |
[in] | CompressionLevel | The compression level to be set. This may be a value between 1 and 5, or 0. 0 means custom level, otherwise higher value means weaker compression. The default level is 3. |
RECERR |
RECERR kRecSetCompressionLevel(int sid, int CompressionLevel);
RECERR RECAPIKRN kRecSetCompressionTradeoff | ( | int | sid, |
COMPRESSION_TRADEOFF | CompressionTradeoff | ||
) |
Setting the compression trade-off.
This function specifies the compression trade-off used when an image is saved to specific formats.
[in] | sid | Settings Collection ID. |
[in] | CompressionTradeoff | The compression tradeoff to be set. This may be COMPRESSION_FAST and COMPRESSION_ADVANCED (default). |
RECERR |
RECERR kRecSetCompressionTradeoff(int sid, COMPRESSION_TRADEOFF CompressionTradeoff);
RECERR RECAPIKRN kRecSetImfLoadFlags | ( | int | sid, |
DWORD | fFlag | ||
) |
Setting IMF PDF load flags.
The kRecSetImfLoadFlags function set an IMF Load Flags combination
[in] | sid | Settings Collection ID. |
[in] | fFlag | The IMF PDF Load Flag combination. See the possible bits. |
RECERR |
IMF_PDF_AS_IMAGE
is switched on! RECERR kRecSetImfLoadFlags(int sid, uint fFlag);
RECERR RECAPIKRN kRecSetJPGQuality | ( | int | sid, |
int | nQuality | ||
) |
Setting JPEG quality.
This function changes the JPEG quality setting used when saving images into JPEG or JPEG2000 files.
[in] | sid | Settings Collection ID. |
[in] | nQuality | JPEG quality to be set. This may be a value between 1 and 100, or -1 (default, see notes). |
RECERR |
The
best quality can be achieved by setting Kernel.Imf.CompressionLevel = 0 and Kernel.Imf.JPG.Quality = 100. In this case FF_JPG2K applies lossless compression, FF_JPG has some negligible loss.SUPERB
, LOSSLESS
, GOOD
and MIN
). FF_JPG_SUPERB
and FF_JPG2K_SUPERB has some negligible loss.RECERR kRecSetJPGQuality(int sid, int nQuality);
RECERR RECAPIKRN kRecSetMRCCompressionSettingsFromLevel | ( | int | sid, |
int | CompressionLevel, | ||
COMPRESSION_TRADEOFF | CompressionTradeOff | ||
) |
Modifying the MRC settings according to the given compression level and tradeoff.
This function can be used to set customized PDF MRC parameters. See notes below for the list of the modified settings.
[in] | sid | Settings Collection ID. |
[in] | CompressionLevel | The compression level between 1 and 5. |
[in] | CompressionTradeOff | The compression trade-off. |
RECERR |
Kernel.Imf.PDF.MRC.BGLayer.JPGQuality
is 55 by default. However the code wants to use 30: rc = kRecSetCompressionLevel(sid, 0); // using the customized values rc = kRecSetMRCCompressionSettingsFromLevel(sid, 3, COMPRESSION_ADVANCED); HSETTING hset; kRecSettingGetHandle(NULL, "Kernel.Imf.PDF.MRC.BGLayer.JPGQuality", &hset, NULL); kRecSettingSetInt(0, hset, 30); rc = kRecSaveImgF(sid, pFilename, FF_PDF_MRC, hPage, II_CURRENT, bAppend);
RECERR kRecSetMRCCompressionSettingsFromLevel(int sid, int CompressionLevel, COMPRESSION_TRADEOFF CompressionTradeOff);
Setting PDF password.
This function sets the password for a PDF file opened by kRecOpenImgFile. To learn whether a password is required for processing the PDF kRecGetPDFEncLevel can be called. kRecSetPdfPasswordA
supposes the password to be in the current system code page. Thus we suggest to use kRecSetPdfPasswordW
.
[in] | hIFile | Handle of the image file. |
[in] | pwd | Password. |
RECERR |
RECERR kRecSetPdfPassword(IntPtr hIFile, string pwd);
RECERR RECAPIKRN kRecSetPdfTagInfo | ( | int | sid, |
INTBOOL | bUseTagInfo | ||
) |
Setting use of PDF tag information.
This function sets whether the Engine uses the tag information of the PDF file or not.
[in] | sid | Settings Collection ID. |
[in] | bUseTagInfo | Use of tag information. If it is TRUE the tag information is used. |
RECERR |
RECERR kRecSetPdfTagInfo(int sid, bool bUseTagInfo);
RECERR RECAPIKRN kRecUpdateImgFilePage | ( | int | sid, |
HPAGE | hPage, | ||
IMAGEINDEX | iiImg, | ||
HIMGFILE | hIFile, | ||
int | nPage, | ||
IMF_FORMAT | format | ||
) |
Replacing a page in a TIFF file.
The kRecUpdateImgFilePage function replaces a page in a multi-page TIFF image file with a different image taken from the image management module.
[in] | sid | Settings Collection ID. |
[in] | hPage | Handle of the page containing the image to be inserted. |
[in] | iiImg | Index of the image to be inserted. |
[in] | hIFile | Handle of the multi-page TIFF image file. |
[in] | nPage | Page number of the page in the image file to be deleted and replaced. To replace the first page in the image file, the value zero (0) should be specified. |
[in] | format | Image file format (compression) to be applied during the page replacement. Of course, only TIFF formats can be selected. |
RECERR |
RECERR kRecUpdateImgFilePage(int sid, IntPtr hPage, IMAGEINDEX iiImg, IntPtr hIFile, int nPage, IMF_FORMAT format);