long | MLoad (char *filename,char *password) |
long | MEncode (long id,long pageno) |
void | MFree (long id) |
long | MGetCount (long id) |
long | MSetParam (long id,char *outpath,long imagetype, long bitcount,long compression,long quality,long grayscale, long multipage,long rotate,long width,long height,long xdpi,long ydpi) |
long MLoad | ( char *filename, char *password ) |
|
Open a pdf file. | ||
Parameters: | ||
filename | A string that is the path to the desired pdf file. | |
password | A string that is the password to open pdf file if pdf is restricted. | |
Return Value: | ||
Return a handle if the open was successful. Return -1 if filename is NULL or an empty string. Return -2 fi pdf file is restricted and password is NULL or error. |
||
long MEncode | ( long id, long pageno ) |
|
Convert Multi-page PDF file to Multi-page TIFF file or single page TIFF, TGA files. | ||
Parameters: | ||
id | A handle to the file. | |
pageno | Specify page number to convert. | |
Return Value: | ||
Returns 1 if convert is successfully, otherwise 0. | ||
long MFree | ( long id ) | |
Closes pdf file and deletes the object. | ||
Parameters: | ||
id | A handle to the file. | |
Return Value: | ||
Returns 1 if the file is successfully closed, otherwise 0. | ||
long MGetCount | ( long id ) | |
Retrieves the pages count of the pdf file. | ||
Parameters: | ||
id | A handle to the file. | |
Return Value: | ||
The count of pages, otherwise 0. | ||
long MSetParam | ( long id, char *outpath, long imagetype, long bitcount, long compression, long quality, long grayscale, long multipage, long rotate, long width, long height, long xdpi, long ydpi ) |
|
Set the parameter. | ||
Parameters: | ||
id | A handle to the file. | |
outpath | Set output path. If path is NULL or an empty string, it save in the same folder as source file. | |
imagetype | Set generated image format. see ENUM_IMAGE_FORMATS. | |
bitcount | Set the color depth in the generated image file, 1=black and white, 4=16 colors, 8=256 colors, 24=true color. see COLOR_DEPTH. | |
compression | Set the Compression method in the generated TIFF file, this option is only available for TIFF files. see ENUM_TIFF_COMPRESSION. | |
quality | Set quality (1 ~ 100) in the generated JPEG file or TIFF file jpeg compression, default 75. | |
grayscale | The 1 is convert to grayscale image file, this option is only available while bitcount equal 4 and 8. | |
multipage | The 1 is generate a multi-page TIFF file, the 0 is generate a TIFF file for each page, this option is only available for TIFF files | |
rotate | Set page rotate angle(0~360). | |
width | Set page width. e.g. width=1, height=1280, set height as 1280 pixels, and width to according to the pdf page size relative. | |
height | Set page height. e.g. width=800, height=1, set width as 800 pixels, and height to according to the pdf page size relative. | |
xdpi | Set horizontal resolution (72 ~ 600), default 72. | |
ydpi | Set vertical resolution (72 ~ 600), default 72. | |
Return Value: | ||
Returns 1 if set is successfully, otherwise 0. |
Formats | Value | Support color depth, 1=black and white, 4=16 colors, 8=256 colors, 24=true color, g=grayscale |
IMAGE_FORMAT_TIF | 1 | 1,, 4,, 4-g,, 8,, 8-g,, 24 |
IMAGE_FORMAT_TGA | 2 | 8,, 8-g,, 24 |
IMAGE_FORMAT_PNG | 3 | 1,, 4,, 4-g,, 8,, 8-g,, 24 |
Compression | Value | Support color depth, 1=black and white, 4=16 colors, 8=256 colors, 24=true color, g=grayscale | |
COMPRESSION_NONE | 1 | dump mode | 1,, 4,, 4-g,, 8,, 8-g,, 24 |
COMPRESSION_CCITTRLE | 2 | CCITT modified Huffman RLE | 1 |
COMPRESSION_CCITTFAX3 | 3 | CCITT Group 3 fax encoding | 1 |
COMPRESSION_CCITTFAX4 | 4 | CCITT Group 4 fax encoding | 1 |
COMPRESSION_LZW | 5 | Lempel-Ziv & Welch | 1,, 4,, 4-g,, 8,, 8-g,, 24 |
COMPRESSION_JPEG | 7 | %JPEG DCT compression | 8-g,, 24 |
COMPRESSION_PACKBITS | 32773 | Macintosh RLE | 4,, 4-g,, 8,, 8-g,, 24 |
Any time that you need help while using products, please contact our support team at support@mgosoft.com.
We promise to our customers that we will deal with emails within 24 hours after receiving them.