| This section describes the sdk interfaces detailedly. |
| Function |
| 1. function---oakBegin() |
| |
This function create a instance and return the converter's handle. |
| |
If the function succeeds, it returns a converter's handle. If the function fail, it returns a error code, for more error codes, please click here. |
| |
This function close the instance and destroy the converter appointed by the handle. |
| |
void oakEnd(long nHandle); |
| 。 |
nHandle: A handle of the converter, which created by function---oakBegin. |
| 3. function---oakExport() |
| |
This function start converting. |
| |
long oakExport(long nHandle); |
| 。 |
nHandle: A handle of the converter, which created by function---oakBegin. |
| |
|
| |
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
| 4. function---oakSetOption() |
| |
This function is to set the converter's properties, which created by function---oakBegin. |
| |
long oakSetOption( long nHandle,
long nIndex,
long nValue1,
long nValue2,
char* pValue1,
char* pValue2); |
| 。 |
nHandle: A handle of the converter, which created by function---oakBegin. |
| 。 |
nIndex: Property tag, refer to the section of definitions of oakSetOption properties. |
| 。 |
nValue1: An integer value of the property. |
| 。 |
nValue2: An integer value of the property. |
| 。 |
pValue1: A String value of the property. |
| 。 |
pValue:2 A String value of the property. |
| |
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
| 5. function---oakGetOption() -- none properties for the moment |
| |
This function is to get the converter's properties, which created by function---oakBegin. |
| |
long oakGetOption( long nHandle,
long nIndex,
long nValue1,
long nValue2,
char* pValue1,
char* pValue2); |
| (2) Parameters --- refer to oakSetOption. |
| (3) Return value --- refer to oakSetOption. |
|
| This section describes the properties of the functions oakSetOption and oakGetOption detailedly. |
| 1. Property OAK_Set_Output |
| |
This property can be using to set destination pdf files(Supports absolute path and relative path).
The paramater pValue1 is the output file.
Note:if the settings more than once, the last setting is comfirmed. |
| 2. Property OAK_Set_Input |
| |
This property can be using to set source ps/eps files(Supports absolute path and relative path).
The paramater pValue1 is the input file.
|
| 3. Property OAK_Set_Color |
| |
This property gets or sets the color depth of an image.
The component supports the following color depths,default is 24.
| 。 |
1: black/white image. |
| 。 |
4: 16 colors image. |
| 。 |
8: 256 colors image. |
| 。 |
24: true color image. |
| 。 |
7: grayscale 256 colors image. |
|
| |
This property gets or sets the horizontal and vertical resolution of the image.
The component supports the resolution from 72 to 1200, defualt is 150. |
| 5. Property OAK_Set_Compress |
| |
This property can be used to get or set the compression type.The supported value of compression are listed below(supported color depths in brackets):
| Constant Name |
Value |
Description |
| OAK_COMPRESSION_NONE |
1 |
No compression(1-bit, 4-bits, 8-bits, 24-bits) |
| OAK_COMPRESSION_RLE |
2 |
RLE compression(1-bit) |
| OAK_COMPRESSION_G3 |
3 |
CCITT Group 3 compression(1-bit) |
| OAK_COMPRESSION_G4 |
4 |
CCITT Group 4 compression(1-bit) |
| OAK_COMPRESSION_LZW |
5 |
Lzw compression(1-bit, 4-bits, 8-bits, 24-bits) |
| OAK_COMPRESSION_JPEG |
6 |
Jpeg compression(8-bits grayscale, 24-bits) |
| OAK_COMPRESSION_PACKBITS |
7 |
Packbits compression(4-bits, 8-bits, 24-bits) |
Default is no compression. |
| 6. Property OAK_Set_Quality |
| |
This property gets or sets the compression quality(1..100) for lossy compression types. Default is 75. |
|
| 1. Definitions of oakSetOption's properties |
| |
| Name |
Value |
Type |
Description |
| OAK_Set_Input |
5301 |
string |
Source ps/eps file(Supports absolute path and relative path). |
| OAK_Set_Output |
5302 |
string |
Destination image file(Supports absolute path and relative path). |
| OAK_Set_Color |
5309 |
integer |
Color depth of destination image. |
| OAK_Set_DPI |
5310 |
integer |
Resolution of destination image. |
| OAK_Set_Compress |
5311 |
integer |
Type of compression of destination image. |
| OAK_Set_Quality |
5312 |
integer |
Jpeg compression quality. |
Notice: For more detial properties, please click here. |
| |
|
| 2. Return code's definitions |
| |
| Name |
Value |
Description |
| RTN_OK |
1 |
Operation success. |
| RTN_FAILURE |
0 |
Operation failure. |
| RTN_ERR_NONE_OUTPUT |
-1 |
Destination file unspecified. |
| RTN_ERR_NONE_INPUT |
-2 |
Source file unspecified. |
| RTN_ERR_INVALID_HANDLE |
-3 |
Invalid converter handle. |
| RTN_ERR_MEMORY |
-4 |
Memory operation failure. |
| RTN_ERR_INVALID_FORMAT |
-5 |
Invalid format of destination file. |
|
| |
|
|
|