Bullets print wrong with SRichViewEdit.DrawPage

General TRichView support forum. Please post your questions here
Post Reply
juan_lb
Posts: 2
Joined: Mon Oct 22, 2012 4:28 pm

Bullets print wrong with SRichViewEdit.DrawPage

Post by juan_lb »

I'm using the method TSRichViewEdit.DrawPage to get my text printed.

I'm using that method beacause I need to print the background.
The problem is that all the bullets get printed too large and out of place.

The text and the background are just fine.

I really don't understand what migth be the problem.

Do you know the cause of this behavior?

Thanks in advance.

Juan.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send me a sample project reproducing this problem
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Unfortunately, you cannot call DrawPage for Printer.Canvas.
This method needs to change Canvas.Font.PixelsPerInch temporarily, but TPrinterCanvas does not allow to do it.

A workaround:
1. Declare

Code: Select all

var   PageCanvas: TCanvas;
2. In the beginning, after Printer.BeginDoc:

Code: Select all

  PageCanvas := TCanvas.Create;
  PageCanvas.Handle := Printer.Canvas.Handle;
In the call of
3. In the calls of DrawPage, change Printer.Canvas to PageCanvas
4. In the end:

Code: Select all

  PageCanvas.Handle := 0;
  PageCanvas.Free;
juan_lb
Posts: 2
Joined: Mon Oct 22, 2012 4:28 pm

Post by juan_lb »

It works!!

Thank you :D
Post Reply