mittwald / typo3-web2pdf

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

pdfStyleSheet "print" does not work #25

Closed derpepe closed 8 years ago

derpepe commented 9 years ago

Hi there,

I use the following configuration, created by the constants editor:

plugin.tx_web2pdf.settings.pdfStyleSheet = print

The print-Stylesheet hides the navigation, but the navigation is present in the PDF. It is not present if I print the page, so the Print-CSS is working correctly.

The generation of the PDF works, so Web2PDF should be installed correctly.

Is this a bug in Web2PDF? Does anyone else have this issue?

Peter

derpepe commented 9 years ago

I just came over #6 which is kind of related.

I use TYPO3 6.2.14.

The following CSS-Files are included in the webpage:

<link rel="stylesheet" type="text/css" href="/typo3conf/ext/xxx/Resources/Public/styles/main.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/typo3conf/ext/xxx/Resources/Public/styles/print.css" media="print" />
zitschmedia commented 9 years ago

Hi Peter, same issue here with TYPO3 6.2.1.5. I tryed all versions but no solution up to now. Did you find any workaround?

derpepe commented 9 years ago

Hi, not yet. I guess we'll have to investigate.. :-/

zitschmedia commented 9 years ago

Hi Peter in my case it helped to disable compression of the print.css: printlayout.disableCompression = 1

derhansen commented 8 years ago

Any news on this issue? I have the same problem. Installed extension on a very basic TYPO3 installation, added a custom CSS file for "print", but CSS styles seems to be ignored completely.

Any suggestions?

kpurrmann commented 8 years ago

I could find out, that the mpdf library has problems to load multiple css resources.

For example if you use an main.css and an additional print css to set your print layout mpdf only uses the print css and ignores the main.css.

One workaround could be to copy your main.css to print.css plus your additional styles. I know that this is not a good way but solved the problem.

But I will have a look at it and find a better solution.

kpurrmann commented 8 years ago

Figured out that this weird behaviour is caused by mPdf attribute CSSselectMedia. Instead of setting it to "all" I have to unset this attribute.

Now it seems that css is handled the correct way. If you change the settings to "print" or "screen" only these stylesheets are used.

Started pull request.

st4lker104 commented 8 years ago

this fix works just fine! Thanks a lot :)