diff --git a/components/printers/unix/cupsprinters.inc b/components/printers/unix/cupsprinters.inc index 7990a91e1a..0d14b74e1f 100644 --- a/components/printers/unix/cupsprinters.inc +++ b/components/printers/unix/cupsprinters.inc @@ -699,7 +699,7 @@ end; function TCUPSPrinter.GetCanvasRef: TPrinterCanvasRef; begin - Result:=TPostscriptPrinterCanvas; + Result:=CupsCanvasClass; end; //Override this methode for assign an @@ -735,7 +735,7 @@ begin FOutputFileName := FOutputFileName + '.raw' else begin FOutputFileName := FOutputFileName + '.ps'; - TPostscriptPrinterCanvas(Canvas).OutputFileName := FOutputFileName; + TFilePrinterCanvas(Canvas).OutputFileName := FOutputFileName; end; end; @@ -760,7 +760,7 @@ begin end; end else - TPostscriptPrinterCanvas(Canvas).OutPutFileName:=''; + TFilePrinterCanvas(Canvas).OutPutFileName:=''; if not aAborted and FileExistsUTF8(FOutputFileName) then begin {$IFDEF LogPrintoutFile} diff --git a/components/printers/unix/cupsprinters_h.inc b/components/printers/unix/cupsprinters_h.inc index 8fdede2255..c094f6cd54 100644 --- a/components/printers/unix/cupsprinters_h.inc +++ b/components/printers/unix/cupsprinters_h.inc @@ -166,3 +166,6 @@ type property CupsPPD:Pppd_file_t read fcupsPPD; end; +Var + CupsCanvasClass : TFilePrinterCanvasClass = TPostscriptPrinterCanvas; + diff --git a/docs/Contributors.txt b/docs/Contributors.txt index 94d36710bf..d88fe577cd 100644 --- a/docs/Contributors.txt +++ b/docs/Contributors.txt @@ -116,6 +116,7 @@ Patrick Chevalley Paul Ishenin Paul Michell Pawel Trochimczuk +Petr Kristan Peter Dyson Philip J. Hess Pierre Gillmann diff --git a/lcl/postscriptcanvas.pas b/lcl/postscriptcanvas.pas index 6a9113e1ed..5a21896ee8 100644 --- a/lcl/postscriptcanvas.pas +++ b/lcl/postscriptcanvas.pas @@ -57,11 +57,10 @@ Type TPsCanvasState = ( pcsPosValid, pcsClipping, pcsClipSaved ); TPsCanvasStatus = set of TPsCanvasState; - TPostScriptPrinterCanvas = Class(TPrinterCanvas) + TPostScriptPrinterCanvas = Class(TFilePrinterCanvas) private fHeader : TStringList; //Header document fDocument : TstringList; //Current document - fFileName : String; //OutOut fileName fBuffer : TStringList; //PostScript temporary buffer @@ -182,7 +181,6 @@ Type const Style: TTextStyle); override; - property OutPutFileName : string read fFileName write fFileName; end; TPostScriptCanvas = Class(TPostScriptPrinterCanvas) @@ -1478,8 +1476,8 @@ begin if I <> -1 then FHeader[I] := '%%' + Format('Pages: %d', [PageNumber]); - if Trim(fFileName)<>'' then - SaveToFile(ExpandFileNameUTF8(fFileName)); + if Trim(OutputFileName)<>'' then + SaveToFile(ExpandFileNameUTF8(OutputFileName)); if Assigned(fPsUnicode) then FreeAndNil(fPsUnicode); diff --git a/lcl/printers.pas b/lcl/printers.pas index 9d0c5e4be0..3686fddea2 100644 --- a/lcl/printers.pas +++ b/lcl/printers.pas @@ -115,6 +115,17 @@ type TPrinterCanvasRef = Class of TPrinterCanvas; + { TFilePrinterCanvas } + + TFilePrinterCanvas = class(TPrinterCanvas) + protected + FOutputFileName: string; + public + property OutputFileName : string read FOutputFileName write FOutputFileName; + end; + + TFilePrinterCanvasClass = class of TFilePrinterCanvas; + TPaperRect = Record PhysicalRect : TRect; WorkRect : TRect;