This section describes client sdk interfaces detailedly. |
|
This function opens a pdf file, if the pdf file is restricted, you can ensure owner password or user password. After it opens success, it will create a converter and return the converter's handle. |
|
long oakBegin(char *pPdfFileName, char *pOwnerPw, char *pUserPw); |
。 |
pPdfFileName: Source pdf file name. It supports absolute path and relative path. |
。 |
pOwnerPw: Pdf owner password. |
。 |
pUserPw: Pdf user password. |
|
If the function succeeds, it returns a converter's handle. If the function fail, it returns a error code, such as the following, for more error codes, please click here. |
|
ERR_OVER_MAXTHREADS : Over the limit amount of threads. |
|
ERR_FILE_UNEXIST : Source pdf file unexist. |
|
ERR_FILE_DAMAGED : Source pdf file is damaged, or not a correct pdf file. |
|
ERR_FILE_RESTRICTED : Source pdf file is restricted, such as password is wrong etc. |
|
This function close the pdf file and destroy the converter appointed by the handle. |
|
long oakEnd(long nHandle); |
。 |
nHandle: The converter's handle, 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---oakExport() |
|
This function converts a certain page of the pdf file, the page appointed by the second parameter---nPageNo. |
|
long oakExport(long nHandle,long nPageNo); |
。 |
nHandle: The converter's handle, which created by function---oakBegin. |
。 |
nPageNo: A certain page of the pdf file, which will be converted. |
|
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
|
This function is to set the converter's properties, which created by function---oakBegin. |
|
long oakSetup( long nHandle,
long nIndex,
char *pValue,
long nValue,
long nOther); |
。 |
nHandle: The converter's handle, which created by function---oakBegin. |
。 |
nIndex: Property tag, refer to the section of definitions of converter's properties. |
。 |
pValue: A String value of the property. This parameter is valid only just the type of the current property is string. |
。 |
nValue: An integer value of the property. This parameter is valid only just the type of the current property is integer. |
。 |
nOther: Only valid for progress call-back. It is used to call-back function as a parameter value. |
|
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
6. function---oakGetPageTotal() |
|
This function is to get the number of pages in the PDF document. |
|
long oakGetPageTotal( long nHandle, long &nValue); |
。 |
nHandle: The converter's handle, which created by function---oakBegin. |
。 |
nValue: it returns the number of pages in the PDF document. |
|
It returns RTN_OK, the function succeeds, otherwise the function fails. For more error codes, please click here. |
|
This section describes the properties of the converter detailedly. |
1. Property oak_PROP_OUTDIR |
|
This property can be using to set output directory which the result image files placed in. Default the output directory as same path as the source PDF document. |
2. Property oak_PROP_PREFIX |
|
This property can be using to set the prefix of file name of the result image.
For example, the file name of source pdf is 'test.pdf', you set the image type as 'JPEG' format and the value of this property as 'mytest', so the file name of result image are 'mytest00001.jpg', 'mytest00002.jpg',...,'mytest00XXX.jpg', etc. |
3. Property oak_PROP_PAGEZOOM |
|
Th property can be using to set zoom scale of PDF pages(10-200).
For example, if it sets the page zoom as 120 or 80 and the result image is a 800x600 pixel, so the final result image is a 960x720 pixel or 640x480 pixel image.
Default page zoom is 100. |
4. Property oak_PROP_IMAGETYPE |
|
This property can be using to set the result image type. The supported image formats are listed below: |
|
Constant Name |
Value |
Description |
oak_IMAGE_BMP |
1 |
BMP fromat image. |
oak_IMAGE_EMF |
2 |
EMF fromat image. |
oak_IMAGE_WMF |
3 |
WMF fromat image. |
oak_IMAGE_JPG |
4 |
JPG/JPEG fromat image. |
oak_IMAGE_PNG |
5 |
PNG fromat image. |
oak_IMAGE_GIF |
6 |
GIF fromat image. |
oak_IMAGE_TIF |
7 |
TIF/TIFF fromat image. |
oak_IMAGE_PCX |
8 |
PCX fromat image. |
oak_IMAGE_JPEG |
4 |
JPG/JPEG fromat image. |
oak_IMAGE_TIFF |
7 |
TIF/TIFF fromat image. |
Default is JPG/JPEG format image. |
5. Property oak_PROP_BITCOUNT |
|
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. |
6. Property oak_PROP_XDPI |
|
This property gets or sets the horizontal resolution of the image.
The component supports the resolution from 72 to 500, defualt is 120. |
7. Property oak_PROP_YDPI |
|
This property gets or sets the vertical resolution of the image.
The component supports the resolution from 72 to 500, defualt is 120. |
8. Property oak_PROP_XDIMENSIONS |
|
This property can be used to specify the width of the final result image in pixel. |
9. Property oak_PROP_YDIMENSIONS |
|
This property can be used to specify the height of the final result image in pixel. |
10. Property oak_PROP_COMPRESSION |
|
Only the current output images are tiff format, this property is valid, the property can be used to get or set the compression type. The supported value of iCompression are listed below(supported color depths in brackets): |
|
Constant Name |
Value |
Description |
oak_TIFF_COMPRESSION_NONE |
0 |
No compression(1-bit, 4-bits, 8-bits, 24-bits) |
oak_TIFF_COMPRESSION_LZW |
1 |
Lzw compression(1-bit, 4-bits, 8-bits, 24-bits) |
oak_TIFF_COMPRESSION_JPEG |
2 |
Jpeg compression(8-bits grayscale, 24-bits) |
oak_TIFF_COMPRESSION_PACKBITS |
3 |
Packbits compression(4-bits, 8-bits, 24-bits) |
oak_TIFF_COMPRESSION_CCITTG4 |
4 |
CCITT Group 4 compression(1-bit) |
oak_TIFF_COMPRESSION_CCITTG3 |
5 |
CCITT Group 3 compression(1-bit) |
oak_TIFF_COMPRESSION_RLE |
6 |
RLE compression(1-bit) |
Default is no compression. |
11. Property oak_PROP_QUALITY |
|
This property gets or sets the compression quality(1..100) for lossy compression types. Default is 75. |
12. Property oak_PROP_GRAYSCALE |
|
This property can be using to set grayscale image. |
。 |
TRUE(1): It is to set grayscale image. |
。 |
FALSE(0): It is to set non-grayscale image. |
13. Property oak_PROP_MULTIPAGES |
|
This property can be using to set multipages tiff files. |
。 |
TRUE(1): It is to set multipages tiff files. |
。 |
FALSE(0): It is to set general tiff files. |
14. Property oak_PROP_PAGECOUNT |
|
This property can be using to get the number of pages in the PDF document. |
17. Property oak_PROP_PROGRESSFUNC |
|
Address of the progress call-back function. |
|
1. Definitions of converter's properties |
|
(1) properties
Name |
Value |
Type |
Description |
oak_PROP_OUTDIR |
1 |
string |
Destination directory. |
oak_PROP_PREFIX |
2 |
string |
The prefix of the name of result image file. |
oak_PROP_PAGEZOOM |
3 |
integer |
Zoom scale of the source pdf page(10-200%). |
oak_PROP_BGCOLOR |
4 |
integer |
Image background color. |
oak_PROP_IMAGETYPE |
5 |
integer |
Result image format. |
oak_PROP_BITCOUNT |
6 |
integer |
Color bits per pixel(1bit,4bits,8bits,24bits). |
oak_PROP_XDPI |
7 |
integer |
Horizontal resolution. |
oak_PROP_YDPI |
8 |
integer |
Vertical resolution. |
oak_PROP_QUALITY |
9 |
integer |
JPEG compression quality(0-100). |
oak_PROP_COMPRESSION |
10 |
integer |
TIFF compression mode. |
oak_PROP_MULTIPAGES |
11 |
integer |
Multipages TIFF file. |
oak_PROP_GRAYSCALE |
12 |
integer |
Grayscale image. |
oak_PROP_XDIMENSIONS |
13 |
integer |
The width of the result image in pixel. |
oak_PROP_YDIMENSIONS |
14 |
integer |
The height of the result image in pixel. |
(2) properties
Name |
Value |
Type |
Description |
oak_PROP_PROGRESSFUNC |
40 |
integer |
Address of the progress call-back function. |
Notice: For more detial properties, please click here. |
2. TIFF compression tag's definitions(supported color depths in brackets) |
|
Name |
Value |
Description |
oak_TIFF_COMPRESSION_NONE |
0 |
No compression(1-bit, 4-bits, 8-bits, 24-bits) |
oak_TIFF_COMPRESSION_LZW |
1 |
Lzw compression(1-bit, 4-bits, 8-bits, 24-bits) |
oak_TIFF_COMPRESSION_JPEG |
2 |
Jpeg compression(8-bits grayscale, 24-bits) |
oak_TIFF_COMPRESSION_PACKBITS |
3 |
Packbits compression(4-bits, 8-bits, 24-bits) |
oak_TIFF_COMPRESSION_CCITTG4 |
4 |
CCITT Group 4 compression(1-bit) |
oak_TIFF_COMPRESSION_CCITTG3 |
5 |
CCITT Group 3 compression(1-bit) |
oak_TIFF_COMPRESSION_RLE |
6 |
RLE compression(1-bit) |
|
3. Image type's definitions |
|
Name |
Value |
Description |
oak_IMAGE_BMP |
1 |
Bmp image. |
oak_IMAGE_EMF |
2 |
Emf image. |
oak_IMAGE_WMF |
3 |
Wmf image. |
oak_IMAGE_JPG |
4 |
Jpg/Jpeg image. |
oak_IMAGE_PNG |
5 |
Png image. |
oak_IMAGE_GIF |
6 |
Gif image. |
oak_IMAGE_TIF |
7 |
Tif/Tiff image. |
oak_IMAGE_PCX |
8 |
Pcx image. |
|
|
|
oak_IMAGE_JPEG |
4 |
Jpg/Jpeg image. |
oak_IMAGE_TIFF |
7 |
Tif/Tiff image. |
|
4. Return code's definitions |
|
Name |
Value |
Description |
RTN_OK |
1 |
Successful operation. |
ERR_FILE_UNEXIST |
-2 |
Source PDF file unexist. |
ERR_FILE_DAMAGED |
-3 |
Source PDF file is damaged. |
ERR_FILE_RESTRICTED |
-4 |
Source PDF file is restricted. |
ERR_INVALID_PAGE |
-5 |
Invalid page of the source pdf. |
ERR_CONVERT_FAILURE |
-8 |
Conversion failure. |
ERR_INVALID_HANDLE |
-10 |
Invalid converter's handle. |
ERR_UNKNOWN |
-99 |
Unknown system error. |
|
|
|