RecAPI
|
Supporting different image file formats. More...
Typedefs | |
typedef struct tagIMGFILEHANDLE * | HIMGFILE |
Handle of image files. | |
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 and specify the elements of the PDF to be rendered onto the II_ORIGINAL image of the HPAGE at loading.
| |
#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 v2025.1 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 are no module-specific limits to image size (measured in inches or centimeters). The available memory, the computing environment, and properties of individual image files all influence the size limits for successful image processing.
However, there are lower and upper limits for the size of the images (both for height and width) measured in pixels. By default, the Engine handles images at most 8400 pixels in height and width. The Engine refuses to load an image exceeding this limit, and the loading function will return with IMG_SIZE_ERR (Error string: "Non-supported image size.").
The image size limits are determined by the following Engine settings:
Nevertheless, certain CSDK image processing functions, such as kRecPreprocessImg, kRecLocateZones, and kRecRecognize might have other image size-related limits, and exceeding those can cause the operation to fail (IMG_SIZE_ERR).
Thus, increasing the image size limit settings may enable to loadi of larger images, but may cause errors in further processing. The default limit of 8400 pixels was determined so that any workflow may complete safely and successfully, without image size issues. Using the default value protects high-volume unattended processing from the use of high resources.
Notes
*.rtf
, *.docx
, or *.pptx
files with CSDK’s layout retention output options Flowing Page or True Page. These options are retaining the original page size and layout. Exceeding this Microsoft Office software limitation results in an error, and the output file is not created.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 2025.1 the following image formats were introduced (supported on: Windows, Linux, Embedded Linux, MacOS):
Note: The newer ones can be used with 5 different predefined levels (1-5) by calling kRecSetCompressionLevel. See the Tungsten Omnipage Capture SDK User's Guide for more details, in the Imaging Module, MRC image compression level comparison subsection.
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).
Furthermore, there is a customization possibility for manual tuning of quality with compression level 0.
The kRecSetCompressionLevel and kRecSetCompressionTradeoff affect both the FF_PDF_MRC and the DTXT_IOTPDF_MRC pdf file types.
We recommend using the new MRC level feature, although the older formats mentioned can still be used. (We do not know how long we will support these.)
The older formats provided 3 predefined levels (MIN:
Level=1, GOOD:
Level=3, SUPERB:
Level=5). The older levels can be reproduced by newer ones if the trade-off is COMPRESSION_ADVANCED:
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 new MRC level compression uses the following new settings (see detailed descriptions):
These are new setings, only effective for new level 5:
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.
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:
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. JBIG2 is a very efficient compression method for black-and-white images. It generally produces better results with smaller compressed data sizes than the well-known G4 compression. The unique feature of JBIG2 is that it can be both lossless and lossy.
In CSDK, data compressed using the JBIG2 method can occur as stand-alone files (see FF_JBIG2_LOSSLESS and FF_JBIG2_LOSSY) or embedded data in PDF files. PDF files may contain streams representing black and white images or masks in MRC compressed colour images.
The JBIG2 format may contain several compression methods:
The result of lossy compression is significantly smaller in most cases than the result of lossless.
As with all lossy compression, JBIG2 symbol encoding may confuse some parts of the resulted compressed image with other ones, in some extreme cases. The probability of such an issue is extremely small, but not zero. To eliminate this small probability of a "wrong" result, the CSDK does not write lossy JBIG2 by default either into stand-alone files or PDF's, even if FF_JBIG2_LOSSY
format is chosen.
It is possible to enable lossy compression by setting Kernel.IMF.JBIG2.ForceLosslessMode to 0. For all other values of this variable, lossless compression is obtained.
The exact operation of JBIG2 compression is determined by the use case itself (such as the output format, the settings of the PDF conversion) and certain JBIG2 settings. The main setting is Kernel.IMF.JBIG2.ForceLosslessMode
. If its value is 0
, it enables the use of both lossless and lossy algorithms of JBIG2 (determined by the use case). In all the other cases, only lossless conversion types are available, even if the FF_JBIG2_LOSSY
format is selected.
Type of lossless conversions:
If the value of ForceLosslessMode
is -1
, the setting Kernel.IMF.JBIG2.DefaultLosslessMode
selects from the above types.
If the conversion decides to use a lossy method, the setting Kernel.IMF.JBIG2.LossyMode
selects from the following types of lossy conversions:
Some other settings can adjust the conversion. See them in the list of JBIG2 settings.
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.
Enumerator | |
---|---|
COMPRESSION_ADVANCED | Use advanced but slower method (default). |
COMPRESSION_FAST | Use fast compression method. |
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.Enumerator | |
---|---|
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, MacOS. |
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, MacOS. |
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, MacOS. |
FF_PDF_SUPERB | Deprecated (see usage of new formats). Adobe PDF format with negligible information loss. Supported on: Windows, Linux, Embedded Linux, MacOS. |
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, MacOS. |
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, MacOS. |
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, MacOS. |
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. The OPG file contains all members of the |
FF_PDF | Adobe PDF format with changeable compression level (see usage of Saving MRC PDF files in KernelAPI PDF Output in KernelAPI). Supported on: Windows, Linux, Embedded Linux, MacOS. |
FF_PDF_MRC | Adobe PDF format using MRC technology with changeable compression level (see usage of Saving MRC PDF files in KernelAPI PDF Output in KernelAPI). Supported on: Windows, Linux, Embedded Linux, MacOS. |
FF_JPG | JPEG format with changeable compression level (see usage of new formats). Supported on: Windows, Linux, Embedded Linux, MacOS. |
FF_JPG2K | JPEG2000 file format with changeable compression level (see usage of new formats). Supported on: Windows, Linux, Embedded Linux, MacOS. |
FF_TIF | TIF file format with changeable compression and compression level (see usage of new formats). Supported on: Windows, Linux, Embedded Linux, MacOS. |
FF_SIZE | Number of supported image file formats. |
enum IMF_IMAGEQUALITY |
Image quality (for DTXT PDF output)
Deprecated. This enum gives the possible values of Kernel.DTxt.PDF.BWQuality and ...ColorQuality. For details see the section about newer image formats.
Enumerator | |
---|---|
IMF_IMAGEQUALITY_MIN | Minimal size, lowest quality. |
IMF_IMAGEQUALITY_GOOD | Medium size, good quality. |
IMF_IMAGEQUALITY_SUPERB | Large size, best quality. |
enum IMF_MRCLEVEL |
MRC level (for DTXT PDF output)
Deprecated. This enum gives the possible values of the setting Kernel.DTxt.PDF.UseMRC, which determines the MRC method used for DTXT PDF output. For details see the section about newer image formats.
Enumerator | |
---|---|
IMF_MRCLEVEL_NO | Do not use MRC. |
IMF_MRCLEVEL_MIN | Minimal size, lowest quality. |
IMF_MRCLEVEL_GOOD | Medium size, good quality. |
IMF_MRCLEVEL_SUPERB | Large size, best quality. |
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 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 |
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. 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 |
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 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 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 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 |
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 |
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 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 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 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 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 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 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 |
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. :
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. 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 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. |
[out] | 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. 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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: 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 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 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 |