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.
Bullets print wrong with SRichViewEdit.DrawPage
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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
2. In the beginning, after Printer.BeginDoc:
In the call of
3. In the calls of DrawPage, change Printer.Canvas to PageCanvas
4. In the end:
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;
Code: Select all
PageCanvas := TCanvas.Create;
PageCanvas.Handle := Printer.Canvas.Handle;
3. In the calls of DrawPage, change Printer.Canvas to PageCanvas
4. In the end:
Code: Select all
PageCanvas.Handle := 0;
PageCanvas.Free;