Include a print CSS file? (restarted thread)
-
Restarting this thread, as our formatting was thrown off by posting CSS snippets. ??
Sorry for the slow response, Ellyn; have had my head in some work which does not seem to be letting up… (Yes, work is good; it just makes stuff like this more difficult!)
Some items, in order:
Do you happen to have a list of supported TCPDF CSS? I can’t seem to find anything in my searches, and it’s like trying to find a needle in a haystack and testing to see what works.
Unfortunately, no, I do not. I do know that from the changelog, we have picked up text transforms since 6.0.043. The latest development build of the plugin includes TCPDF 6.0.062 which is current as of the date I uploaded that build (FWIW).
Just for the heck of it, I tried to include an @import url(“…/style.css”) without any success. Have you tried that? It would be an easier way than copy/paste.
Agreed, that it would be good to figure out a way to support this, and no, I have not tried (though I am not surprised that it did not work). That said, thinking on it now, I should be able to make this happen (you may recall that we talked about using external stylesheets when we started discussing the whole CSS feature). Again, this is no guaranty that TCPDF will obey, but it would prove less tedious than entering all of that code again (and a shortcode could be used to override the admin setting).
It appears that what can be done with CSS is very limited with TCPDF.
??
Can you tell me where it is going to look for images?
This is defined in
tcpdf/config/tcpdf_config.php
and is set to''
(hmmm…). K_PATH_MAIN is set toWPPTOPDFENH_PATH.'/tcpdf/'
so you might want to try (for now) using that directory (the tcpdf directory under the plugin – for everyone’s edification), and I’ll see what happens by setting K_PATH_IMAGES to something more useful, such asWP_CONTENT_DIR . '/uploads/'
as a default, and adding an option for that in the admin UI.Also, it appears that the fonts configured in the settings are being applied after the CSS. Can you please verify?
I’ll look later and give you something more definitive. I believe that TCPDF prioritizes HTML over CSS. Are you finding that your CSS for the font size (in your example style tag) is being overwritten or ignored, or is there some other font issue happening?
Thanks so much for all of this. Sorry you’re still having so many issues, but your testing is invaluable (I can’t make it better if I don’t know what’s broken!).
Cheers
Lewis
https://www.ads-software.com/plugins/wp-post-to-pdf-enhanced/
- The topic ‘Include a print CSS file? (restarted thread)’ is closed to new replies.