trichview.support
Difference between print and manual layout |
Author |
Message |
Martin Golm |
Posted: 04/06/2004 14:02:08 I'm using TRichView 1.8.1. trial with BCB6. I have a TRichView with a single style. The font of the style is set to Courier New, 10 points. The margins of TRVPrint are all set to 0. Now I add 100 lines and print the document. I get 76 lines per page. When I manually layout the page, I only get 68 lines per page. Here's the code I use: RichView1->Clear(); AnsiString s; int top, left; int page_height = MulDiv( Printer()->PageHeight, Screen->PixelsPerInch, GetDeviceCaps(Printer()->Handle, LOGPIXELSY) ); for (int i = 1; i <= 100; ++i) { s.sprintf("line: %d", i); RichView1->AddNL(s, rvsDefStyle, 0); RichView1->Format(); RichView1->GetItemCoords(RichView1->ItemCount - 1, left, top); if (top > page_height) { RichView1->DeleteItems(RichView1->ItemCount - 1, 1); break; } } RichView1->Format(); Why is there a difference of 8 lines? Thanks, Martin |
Powered by ABC Amber Outlook Express Converter