Weasyprint support

Created on 15 January 2019, over 5 years ago
Updated 25 March 2024, 3 months ago

WKHTMLTOPDF is pretty much the most versatile library out there. However, I find it a bit limited when you need to make advanced customization.

So I looked for something else that could cover all of my requirements (header, footer, page#, TOC, Frontpate, SVG, custom fonts) and found weasyprint. It seems to be exactly what I was looking for, but it's not very php oriented. In fact it's pretty much like WKHTMLTOPDF, that is coded in c++.

Hopefully, there's PHP_WKHTMLTOPDF for that, but a PHP_WEASYPRINT library would be very useful too.

Anyhow, I don't have a solution, I just wanted to propose this alternative. Thanks.

✨ Feature request
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada JFKiwad Montreal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Merge request !28Issue #3026158: Weasyprint support β†’ (Open) created by kitikonti
  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 224s
    #126679
  • Status changed to RTBC 3 months ago
  • πŸ‡ΊπŸ‡Έ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!

Production build 0.69.0 2024