Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-03

TCairoCanvas integration problem

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi.

I found a problem in TCairoPsCanvas integration process. In TCairoPsCanvas.BeginDoc I nedd to know OutputFileName (1), but this is inicialized later in TCUPSPrinter.DoBeginDoc (2).

procedure TPrinter.BeginDoc;
begin
  ...
  if not FRawMode then begin
    Canvas.Refresh;
    TPrinterCanvas(Canvas).BeginDoc; //<-- 1
  end;
  //Call the specifique Begindoc
  DoBeginDoc;  //<-- 2
  ...
end;

I think, that logically sould be printer started (DoBeginDoc) before call Canvas.BeginDoc. Thus I would like to swap calling order:

procedure TPrinter.BeginDoc;
begin
  ...
  //Call the specifique Begindoc
  DoBeginDoc;
  if not FRawMode then begin
    Canvas.Refresh;
    TPrinterCanvas(Canvas).BeginDoc;
  end;
  ...
end;

But I do not know if it will not cause some problems in other printer implementations.

If order swaping will be refused, I have another but dirty solution.

Petr

Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email