如何在win2000设置自定义纸张?(50分)

  • 主题发起人 主题发起人 lzliang
  • 开始时间 开始时间
在word里面可以吗?
 
打印机设置都不可以!
 
用DevMode字段可以!
如设置纸的Width:
procedure TPrintForm.SetWidth(PaperWidth: longint);
var
ADevice, ADriver, APort: String;
ADeviceMode: THandle;
DevMode: PDeviceMode;
begin

SetLength(ADevice, 255);
SetLength(ADriver, 255);
SetLength(APort, 255);

{ If ADeviceMode is zero, a printer driver is not loaded. Therefore,
setting PrinterIndex forces the driver to load. }
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_PAPERWIDTH;
//or DM_PAPERWIDTH;
DevMode^.dmPaperLength := PaperLength;
DevMode^.dmPaperWidth := PaperWidth;
///////////////////////设置纸张////////////////
finally
GlobalUnlock(ADeviceMode);
end;

end
else

raise Exception.Create('Could not set printer copies');
end;
 
自定义纸张在quickreport(nt操作系统)中不支持
 
接受答案了.
 
后退
顶部