Using FormFeed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phppick
Forum Commoner
Posts: 57
Joined: Thu Aug 14, 2003 5:59 am

Using FormFeed

Post by phppick »

Hi,

How to use the FormFeed (\f) in a PHP File. I tried by placing
1. "\f"
2. chr(12)

but not working. Anybody can help?

I did like this..

echo "<TABLE ...> <TR> <TD>$variable<TD></TR></TABLE>\f";

AND

echo "<TABLE ...> <TR> <TD>$variable<TD></TR></TABLE>\f\r";
and so many other options i tried.

All these i want becoz, once a page is printed i want send the paper out from printer. Paper Size is (9.55Inch Width, 3.6 Inch Height)

Please Help, if possible with example.

Thanks in Advance
Jen
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

try to use like that


Using StyleSheet, it's easy to force a page break when printing a page.

Code: Select all

<table>
  <tr><td>Page 1</td></tr>
</table>

<table style=&quote;page-break-before: always&quote;>
  <tr><td>Page 2</td></tr>
</table>
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

Does \r\n do the job?
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

Code: Select all

<?php
    echo "<table style=\"page-break-after:always\"><tr><td>$variable</td></tr></table>";
?>
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

ahh, page break, sorry :)
phppick
Forum Commoner
Posts: 57
Joined: Thu Aug 14, 2003 5:59 am

Tried

Post by phppick »

Hi,

I tried with your options, but not working. Any other sugg..

Thenks
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Post by facets »

this should work.

Code: Select all

&lt;br style=&quote;page-break-before:always;">
<br style="page-break-after:always;">
or

Code: Select all

echo "<br style=\"page-break-before:always;\">";
echo "<br style=\"page-break-after:always;\">";
mp;amp;gt;


or

Code: Select all

echo "<br style=\"page-break-before:always;\">";
echo "<br style=\"page-break-after:always;\">";
yle="page-break-before:always;">
<br style="page-break-after:always;">


or

Code: Select all

echo "<br style=\"page-break-before:always;\">";
echo "<br style=\"page-break-after:always;\">";
p;quote;page-break-after:always;">


or

Code: Select all

echo &quote;&lt;br style=\&quote;page-break-before:always;\&quote;&amstyle="page-break-before:always;">
<br style="page-break-after:always;">
or

Code: Select all

echo "<br style=\"page-break-before:always;\">";
echo "<br style=\"page-break-after:always;\">";
p;amp;lt;br style="page-break-after:always;">


or

Code: Select all

echo "<br style=\&quote;page-break-before:always;\&quote; style="page-break-after:always;">
or

Code: Select all

echo "<br style=\&amp

Code: Select all

<br style="page-break-before:always;">
<br style="page-break-after:always;">
or

Code: Select all

echo "<br style=\"page-break-before:always;\">";
echo "<br style=\"page-break-after:always;\">";
9fd5]
<br style="page-break-before:always;&quote;&gt;
&lt;br style=&quote;page-break-after:always;&quote;&gt;


or

Code: Select all

echo "<br style=\"page-break-before:always;\">";
echo "<br style=\"page-break-after:always;\">";
Post Reply