W
wanby
Unregistered / Unconfirmed
GUEST, unregistred user!
在epson lq-1900k打印機中打印工資報表,紙張為355.5mm*279.4mm(用inch則為14*11)
我用QuickReport作報表,在quickrep中將紙張設為customer size:355.5*279.4mm
中預覽中沒問題,可是打印時卻只打印了寬約20cm的東西,縱向倒沒問題,無論在打印怎麼設都這樣
沒辦法,我只好在Quickrep的beforePrint事件中自定義紙張代碼如下:
procedure TrptGZBB.repGZBBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
var
Device :array [0..(cchDeviceName-1) ] of Char;
Driver :array [0..(MAX_PATH-1)] of char ;
Port : array[0..32] of char ;
hDMode :THandle;
pDMode DevMode;
begin
Printer.PrinterIndex:=Printer.PrinterIndex;
Printer.GetPrinter(Device,Driver,Port,hDMode);
if hDMode<>0 then
begin
pDMode:=GlobalLock(hDMode);
if pDMode <> nil then
begin
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERSIZE;
pDMode^.dmPaperSize:=dmPaper_user;
{ 設置為自定義紙的方式 0和256 }
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERLENGTH;
pDMode^.dmPaperLength:=2794;//長度
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERWIDTH;
pDMode^.dmPaperWidth:=3555;//寬度
// printer.SetPrinter(device,driver,port,hdmode);
pDMode^.dmFields := pDMode^.dmFields or DMBIN_MANUAL;
pDMode^.dmDefaultSource := DMBIN_MANUAL;
GlobalUnlock(hDMode);
Printer.PrinterIndex:=Printer.PrinterIndex;
end;
end;
end;
可還是老樣子,請教各位大蝦,問題出在哪里?誰能最先幫我解決此問題,500分拱手相送!!!
我用QuickReport作報表,在quickrep中將紙張設為customer size:355.5*279.4mm
中預覽中沒問題,可是打印時卻只打印了寬約20cm的東西,縱向倒沒問題,無論在打印怎麼設都這樣
沒辦法,我只好在Quickrep的beforePrint事件中自定義紙張代碼如下:
procedure TrptGZBB.repGZBBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
var
Device :array [0..(cchDeviceName-1) ] of Char;
Driver :array [0..(MAX_PATH-1)] of char ;
Port : array[0..32] of char ;
hDMode :THandle;
pDMode DevMode;
begin
Printer.PrinterIndex:=Printer.PrinterIndex;
Printer.GetPrinter(Device,Driver,Port,hDMode);
if hDMode<>0 then
begin
pDMode:=GlobalLock(hDMode);
if pDMode <> nil then
begin
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERSIZE;
pDMode^.dmPaperSize:=dmPaper_user;
{ 設置為自定義紙的方式 0和256 }
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERLENGTH;
pDMode^.dmPaperLength:=2794;//長度
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERWIDTH;
pDMode^.dmPaperWidth:=3555;//寬度
// printer.SetPrinter(device,driver,port,hdmode);
pDMode^.dmFields := pDMode^.dmFields or DMBIN_MANUAL;
pDMode^.dmDefaultSource := DMBIN_MANUAL;
GlobalUnlock(hDMode);
Printer.PrinterIndex:=Printer.PrinterIndex;
end;
end;
end;
可還是老樣子,請教各位大蝦,問題出在哪里?誰能最先幫我解決此問題,500分拱手相送!!!