Printing Page with TAchart using TPrinterDrawer and TextOut
Original Reporter info from Mantis: mhiggins
-
Reporter name:
Original Reporter info from Mantis: mhiggins
- Reporter name:
Description:
I want to print a page with a TAChart and additional text. The page prints correctly the first time. However, if I reprint immediately afterwards then the TAChart prints OK but the text is turned and jumbled
Steps to reproduce:
var
MyPrinter : TPrinter;
begin
MyPrinter := Printer;
myprinter.Orientation:=poportrait; // set orientation
// some stuff to set line spaces, etc
PWidth:=myPrinter.Pagewidth div 13;
myprinter.canvas.Font.Name:='Arial';
myprinter.canvas.Font.size:=8;
Linespace := round(1.2 * myprinter.canvas.textheight('Ty'));
OriX:=2*Pwidth;
MaxY:=4*linespace;
MaxX:=myPrinter.Pagewidth-2*pwidth;
Xsize:=MaxX-OriX;
myPrinter.beginDoc;
lineno:=50;
// print some text
textOut(pwidth, LineNo*Linespace,'CSDCorrections '+get_version);
// print a graph
graph_rect:=rect(OriX+(XSize div 10), MaxY+linespace, MaxX-(XSize div 10), 30*linespace);
semi_log.draw (TPrinterDrawer.Create(myPrinter), graph_rect);
myPrinter.endDoc;
end;
Additional information:
If I put the TAChart draw before the textout then I get the same problem on the first try.
Mantis conversion info:
- Mantis ID: 27163
- OS: Windows
- OS Build: Win 7
- Build: 46529
- Platform: PC
- Version: 1.2.6
- Target version: 1.2.8