You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We (Hammerbacher) would love to continue sponsoring the project, but we need a kind of receipt or invoice. Maybe we can get in touch about that? This issue (of missing receipt) seems to have been forgotten for a while.
[2025-03-21 09:24:40] "POST /convert/html?pdf_variant=pdf/a-3b HTTP/1.1" 500 241 0.050852
ERROR:root:Cannot find SVG dimensions. Width: None, Height: None
ERROR:root:Unexpected error due converting to PDF: float() argument must be a string or a real number, not 'NoneType'
Traceback (most recent call last):
File "/opt/weasyprint/app/WeasyprintController.py", line 40, in convert_html
html = SvgUtils.process_svg(html)
File "/opt/weasyprint/app/SvgUtils.py", line 19, in process_svg
return re.sub(pattern, replace_img_base64, html)
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/re/__init__.py", line 208, in sub
return _compile(pattern, flags).sub(repl, string, count)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/opt/weasyprint/app/SvgUtils.py", line 56, in replace_img_base64
image_type, content = replace_svg_with_png(svg_content)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/opt/weasyprint/app/SvgUtils.py", line 66, in replace_svg_with_png
width, height = extract_svg_dimensions_as_px(svg_content)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/opt/weasyprint/app/SvgUtils.py", line 98, in extract_svg_dimensions_as_px
return convert_to_px(width, width_unit), convert_to_px(height, height_unit)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/opt/weasyprint/app/SvgUtils.py", line 184, in convert_to_px
value = float(value)
TypeError: float() argument must be a string or a real number, not 'NoneType'
Unfortunately, I am not able to upgrade the locally installed weasyprint. So I can only compare the local version 52.5 it with the container version 63.1 here and hope that there is no app code of weasyprint-service container causing the problem.
The weirdest part of this issue is, that the same error appears when rendering with Weasyprint 63.1, if the img tag is commented out.
Shouldn't there be no svg rendering in that case? weasyprint.svg-data-url-problem-commented-out.html.txt
We would be very grateful if someone could confirm, help here or fix this.
The text was updated successfully, but these errors were encountered:
Hello!
We (Hammerbacher) would love to continue sponsoring the project, but we need a kind of receipt or invoice. Maybe we can get in touch about that? This issue (of missing receipt) seems to have been forgotten for a while.
When I POST certain HTML with an data-URL SVG to an instance of a weasyprint-service container (see also Extend WeasyPrint with Rest API and provide it as a service #2194,
"weasyprint": "63.1"
) , I obtain error 500 and the log says:This is the HTML file. It contains barely more than a logo:
weasyprint.svg-data-url-problem.html.txt
Using a locally installed weasyprint 52.5
the HTML can be rendered to PDF without any problem:
weasyprint.svg-data-url-problem.html.pdf
Unfortunately, I am not able to upgrade the locally installed weasyprint. So I can only compare the local version 52.5 it with the container version 63.1 here and hope that there is no app code of weasyprint-service container causing the problem.
The weirdest part of this issue is, that the same error appears when rendering with Weasyprint 63.1, if the img tag is commented out.
Shouldn't there be no svg rendering in that case?
weasyprint.svg-data-url-problem-commented-out.html.txt
We would be very grateful if someone could confirm, help here or fix this.
The text was updated successfully, but these errors were encountered: