trichview.support
Re: Printing Page numbers |
Author |
Message |
Martyn |
Posted: 11/17/2003 10:36:34 Thanks for the PDF995 tip. It works well, rendering the page much better than the program I was using. Interestingly, the page numbers ARE rendered on all pages too. I guess this means that the code does work but results are dependent on the printer used. Martyn "Stef Mientki" <[email protected]> wrote in message news:[email protected]... > did you try it with some other pdf printer, like pdf995 (free and you're > not getting those "ugly" bottom lines ;-) > Stef Mientki > > Martyn wrote: > > > I changed my code to your code on the offchance (well, you never know ;-)) > > but it has the same effect, as the attached PDF shows (created using a > > to PDF utility). Interestingly though, the string shows up correctly on all > > pages in Print Preview. > > > > Martyn > > > > "Sergey Tkachenko" <[email protected]> wrote in message > > news:[email protected]... > > > >>Your code seems to be correct, and it should draw page numbers on all > > > > pages. > > > >>Please look at the demo > >>Demos\CBuilder\Assorted\Printing\Printing\ > >> > >>It uses the code: > >> > >>void __fastcall TForm1::RVPrint1PagePrepaint(TRVPrint *Sender, int PageNo, > >> TCanvas *Canvas, bool Preview, TRect &PageRect, TRect &PrintAreaRect) > >>{ > >> > >> AnsiString s = Format ("-- Page %d of %d --", ARRAYOFCONST((PageNo, > >>Sender->PagesCount))); > >> Canvas->Brush->Style = bsClear; > >> Canvas->Font->Assign(RVStyle1->TextStyles->Items[0]); > >> int w = Canvas->TextWidth(s); > >> int h = Canvas->TextHeight(s); > >> TextOut(Canvas->Handle, (PrintAreaRect.Right+PrintAreaRect.Left-w) / 2, > >> PrintAreaRect.Top - h - 10, s.c_str(), s.Length()); > >>} > >> > >>And it is printed on all pages > >> > >> > > > > > > > |
Powered by ABC Amber Outlook Express Converter