RAVE 如何設置橫向打印。(200分)

  • 主题发起人 主题发起人 jinvqing
  • 开始时间 开始时间
J

jinvqing

Unregistered / Unconfirmed
GUEST, unregistred user!
RAVE 如何設置橫向打印。
 
是page的orientation属性啊
 
双击RvProject1,打开设计器,取page的属性页,把orientation属性设为poLandScape
便可。
如果要用代码实现,则如下代码[注:这代码是一位好心的网友给的,得好好感觉他]:
procedure TMainForm.SetOrient();
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_ORIENTATION;
DevMode^.dmCopies := DMORIENT_LANDSCAPE;//横向打印
DMORIENT_PORTRAIT//竖向打印
finally
GlobalUnlock(ADeviceMode);
end;
end
else
raise Exception.Create('Could not set printer copies');
end;

 
后退
顶部