Board index » cppbuilder » Unwanted extra pages when printing
Phillip E. Meye
![]() CBuilder Developer |
Sun, 27 Nov 2005 03:47:30 GMT
Unwanted extra pages when printing
Using BCB5 and Printer(), I would like to print the total number of pages in
a document on the printout. eg Page 1 of 3, Page 2 of 3, Page 3 of 3. I have written the following that works fine for printers connected through a LPT port. As soon as I print across the network, the correct printout is preceeded with a Page 1 of 1 and Page 2 of 2 page for a three page document. I have tried several types of printers and operating systems. Local printers work (Canon BJC-2000 for instance). Network printers do not (HP 4050 laserjet for instance). I did have to cut quite a bit out of the code, but I hope this gives a void __fastcall TForm1::DoPrint(void) PrintCanvas = new TReportCanvas(Printer()->Canvas); //PrintCanvas PrintCanvas->PageHeight = Printer()->PageHeight; if (PrintLoop == 0) AnsiString HeaderText = "Page: " + IntToStr(Printer()->PageNumber) + /* if (PrintLoop == 0) delete PrintCanvas; Quote} { Fxpos = 0; // initialize variables Fypos = 0; FLeftMargin = 0; FTopMargin = 0; FRightMargin = 0; FTopMargin = 0; FCanvas = Canvas; Quote} PHiL |