Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Ciaran Evans
    @ciaranevans-xydus
    Morning folks :D Me again - does weasyprint respect max-height/max-width of images?
    In HTML previews, these tags work, but it seems like the PDF images are always bigger
    image.png
    HTML Preview ^
    image.png
    PDF ^
    With:
    img { max-width: 100%; max-height: 250px; width: auto; height: auto;}
    Guillaume Ayoub
    @liZe
    I think it should work, let me try
    Oh, I think I know what’s happening
    Is the image in a table?
    Ciaran Evans
    @ciaranevans-xydus
    It is
    Guillaume Ayoub
    @liZe
    Then the width of the columns can be different depending on the browser, as it’s not defined by the specification. So, max-width: 100% can give different results, as it depends on the column’s width.
    You can use a smaller max-height if you think that the second photo is too tall.
    Ciaran Evans
    @ciaranevans-xydus
    Well that second image is definitely stretched out
    Joerg Sonnenberger
    @jsonn
    a customer of mine is interested in sending out PDFs with some basic forms (text box, checkboxes) from my application. we don't use weasyprint in that part of the application for HTML->PDF conversion yet, but there are some long term plans in that direction, pending support, of course. so the question is: would this support materialize with throwing some money at the problem and what kind of money would that be? :)
    Lucie Anglade
    @grewn0uille
    Hi @jsonn,
    Currently there is nothing planned to have form support in WeasyPrint, but throwing some money at it would make that happens :) If you’re interesting in sponsoring this feature, can you give us a email adress so we can discuss about it?
    Guillaume Ayoub
    @liZe
    That looks fun, thanks for sharing!
    Thomasb81
    @Thomasb81
    The project use headless chrominium + skia patch to render any html page to svg
    There is some additionnal information in the first issue on the github project.
    Alexander Neilson
    @AlexanderNeilson
    If you are seeing slow generation of reports or significantly larger output files make sure you are running 57.1 and not 57.0. I haven't seen a reference in the changelog to this (but I could easily have missed it) but we had experienced both massively longer generation time and file sizes that resolved after moving to 57.1 from 57.0. (12 page report with 22 images and an SVG logo normally generates in ~20 seconds and file size about 3.5MB was taking ~3 minutes and 20 seconds and was generating a file about 32MB)
    goodwill
    @goodwill
    Hi guys
    just wondering if there is a way for weasyprint to output an image file thats just fit the html raw size, without limiting it with print page canvas (e.g. A4)?
    Alexander Neilson
    @AlexanderNeilson
    if you have your sizes all specified then you could specify the dimensions of the "page" instead of using the set page sizes
    Guillaume Ayoub
    @liZe
    @AlexanderNeilson is right, you can change the page size in the @page block. But if you’re looking for a dynamic page size, it’s not implemented (you can take a look at Kozea/WeasyPrint#193)
    danedb
    @danedb
    Hello! I'm trying to generate a variant pdf/a-2b with weasyprint 57.1 and I cannot solve one final validation failure (I validate the pdf with verapdf). Fault description is "Except for annotation dictionaries whose Subtype value is Popup, all annotation dictionaries shall contain the F key." and the errorMessage is "A dictionary of Link annotation does not contain F key"... Any ideas of what I can do to fix this?
    Guillaume Ayoub
    @liZe
    Hi @danedb
    Could you please share the HTML document (you can send a mail to contact@courtbouillon.org if you don’t want it to be public)
    24 replies
    Alexander Neilson
    @AlexanderNeilson
    Has anyone found a reason why some PDF's generated from weasyprint with optimise images enabled return smaller file sizes while others blow out in size?
    we are currently investigating an issue where some reports we generate with ~45 images in them totaling between about 15 and 18 MB on disk sometimes produce a final PDF of ~6MB and sometimes ~77MB
    I haven't yet been able to confirm this is always a common factor but so far I can only see that one file's original extension was JPG and the others was JPEG however I do not expect that to cause a difference in behaviour as it appears weasyprint's image functions decode data from a URI as bytes.io from the string so the original file extension is potentially not even known
    Alexander Neilson
    @AlexanderNeilson
    confirmed file extension has no impact on the size generation
    Alexander Neilson
    @AlexanderNeilson
    For anyone playing at home it appears to be caused by two additional EXIF dimensional tags that were not changed during a resize earlier in the workflow
    image.png
    So while this was correct here
    image.png
    These ones further down showed the original taken dimensions of the image before it was resized. My working theory is that Pillow internally makes the larger "image plane" and then when the smaller image is read in a sort of "crop box" operates around it and therefore lots of space is reserved inside for what turns out to be a very small image
    Guillaume Ayoub
    @liZe
    Hi!
    Could you please share an example in a bug report so that we can investigate and fix this problem?
    11 replies
    bnrc
    @benjamin.richter:fachschaften.org
    [m]
    salut, i came to ask for help with the grid property, but meanwhile i found issue #543 and blogposts about rodmaps etc. 😅
    Guillaume Ayoub
    @liZe
    Hi! Grid support is a kind of running gag: each time we hope that we’ll find the time to implement it in the next version, and each time we get a new sponsored feature instead 😁️
    bnrc
    @benjamin.richter:fachschaften.org
    [m]
    :point_up: Edit: salut, i came to ask for help with the grid property, but meanwhile i found issue #543 and blogposts about roadmaps etc. 😅
    Guillaume Ayoub
    @liZe
    :)
    Tolibjon Komiljonov
    @tkomiljonov:matrix.org
    [m]
    Hello
    katex isn't working
    I think the fonts are not working
    I tried to correct the font and I looked everywhere for a solution to the problem
    but it's not fixed