Skip to content

Commit

Permalink
Merge pull request #30 from mittwald/hotfix/#25-stylesheet-fix
Browse files Browse the repository at this point in the history
[BUGFIX] Correct style sheet handling.
  • Loading branch information
martin-helmich committed Oct 9, 2015
2 parents b2031a2 + 8abb971 commit 2082333
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Classes/View/PdfView.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ protected function getPdfObject() {
/* @var $pdf \mPDF */
$pdf = $this->objectManager->get('mPDF', '', $pageFormat . '-' . $pageOrientation);
$pdf->SetMargins($leftMargin, $rightMargin, $topMargin);
$pdf->CSSselectMedia = $styleSheet;

if ($styleSheet == 'print' || $styleSheet == 'screen') {
$pdf->CSSselectMedia = $styleSheet;
} else {
unset($pdf->CSSselectMedia);
}

return $pdf;
}
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TypoScript/constants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugin.tx_web2pdf {
# cat=plugin.tx_web2pdf/pdf/5; type=int+; label=LLL:EXT:web2pdf/Resources/Private/Language/locallang.xlf:constants.pdf.topMargin
pdfTopMargin = 15
# cat=plugin.tx_web2pdf/pdf/6; type=options[LLL:EXT:web2pdf/Resources/Private/Language/locallang.xlf:constants.pdf.styleSheet.print=print,LLL:EXT:web2pdf/Resources/Private/Language/locallang.xlf:constants.pdf.styleSheet.screen=screen]; label=LLL:EXT:web2pdf/Resources/Private/Language/locallang.xlf:constants.pdf.styleSheet
pdfStyleSheet = print
pdfStyleSheet = allAndPrint
# cat=plugin.tx_web2pdf/pdf/8; type=boolean; label=LLL:EXT:web2pdf/Resources/Private/Language/locallang.xlf:constants.pdf.useCustomFooter
useCustomFooter = 0
# cat=plugin.tx_web2pdf/pdf/8; type=boolean; label=LLL:EXT:web2pdf/Resources/Private/Language/locallang.xlf:constants.pdf.useCustomHeader
Expand Down

0 comments on commit 2082333

Please sign in to comment.