Skip to content

Commit

Permalink
Merge pull request #270 from katgirl/hotfix-styles
Browse files Browse the repository at this point in the history
Change order to load CSS
  • Loading branch information
splitbrain authored Jun 13, 2017
2 parents 95239e6 + a732326 commit 806282d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,16 @@ protected function generatePDF($cachefile, $title) {
$html .= '<html><head>';
$html .= '<style type="text/css">';
}
$styles = $this->load_css();
$styles .= '@page { size:auto; ' . $template['page'] . '}';

$styles = '@page { size:auto; ' . $template['page'] . '}';
$styles .= '@page :first {' . $template['first'] . '}';

$styles .= '@page landscape-page { size:landscape }';
$styles .= 'div.dw2pdf-landscape { page:landscape-page }';
$styles .= '@page portrait-page { size:portrait }';
$styles .= 'div.dw2pdf-portrait { page:portrait-page }';

$styles .= $this->load_css();

$mpdf->WriteHTML($styles, 1);

if($isDebug) {
Expand Down

0 comments on commit 806282d

Please sign in to comment.