mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 06:09:29 +02:00
LCL+Printers, patch to allow cupsprinter to use another class of TPrinterCanvas, from Petr Kristan, issue #16101
git-svn-id: trunk@24216 -
This commit is contained in:
parent
a74bc652d2
commit
14e8e2cf01
@ -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}
|
||||
|
@ -166,3 +166,6 @@ type
|
||||
property CupsPPD:Pppd_file_t read fcupsPPD;
|
||||
end;
|
||||
|
||||
Var
|
||||
CupsCanvasClass : TFilePrinterCanvasClass = TPostscriptPrinterCanvas;
|
||||
|
||||
|
@ -116,6 +116,7 @@ Patrick Chevalley
|
||||
Paul Ishenin
|
||||
Paul Michell
|
||||
Pawel Trochimczuk
|
||||
Petr Kristan
|
||||
Peter Dyson
|
||||
Philip J. Hess
|
||||
Pierre Gillmann
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user