Skip to content

Commit

Permalink
CSS Fix PDF Frame background when multiple pages
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisjacquet committed Jul 27, 2023
1 parent 61d66c2 commit 076b080
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Changes in 11.1
- CSS themes: force .tooltip styles when inside .widefat table head in stylesheet.css
- Fix SQL error null value in column "student_id" in Eligibility/Student.php
- Fix SQL error Unknown column 'a.ADDRESS' in 'where clause' in Percent.php
- CSS Fix PDF Frame background when multiple pages in HonorRoll.fnc.php

Changes in 11.0.2
-----------------
Expand Down
14 changes: 9 additions & 5 deletions modules/Grades/includes/HonorRoll.fnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,25 @@ function HonorRollPDF( $student_array, $is_list, $honor_roll_text )
}
}

// Frame height is a few pixels below page height & depends on page format (A4 or US Letter)
$frame_height = Preferences( 'PAGE_SIZE' ) === 'A4' ? '992' : '1085';

echo '<style type="text/css">
body {
margin:0;
padding:0;
width:100%;
height:100%;
}
.pdf-frame {
width: 1405px;
height: ' . $frame_height . 'px;
page-break-before: always;
' . $frame_image_css . '
}
</style>';

foreach ( (array) $RET as $student)
{
echo '<table style="margin:auto auto;">';
echo '<div class="pdf-frame"><table style="margin:auto auto;">';

$substitutions = [
'__FULL_NAME__' => $student['FULL_NAME'],
Expand Down Expand Up @@ -182,8 +188,6 @@ function HonorRollPDF( $student_array, $is_list, $honor_roll_text )
<span style="font-size:medium;">' . _( 'Date' ) . '</span></td></tr>';

echo '</table></div>';

echo '<div style="page-break-after: always;"></div>';
}

PDFStop( $handle );
Expand Down

0 comments on commit 076b080

Please sign in to comment.