72 lines
2.3 KiB
ObjectPascal
72 lines
2.3 KiB
ObjectPascal
|
|
unit U_printPdf;
|
|||
|
|
interface
|
|||
|
|
uses
|
|||
|
|
Windows,forms;
|
|||
|
|
// formId =1 <20><><EFBFBD><EFBFBD>id
|
|||
|
|
//mRecid='<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>'
|
|||
|
|
//printNumber=1 <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
|
|||
|
|
//printFlag=1 '<27><>ӡԤ<D3A1><D4A4>;0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ
|
|||
|
|
//DataBaseStr
|
|||
|
|
function printPdf(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;stdcall;external 'pdfPrint.dll' Name 'GetDllForm' ;
|
|||
|
|
// formId =1 <20><><EFBFBD><EFBFBD>id
|
|||
|
|
//mRecid='<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>'
|
|||
|
|
//printNumber=1 <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
|
|||
|
|
//printFlag=1 '<27><>ӡԤ<D3A1><D4A4>;0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ
|
|||
|
|
//DataBaseStr
|
|||
|
|
function printReport(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;stdcall;external 'pdfPrint.dll' Name 'GetDllForm' ;
|
|||
|
|
// formId =1 <20><><EFBFBD><EFBFBD>id
|
|||
|
|
//mRecid='<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>'
|
|||
|
|
//exportFileType=1 <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> pdf ,bmp ,jpg
|
|||
|
|
//DataBaseStr
|
|||
|
|
//<2F><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>ļ<EFBFBD>¼<EFBFBD><C2BC> <20><><EFBFBD><EFBFBD>
|
|||
|
|
function exportFile(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;exportFileType:PChar;DataBaseStr:PChar):hwnd;stdcall;external 'pdfPrint.dll' Name 'ExportFile' ;
|
|||
|
|
|
|||
|
|
function printPdf1(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
newh:hwnd;
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
|
|||
|
|
function printPdf1(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;
|
|||
|
|
type
|
|||
|
|
TMyFunc = function(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;
|
|||
|
|
mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;stdcall;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
Tf: TMyFunc;
|
|||
|
|
Tp: TFarProc;
|
|||
|
|
Th:Thandle;
|
|||
|
|
begin
|
|||
|
|
Th := LoadLibrary('pdfPrint.dll');
|
|||
|
|
if Th > 0 then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Tp := GetProcAddress(Th, 'GetDllForm');
|
|||
|
|
if Tp <> nil then
|
|||
|
|
begin
|
|||
|
|
Tf := TMyFunc(Tp);
|
|||
|
|
newh:=Tf(Application,1,
|
|||
|
|
Title,
|
|||
|
|
GCode,
|
|||
|
|
GName,
|
|||
|
|
mRecid,
|
|||
|
|
printNumber,printFlag,printer,DataBaseStr
|
|||
|
|
);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
//ShowMessage('<27><>ӡִ<D3A1>д<EFBFBD><D0B4><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
// FreeLibrary(Th);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
// ShowMessage('<27>Ҳ<EFBFBD><D2B2><EFBFBD>'+Trim(DllName.Text));
|
|||
|
|
end;
|
|||
|
|
end ;
|
|||
|
|
|
|||
|
|
end.
|