C
Chxn
Unregistered / Unconfirmed
GUEST, unregistred user!
打印机Epson LQ-1600KII,winnt40
procedure TfrmMain.PageSet;
var
ADevice,ADriver,APort:string;
ADeviceMode:THandle;
DevModeDeviceMode;
Page:TPoint;
begin
try
SetLength(ADevice,255);
SetLength(ADriver,255);
SetLength(APort,255);
if ADeviceMode=0 then
begin
Printer.PrinterIndex:=Printer.PrinterIndex;
Printer.GetPrinter(Pchar(ADevice),PChar(ADriver),Pchar(APort),ADeviceMode);
end;
if ADeviceMode<>0 then
begin
DevMode:=GlobalLock(ADeviceMode);
try
DevMode^.dmFields:=DevMode^.dmFields or DM_PaperSize;
DevMode^.dmPaperSize:=0;//好象只有这条是关键,但是0是什么纸张类型?
DevMode^.dmFields:=DevMode^.dmFields or DM_PaperWidth;
DevMode^.dmPaperWidth:=2090;
DevMode^.dmFields:=DevMode^.dmFields or DM_PaperLength;
DevMode^.dmPaperLength:=760;//设置纸张大小20.9*7.7(cm)
finally
GlobalUnlock(ADeviceMode);
end;
end;
finally
end;
end;
实际纸张大小1032*1536 pixels 5.73*8.5(cm)
procedure TfrmMain.PageSet;
var
ADevice,ADriver,APort:string;
ADeviceMode:THandle;
DevModeDeviceMode;
Page:TPoint;
begin
try
SetLength(ADevice,255);
SetLength(ADriver,255);
SetLength(APort,255);
if ADeviceMode=0 then
begin
Printer.PrinterIndex:=Printer.PrinterIndex;
Printer.GetPrinter(Pchar(ADevice),PChar(ADriver),Pchar(APort),ADeviceMode);
end;
if ADeviceMode<>0 then
begin
DevMode:=GlobalLock(ADeviceMode);
try
DevMode^.dmFields:=DevMode^.dmFields or DM_PaperSize;
DevMode^.dmPaperSize:=0;//好象只有这条是关键,但是0是什么纸张类型?
DevMode^.dmFields:=DevMode^.dmFields or DM_PaperWidth;
DevMode^.dmPaperWidth:=2090;
DevMode^.dmFields:=DevMode^.dmFields or DM_PaperLength;
DevMode^.dmPaperLength:=760;//设置纸张大小20.9*7.7(cm)
finally
GlobalUnlock(ADeviceMode);
end;
end;
finally
end;
end;
实际纸张大小1032*1536 pixels 5.73*8.5(cm)