procedure Tfrmreports.getprinterinformation;
var
Device: Array[0..(cchDeviceName -1)] of char;
Port: Array[0..32] of char;
Driver: Array[0..(MAX_PATH -1)] of char;
HDMode : THandle;
PDMode: PDevMode;
begin
printer.PrinterIndex:=printer.PrinterIndex;
printer.GetPrinter(Device,Driver,Port,HDMode);
if HDMode<>0 then
begin
case PDMode.dmPaperSize of
DMPAPER_USER:edit3.Text:='自定义纸张类型.';
DMPAPER_A3:edit3.Text:='A3 纸张类型.';
DMPAPER_A4:edit3.Text:='A4 纸张类型.';
DMPAPER_A5:edit3.Text:='A5 纸张类型.';
DMPAPER_B4:edit3.Text:='B4 纸张类型.';
DMPAPER_B5:edit3.Text:='B5 其它.';
end;
end;
GlobalUnLock(HDMode);
printer.PrinterIndex:=printer.PrinterIndex;
end;