mittwald / typo3-web2pdf

A TYPO3 extension for rendering content as PDF
GNU General Public License v2.0
18 stars 20 forks source link

How to work with this setting: plugin.tx_web2pdf.settings.pdfStyleSheet = print #6

Closed kurtkk closed 9 years ago

kurtkk commented 9 years ago

What does it mean?

in Typoscript an own includeCSS with media = print!? page.includeCSS { file2 = ... pdf.css file2.media = print }

OR / AND

in the main.css file a part like this: @media print { #mm { display:none; } }

Both don't work!?

kpurrmann commented 9 years ago

Following setup should work:

page.includeCSS.test = test.css
page.includeCSS.test.media = print

test.css:

#mm {display:none;}

With TypoScript option: plugin.web2pdf.settings.pdfStyleSheet you can change media of chosen stylesheet to screen or all. Default one is print.

kurtkk commented 9 years ago

So it only works if you have enclosed the css-items with @media print { … }

without @media print { … } you have to rename the css-file to print.css!

kurtkk commented 9 years ago

Sorry, I wouldn't close this issue! ;-)

kpurrmann commented 9 years ago

It seems that the @media instruction in external files is ignored by mPDF library. Therefore you should use an own external stylesheet for printing. Like I wrote before, you should include it media type "print". In this file there is no need for the @media statement.

topfender commented 9 years ago

I tried it like this: TS: page { includeCSS { print =[...]/Resources/Public/Styles/print.css print.media = print } } plugin.web2pdf.settings.pdfStyleSheet = print

print.css:

But my PDF ignores all styles. What am I doing wrong?

kpurrmann commented 9 years ago

@topfender Did you include the static template?

topfender commented 9 years ago

yes web2pdf

kpurrmann commented 9 years ago

Which TYPO3 Version do you use?

topfender commented 9 years ago

6.2.14