1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| function IsPostScriptPrinter(dc : hdc): bool; // Printer.Handle
var TestInt : integer;
a : array[0..255] of char;
err : integer;
s : string;
begin
Result := false;
TestInt := GETTECHNOLOGY;
{$IFDEF WIN32}
if ExtEscape(Dc, QUERYESCSUPPORT, sizeof(TestInt), @TestInt, 0, Nil) > 0 then begin
Err := ExtEscape(Dc, GETTECHNOLOGY, 0, nil, 256, @a);
{$ELSE}
if Escape(Dc, QUERYESCSUPPORT, sizeof(TestInt), @TestInt, Nil) > 0 then begin
Err := Escape(Dc, GetTechnology, 0, nil, @a);
{$ENDIF}
if Err > 0 then begin
s := UpperCase(StrPas(a));
if Pos('POSTSCRIPT', s) > 0 then
result := true;
end;
end;
end;
IsPostScriptPrinter(Printer.Handle) |
Partager