You are here: pdfMakeJPEG
Move to: WPViewPDF
Common:
This function is exported by the engine DLL to make it easy to convert PDF pages into bitmap files.
No object has to be created and no initialization is required.
This function defined as
Pascal:
function pdfMakeImage(
filename: PAnsiChar;
password: PAnsiChar;
licname, lickey: PAnsiChar;
liccode: Cardinal;
destpath: PAnsiChar;
frompage, to_page: Integer;
jpegres: Integer): Integer; stdcall;
C:
stdcall int pdfMakeImage(
char *filename,
char * password,
char * licname,
char * lickey,
long liccode,
char * destpath,
int frompage,
int to_page,
int jpegres);
VB
Declare Function pdfMakeImage Lib "wPDFViewDemo03.dll" _
Alias "pdfMakeJPEG" _
(ByVal zfilename As String, _
ByVal zpassword As String, _
ByVal zlicname As String, _
ByVal zlickey As String, _
ByVal liccode As Long, _
ByVal zdestpath As String, _
ByVal frompage As Long, _
ByVal To_page As Long, _
ByVal jpegres As Long) As Long
Parameters:
filename: the full path to the input PDF file. Please pass a UTF8 string.
password: optional user password required to open the PDF file
licname, lickey, liccode: when using registered version use your license data here
destpath: the path to the created image file. The placeholder %d is replaced with the page number. Please pass an UTF8 string.
The variable "destpath" should contain the file extension (JPG, JPEG).
It is also possible to create PNG files. To do so use the extension PNG.
frompage: the first exported page, starting with 1
to_page: the last exported page
jpegres: - low-word (0000XXXX): the resolution for the JPEG file (default = 72),
hi-word: various options:
The lower nibble of the higher word is used to select the color depth.
It may may have this values:
1 : 1 bit monochrome dithered
2 : 1 bit monochrome not dithered
3 : 8 bit color
4 : 8 bit gray
otherwise: 24 bit color
The high byte of the high word is used to select the JPEG compression level (ignored for PNG)
Similar functions:
pdfMakeJPEG uses the same functions as pdfMakeImage and works the same way.
The only difference is that it does not expect UTF8 strings. It was mainly provided for compatibility to WPViewPDF Version 2.
function pdfMakeJPEG(filename: PAnsiChar; password: PAnsiChar;
licname, lickey: PAnsiChar;
liccode: Cardinal;
destpath: PAnsiChar; // Use %d store page number !
frompage, to_page: Integer;
jpegres: Integer): Integer; stdcall;
pdfMakeImageW works like pdfMakeImage but expects unicode strings.
function pdfMakeImageW(filename: PWideChar; password: PWideChar;
licname, lickey: PWideChar;
liccode: Cardinal;
destpath: PWideChar; // Use %d store page number !
frompage, to_page: Integer;
jpegres: Integer): Integer; stdcall;