dmPagerSize不能和dmPaperHeight一起设置,后者被前者忽略。设置打印长度用如下方法:var
ADevice,ADriver,APort:string;
ADevMode:THandle;
p:PDeviceMode;
begin
printer.PrinterIndex:=printer.PrinterIndex;
printer.GetPrinter(pchar(ADevice),pchar(ADriver),pchar(APort),ADevMode);
if ADecMode<>0 then
begin
p:=GlobalLock(ADevMode);
p^.dmFields=p^.dmFields or dmPaperLength;
p^.dmPaperLength:=xxx;
GlobalUnLock(ADevMode);
end;
end;
ADevice,ADriver,APort:string;
ADevMode:THandle;
p:PDeviceMode;
begin
printer.PrinterIndex:=printer.PrinterIndex;
printer.GetPrinter(pchar(ADevice),pchar(ADriver),pchar(APort),ADevMode);
if ADecMode<>0 then
begin
p:=GlobalLock(ADevMode);
p^.dmFields=p^.dmFields or dmPaperLength;
p^.dmPaperLength:=xxx;
GlobalUnLock(ADevMode);
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货