Programmer's Reference previous  top  next 
This section describes the sdk interfaces detailedly.
 
Function
Properties
Constants


 Function
 1. function---oakBegin()
     This function create a instance and return the converter's handle.
    (1) Syntax
  long oakBegin(void);
    (2) Parameters
  NULL
   
    (3) Return value
  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.
   
   
 
 2. function---oakEnd()
     This function close the instance and destroy the converter appointed by the handle.
    (1) Syntax
  void oakEnd(long nHandle);
    (2) Parameters
nHandle:  The converter's handle, which created by function---oakBegin.
    (3) Return value
  NULL
 
 
 
 3. function---oakExport()
     This function start converting.
    (1) Syntax
  long oakExport(long nHandle);
    (2) Parameters
nHandle:  The converter's handle, which created by function---oakBegin.
   
    (3) Return value
  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.
    (1) Syntax
  long oakSetOption( long nHandle,
                                        long nIndex,
                                        long nValue1,
                                        long nValue2,
                                        char* pValue1,
                                        char* pValue2);
    (2) Parameters
nHandle:  The converter's handle, 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.
    (3) Return value
  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.
    (1) Syntax
  long oakGetOption( long nHandle,
                                        long nIndex,
                                        long nValue1,
                                        long nValue2,
                                        char* pValue3,
                                        char* pValue4);
 
 
 
 Properties
This section describes the properties of the function oakSetOption detailedly.
 

 

 1. Property OAK_Set_Output
  This property can be using to set the output file .
The paramater nValue1 is file type's definitions.
The paramater nValue2 is multi-page tag, eg. 1 = multi-page TIFF , 0 = single-pageTIFF.
The paramater pValue3 is the output file.
Note:if setting more than once, comfirmed to the last set.
 
 2. Property OAK_Set_Input
  This property can be using to set the input file .
The paramater pValue3 is the input file.
 
 
 4. Property OAK_Set_ColorDepth
  This property sets the color depth of an image.
The paramater nValue1 is the color depth.
The component supports the following color depths,default is 24.
1:    black/white image.
4:    16 colors image.
7:    256 grayscale image.
8:    256 colors image.
24:   true color image.
 
 5. Property OAK_Set_DPI
  This property sets the horizontal and vertical resolution of the image.
The component supports the resolution from 72 to 600, defualt is 150.
The paramater nValue1 is xDPI.
The paramater nValue2 is yDPI.
 
 
 
 9. Property OAK_Set_Compression
  Only the current output images are tiff format, this property is valid, the property can be used to set the compression tag. The supported value of iCompression are listed here.
  Default is no compression.
The paramater nValue1 is compression tag.
 
 10. Property OAK_Set_Quality
  This property sets the compression quality(1..100) for lossy compression types. Default is 75.
The paramater nValue1 is quality.
 
 
 
 
 
 
 
 
Constants
 
 1. Definitions of oakSetOption's properties
  (1) properties
Name Value Type Description
OAK_Set_Output 2101 string Destination file.
OAK_Set_Input 2102 string Input file.
OAK_Set_DPI 2103 integer Horizontal and Vertical resolution.
OAK_Set_ColorDepth 2104 integer Color bits per pixel(1bit,4bits,8-bits grayscal,8bits,24bits).
OAK_Set_Compression 2108 integer TIFF compression mode.
OAK_Set_Quality 2109 integer JPEG compression quality(0-100).


Notice: For more detial properties, please click here.

 2. TIFF compression tag's definitions(supported color depths in brackets)
 
 
Name Value Description
OAK_COMPRESSION_NONE 1 No compression(1-bit, 4-bits, 8-bits grayscal, 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 grayscal, 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 grayscal, 8-bits, 24-bits)

 

 3. Return code's definitions
 
 
Name Value Description
RTN_OK 1 Successful operation.
RTN_ERROR1 0 convert fail.
RTN_ERROR2 -1 have not set the output file name.
RTN_ERROR3 -2 have not indicate the input file name.
RTN_ERROR4 -3 invalid instance object number.
     
 
 
 4. File type's definitions
 
 
Name Value Description
OAK_FILE_TIF 105 The file is tiff format
OAK_FILE_JPG 106 The file is jpeg format
OAK_FILE_BMP 107 The file is bmp format
OAK_FILE_GIF 108 The file is gif format
OAK_FILE_PCX 109 The file is pcx format
OAK_FILE_PNG 110 The file is png format
OAK_FILE_EMF 111 The file is emf format
OAK_FILE_WMF 112 The file is wmf format
 
 
 
 


http://www.oakdoc.com  
Copyright 2008 by OakDoc Technology, Inc. All rights reserved.