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.
pValue2: 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 to set outputting format(PDF document and raster images) . For more, please click here.
The paramater pValue3 is the output filename.
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.
 
 3. Property OAK_Set_DPI
  This property sets images and graphics elements of pdf.
The paramater nValue1 is to set horizontal resolution.
The paramater nValue2 is to set vertical resolution.
Notes: The component supports the resolution from 72dpi to 600dpi, defualt is 150dpi.
 
 4. Property OAK_Set_ColorDepth
  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.
7:    256 colors and grayscale image.
8:    256 colors image.
24:   true color image.
 
 5. Property OAK_Set_PDFInfo
  This property sets the PDF document information.
The paramater pValue3 is the information keywords.
The paramater pValue4 is the content of the document information.
 
 6. Property OAK_Set_PDFEncrypt
 

This property sets the PDF password protection.
The paramater nValue1 is to set pdf encrypt level.
    Two kinds of encrypt level are supported, 40bits and 128bits, default is 40bits.
    OAK_PDF_ENCRYPT_LEVEL_40:    40
    OAK_PDF_ENCRYPT_LEVEL_128:  128

The paramater nValue2 is to set pdf operation permission.
    The pdf operation permissions are listed at the following.
    OAK_PDF_PERMISSION_NONE:          0
    OAK_PDF_PERMISSION_PRINT:          1
    OAK_PDF_PERMISSION_COPYING:    2
    OAK_PDF_PERMISSION_MODIFY:      4
Notes: You can combinate the three operaion permissions of printing, copying and modify at will.
eg: OAK_PDF_PERMISSION_ALL=OAK_PDF_PERMISSION_PRINT+OAK_PDF_PERMISSION_COPYING+OAK_PDF_PERMISSION_MODIFY=7

 
 7. Property OAK_Set_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 compression are listed below:
 
Constant Name Value Description
AP_TIFF_COMPRESSION_NONE 0 No compression
AP_TIFF_COMPRESSION_LZW 1 Lzw compression
AP_TIFF_COMPRESSION_JPEG 2 Jpeg compression
AP_TIFF_COMPRESSION_PACKBITS 3 Packbits compression
AP_TIFF_COMPRESSION_CCITTG4 4 CCITT Group 4 compression
AP_TIFF_COMPRESSION_CCITTG3 5 CCITT Group 3 compression
AP_TIFF_COMPRESSION_RLE 6 RLE compression
 
 
 8. Property OAK_Set_Quality
  This property gets or sets the compression quality(1..100) for lossy compression types. Default is 75.
 
 
 

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 long PDF resolution.
OAK_Set_ColorDepth 2104 long The color depth of an image
OAK_Set_PDFInfo 2105 string Set PDF document information.
OAK_Set_PDFEncrypt 2106 long Set PDF password protection.
OAK_Set_Compression 2108 long Set the compression type for tiff.
OAK_Set_Quality 2109 long Set the compression quality for jpeg.

Notice: For more detial properties, please click here.

 2. Definitions of return code
 
Name Value Description
OAK_FILE_PDF  100 PDF document.
OAK_FILE_TIF  105 tiff format image.
OAK_FILE_JPG  106 jpeg format image.
OAK_FILE_BMP  107 bmp format image.
OAK_FILE_GIF  108 gif format image.
OAK_FILE_PCX  109 pcx format image.
OAK_FILE_PNG  110 png format image.
OAK_FILE_EMF  111 emf format image.
OAK_FILE_WMF  112 wmf format image.

 3. Definitions of return code
 
 
Name Value Description
RTN_OK  1 Successful operation.
RTN_ERROR1  0 Failure convertion.
RTN_ERROR2 -1 None of setting output file name.
RTN_ERROR3 -2 None of setting input file name.
RTN_ERROR4 -3 Invalid instance object number.

 4. Definitions of PDF document information
 
 
Name Value Description
OAK_PDFInfo_TITLE "title" title information.
OAK_PDFInfo_SUBJECT "subject" subject information.
OAK_PDFInfo_AUTHOR "author" author information.
OAK_PDFInfo_KEYWORDS "keywords" keywords information.
OAK_PDFInfo_APPLICATION "creator" creator information.
 
 


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