Page 1 of 1

Printing Annotations

Posted: Tue Dec 16, 2003 12:18 pm
by 8573645
Any suggestions as to why I cannot print annotations even though they are visible in the print preview window. I'm using Ver 6.01 with Delphi 7

Posted: Tue Dec 16, 2003 3:29 pm
by Pep
Perhaps the problem is you're using "screen pixel coordinates" to position custom elements, etc. While this is fine for screen, it does not work so well for printing. The reason for this is internal TeeChart printing algorithm adjusts Chart size (for proportional printing). During this process custom positioned items keep the same coordinates. The end result is all custom object will generally not be on correct place when printed.

The workaround is to use alternative approach to print chart:

Code: Select all

var tmpMeta: TMetaFile;
OldColor : TColor;
begin
    Chart1.BevelOuter := bvNone;
    OldColor := Chart1.Color;
    Chart1.Color := clNone;
    tmpMeta := Chart1.TeeCreateMetafile(true,Chart1.ClientRect);
    try
        Printer.Orientation := poLandscape;
        Printer.BeginDoc;
        try
            Printer.Canvas.StretchDraw(Rect(1,1,Printer.PageWidth - 1,
Printer.PageHeight - 1),tmpMeta);
        finally
            Printer.EndDoc;
        end;
    finally
        tmpMeta.Free;
        Chart1.BevelOuter := bvRaised;
        Chart1.Color := OldColor;
    end;
end;

Josep Lluis Jorge
http://support.steema.com