- First commit to issue fork.
- Status changed to RTBC
8 months ago 10:32pm 22 March 2024 - πΊπΈUnited States karlshea Minneapolis πΊπΈ
Rebased to get CI working. Just tried and it worked great!
- πΊπΈUnited States freelock Seattle
Great to hear this is working!
I subscribed to this case looking for more modern CSS support than was available in wkhtmltopdf, and thought WeasyPrint might be a good option. However, since then we've started using headless Chrome, which has fairly decent PDF support.
And there is now an entity_print_chrome module β , which has basic functionality working, with the chrome_pdf library.
So now I'm wondering: Should WeasyPrint go into another module, and this module just needs some pointers to the other entity print plugins available?
Or should entity_print_chrome get pulled into this module as a submodule?
I think the big issue here is discoverability -- it took quite some digging to find entity_print_chrome, and I think it should have more visibility, along with WeasyPrint.
If Weasyprint is added to the existing module, will anyone notice and discover it? I'm thinking it will be more noticeable on the project page for entity print...
- πΊπΈUnited States karlshea Minneapolis πΊπΈ
I didn't know about entity_print_chrome until your comment, and I only found out about Weasyprint sort of by accident the other day and was pleased to find a patch to enable it in entity_print. Its output is significantly better than several of the other PDF engines I've tried!
- π¬π§United Kingdom matt b
Just patched using https://git.drupalcode.org/project/entity_print/-/merge_requests/28.patch which applied fine.
At /admin/config/content/entityprint, I get the message
Php Weasyprint is not available because it is not configured. Please install with: composer require "pontedilana/php-weasyprint".
Install weasyprint via composer, check it's installed (it's in the vendor directory), reload /admin/config/content/entityprint and I still get the message (and can't select weasyprint as an engine)
- π¬π§United Kingdom matt b
No it didn't. I just tried to add Wkhtmltopdf as well. Composer installs it fine, but even after a cache rebuild I still have the message that this also is not available. It may be my local enviroment, so I'll keep checking, as this is probably a separate issue.
+1 for separate modules for PDF engines!
- π¬π§United Kingdom matt b
pushed to the next environment and it works fine there! Now I get "The weasyprint binary does not exist at /usr/local/bin/weasyprint"
(also tried /usr/bin/weasyprint). WKHTMLTOPDF is in /usr/local/bin/ so I need to see if I can find the binary on the hosted enviroment or if I've missed a step. - πΊπΈUnited States karlshea Minneapolis πΊπΈ
My production settings is setting
$config['entity_print.print_engine.phpwkhtmltopdf']['settings']['binary_location']
because I needed to install it with pyenv. - π¬π§United Kingdom matt b
So my host (pantheon) won't allow additional binaries to be installed, although they do have WKHTMLTOPDF which is fine but not going to work for me, which means my weasyprint journey ends here. I can either move host or pay for a 3rd party pdf service as none of the entity_print engines work for me.