如何在程序里控制打印纸张大小(A3,A4)和打印方向?不想打开设置窗口
---------------------------------------------------------------
Uses Printer;
.........
procedure TForm1.Button1Click(Sender: TObject);
var
ADevice, ADriver, APort: array[0..255] of Char;
DeviceHandle: THandle;
DevMode: PDeviceMode;
begin
//初始化打印机
Printer.GetPrinter(ADevice, ADriver, APort, DeviceHandle);
if DeviceHandle = 0 then
begin
Printer.PrinterIndex := Printer.PrinterIndex;
Printer.GetPrinter(ADevice, ADriver, APort, DeviceHandle);
end;
if DeviceHandle = 0 then
Raise Exception.Create('不能初始化打印机!')
else
DevMode := GlobalLock(DeviceHandle);
if DeviceHandle <