RE: [PHP-DB] Re: sending a form feed to a printer
Try this: hello hello Nato -Original Message- From: Nathaniel Price [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 11:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: sending a form feed to a printer What you are proposing is possible to do in html, if you add some Cascading Style Sheets to the mix. You will need to use the page-break-after attribute: http://www.w3.org/TR/CSS2/page.html#propdef-page-break-after It would look something like this (in plain html): row1col1 row1col2 row2col1 row2col2 ... rowNcol1 rowNcol2 AFAIK, you'll have to close the table each time you want to print a line feed, although if you want to keep your table together, you might try putting the 'style="page-break-after: always"' attribute inside the appropriate tag. No guarantees, tho, as I haven't tried it this way, and it seems to go against the way CSS should work. Also, not every browser supports these CSS attributes. You should be fine on Netscape 6.0/Mozilla and IE 5 or better (not sure about IE, tho). Nathaniel Price http://www.thornvalley.com "Who is General Failure and why is he reading my hard drive?" - Original Message - From: "Jason S Motes" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 02, 2003 8:15 AM Subject: [PHP-DB] Re: sending a form feed to a printer > form feeds don't work in html. It is interpreted as a space. > > Arthur Chevalier wrote: > > Hello, > > > > I am having problems getting the \f (form feed) expression to work. After a > > certain amount of lines print I want to start printing the next line on a > > new sheet of paper. Any ideas of what I could be doing wrong. Below is a > > sample piece of my code. The bold code is where I am trying to issue the > > form feed. > > > > while($row = mysql_fetch_array($dbResult)) > > { > > print("\n"); > > print(" > HREF=\"show_single_server.php?server_name=$row[0]\" TARGET=\"text_float\">" > > . $row[0] . "\n"); > > print("". $row[1] . "\n"); > > print("". $row[2] . "\n"); > > print(" > HREF=\"$PHP_SELF?mid_tier=$row[3]&db_rel=0\" TARGET=\"text_float\">". > > $row[3] . "\n"); > > print(" > HREF=\"$PHP_SELF?db_rel=$row[4]&mid_tier=0\" TARGET=\"text_float\">". > > $row[4] . "\n"); > > > > $rowdata = $row[5]; > > if($rowdata == "") > > { > > print(" \n"); > > } > > else > > { > > print("". $row[5] . "\n"); > > } > > print("". $row[6] . "\n"); > > //print("\n"); > > > > if($counter == "20") > > { > > $counter = "0"; > > print("\f"); > > continue; > > } > > else > > { > > $counter ++; > > print(""); > > continue; > > } > > > > } > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: sending a form feed to a printer
What you are proposing is possible to do in html, if you add some Cascading Style Sheets to the mix. You will need to use the page-break-after attribute: http://www.w3.org/TR/CSS2/page.html#propdef-page-break-after It would look something like this (in plain html): row1col1 row1col2 row2col1 row2col2 ... rowNcol1 rowNcol2 AFAIK, you'll have to close the table each time you want to print a line feed, although if you want to keep your table together, you might try putting the 'style="page-break-after: always"' attribute inside the appropriate tag. No guarantees, tho, as I haven't tried it this way, and it seems to go against the way CSS should work. Also, not every browser supports these CSS attributes. You should be fine on Netscape 6.0/Mozilla and IE 5 or better (not sure about IE, tho). Nathaniel Price http://www.thornvalley.com "Who is General Failure and why is he reading my hard drive?" - Original Message - From: "Jason S Motes" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 02, 2003 8:15 AM Subject: [PHP-DB] Re: sending a form feed to a printer > form feeds don't work in html. It is interpreted as a space. > > Arthur Chevalier wrote: > > Hello, > > > > I am having problems getting the \f (form feed) expression to work. After a > > certain amount of lines print I want to start printing the next line on a > > new sheet of paper. Any ideas of what I could be doing wrong. Below is a > > sample piece of my code. The bold code is where I am trying to issue the > > form feed. > > > > while($row = mysql_fetch_array($dbResult)) > > { > > print("\n"); > > print(" > HREF=\"show_single_server.php?server_name=$row[0]\" TARGET=\"text_float\">" > > . $row[0] . "\n"); > > print("". $row[1] . "\n"); > > print("". $row[2] . "\n"); > > print(" > HREF=\"$PHP_SELF?mid_tier=$row[3]&db_rel=0\" TARGET=\"text_float\">". > > $row[3] . "\n"); > > print(" > HREF=\"$PHP_SELF?db_rel=$row[4]&mid_tier=0\" TARGET=\"text_float\">". > > $row[4] . "\n"); > > > > $rowdata = $row[5]; > > if($rowdata == "") > > { > > print(" \n"); > > } > > else > > { > > print("". $row[5] . "\n"); > > } > > print("". $row[6] . "\n"); > > //print("\n"); > > > > if($counter == "20") > > { > > $counter = "0"; > > print("\f"); > > continue; > > } > > else > > { > > $counter ++; > > print(""); > > continue; > > } > > > > } > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: sending a form feed to a printer
I got this code from something I found on a google search, but I've used it on other clients' projects successfully: This will work in IE4 and higher: page one text page two text page 3 text You also have the option of using page-break-after in the same manner. Three things: 1) Not sure what the equivalent would be in NN or any other browser. 2) You'd probably want to work this into a CSS style. 3) As always, this is a rather "dumb" feature in that it does not recognize page height or anything. It pretty much requires that you put the page breaks in manually where you think they should fall. In a large document/report, sometimes that can get a little hairy. Here's what the W3C has to say: http://www.w3.org/TR/REC-CSS2/page.html Here's what M$ has to say: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref erence/properties/pagebreakbefore.asp Hope this helps. Rich > -Original Message- > From: Jason S Motes [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 02, 2003 11:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Re: sending a form feed to a printer > > > form feeds don't work in html. It is interpreted as a space. > > Arthur Chevalier wrote: > > Hello, > > > > I am having problems getting the \f (form feed) expression > to work. After a > > certain amount of lines print I want to start printing the > next line on a > > new sheet of paper. Any ideas of what I could be doing > wrong. Below is a > > sample piece of my code. The bold code is where I am > trying to issue the > > form feed. > > > > while($row = mysql_fetch_array($dbResult)) > > { > > print("\n"); > > print(" > HREF=\"show_single_server.php?server_name=$row[0]\" > TARGET=\"text_float\">" > > . $row[0] . "\n"); > > print("". $row[1] . "\n"); > > print("". $row[2] . "\n"); > > print(" > HREF=\"$PHP_SELF?mid_tier=$row[3]&db_rel=0\" > TARGET=\"text_float\">". > > $row[3] . "\n"); > > print(" > HREF=\"$PHP_SELF?db_rel=$row[4]&mid_tier=0\" > TARGET=\"text_float\">". > > $row[4] . "\n"); > > > > $rowdata = $row[5]; > > if($rowdata == "") > > { > > print(" \n"); > > } > > else > > { > > print("". $row[5] . "\n"); > > } > > print("". $row[6] . "\n"); > > //print("\n"); > > > > if($counter == "20") > > { > > $counter = "0"; > > print("\f"); > > continue; > > } > > else > > { > > $counter ++; > > print(""); > > continue; > > } > > > > } > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php