WTL Text Printing
-
Hello... I like to support custom text printing in my application (without an edit control)... The wtl examples that i found at codeproject only support text printing with edit controls... I implemented the CPrintJobInfo class but unfortunely when it draw the text to the dc (in the PrintPage method) it only print the first drawing operation... For example .: bool CMainFrame::PrintPage(UINT nPage, HDC hDC) { CDCHandle dc = hDC; CString text = _T("A Test"); dc.TextOut(0,0,text,text.GetLength()); // This text is only visible on page dc.TextOut(0,20,text,text.GetLength()); dc.TextOut(0,40,text,text.GetLength()); return true; } I hope anybody can help me :confused:...
-
Hello... I like to support custom text printing in my application (without an edit control)... The wtl examples that i found at codeproject only support text printing with edit controls... I implemented the CPrintJobInfo class but unfortunely when it draw the text to the dc (in the PrintPage method) it only print the first drawing operation... For example .: bool CMainFrame::PrintPage(UINT nPage, HDC hDC) { CDCHandle dc = hDC; CString text = _T("A Test"); dc.TextOut(0,0,text,text.GetLength()); // This text is only visible on page dc.TextOut(0,20,text,text.GetLength()); dc.TextOut(0,40,text,text.GetLength()); return true; } I hope anybody can help me :confused:...
Ehmmm... I have found the bug or better my own mistake... I forget the different resolutions between the screen and printer dc... The distance between the 3 strings was to small to see them completly... For example.: dc.TextOut(0,0,text,text.GetLength()); dc.TextOut(0,400,text,text.GetLength()); dc.TextOut(0,800,text,text.GetLength()); woks...