Jump to content

line-height affecting page-break-before


jandrews3

Recommended Posts

If I set the line-height in this code for anything less than 23, the iPad adds an extra page between pages yet the desktop prints normal.

 

$querys = "SELECT * FROM inno_students WHERE teacher = '".$_SESSION['staff']['uname']."' AND course_id = '$course_id' ORDER BY lname, fname";
$results= mysql_query($querys) or die("Could not perform query: ".mysql_error());
while ($rows = mysql_fetch_array($results)){
 
print "<div style=\"font-size: 12pt; line-height: 22px; ".$page."\">";
$page = "page-break-before: always;";
print "<p align=\"center\" style=\"font-size: 15pt; font-weight: bold; margin: 0px 0px;\">\n";
print "Skill Remediation<br><span style=\"font-size: 12pt;\">".$subject."</span>\n";
print "</p>\n";
 
print "<p align=\"right\" style=\"margin: 0px 0px;\">\n";
print "Name: <b>".$rows['lname'].", ".$rows['fname']."</b><br>\n";
print "Today's date: <b>".date("M j")."</b><br>\n";
$today = date("U");
$due = $today + (86400*3);
print "Due date: <b>".date("M j", $due)."</b><br>\n";
print "</p>\n";
 
print "</div>";
 
}
 
Link to comment
https://forums.phpfreaks.com/topic/287735-line-height-affecting-page-break-before/
Share on other sites

The first line in the <div> contained text with font-size 15pt but yet a line-height of 16px (at least, it did initially). That is apparently what caused it. If I shrink the font-size of the first line, the first line only, then the problem disappears. Apparently the line-height was too small for the font-size, which translated into a paging problem since it was the first line of the page.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.