Does cfdocument handle external stylesheets when g...
# cfml-general
j
Does cfdocument handle external stylesheets when generating from HTML, such as tailwind/bootstrap? If not, does Adobe PDF document services? Are they rendered faithfully in either/both cases?
s
Cfdocument doesn't support external stylesheets as far as I know. I don't know about Adobe PDF document services
also (to answer your third question regarding faithfulness of rendering) with cfdocument, there is a "supported css styles" section on the documentation that specifies what you can do with inline css. https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-d-e/cfdocument.html
j
Thanks, yes, I remember it being pretty limited when I worked with it years ago but hoped they had improved. I'm trying to generate PDF reports now and would like a more elegant and performant solution than "printing" a pdf from Chrome running in an AWS Lambda function.
s
cfhtmltopdf does do things a bit differently though
but probably still doesn't support external css
j
doesn't look like it
d
Upgrading to cf 2018, we found that we had to change cfdocument tags to use localurl="true", and make stylesheet URLs relative. What out for image URLs in stylesheets too. The details aren't completely fresh in my head any more, but check that stuff. We did get all the pdf pages on the site to work though.
m
cfhtmltopdf was supposed to be the improved version of cfdocument I thought. Using it though it's still limited, and a hassle to setup in some environments, as it seems kind of buggy with known issues that I couldn't get much help with. Supposedly they are working on it. Wish it was handled by the package manager in 2021 and not an additional install.
d
CF 2021 does have a package called htmltopdf.
m
Right, I know. Sorry, that's the easy part. You still have to have the CF Addons installed. Just another step that I was having issues with the connectivity in my local environment. Worked fine on our web servers luckily. Adobe didn't have a great answer, but we managed to kind of get it working