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
This is a regression. This showed up when we performed an upgrade, used to work fine with an older version of the package. Unfortunately I don't know which version.
I have create a reproduction of the bug here:
import matplotlib.pyplot as plt
import numpy as np
from weasyprint import HTML
# plotting code
x = np.linspace(0, 10, 100)
y = np.sin(x)
fig, ax = plt.subplots(figsize=(10, 6))
ax.plot(x, y)
# Add annotation
ax.annotate('gyj',
xy=(4.7, 1),
xytext=(5.5, 0.5),
alpha=0.999999 # This is the issue
)
# Save to SVG
plt.savefig('test.svg', transparent=True, dpi=300, bbox_inches='tight', format='svg')
# Read the SVG file
with open('test.svg', 'r') as f:
svg_content = f.read()
# Create HTML with embedded SVG
html_content = f"""
<!DOCTYPE html>
<html>
<head>
<title>Plot Export</title>
<style>
body {{
margin: 0;
padding: 20px;
}}
</style>
</head>
<body>
{svg_content}
</body>
</html>
"""
# Convert HTML string directly to PDF
HTML(string=html_content).write_pdf('plot.pdf')
This is a regression. This showed up when we performed an upgrade, used to work fine with an older version of the package. Unfortunately I don't know which version.
I have create a reproduction of the bug here:
Output is this
plot.pdf
While the svg looks fine:
System info:
System: Windows
Machine: AMD64
Version: 10.0.22631
Release: 11
WeasyPrint version: 62.3
Python version: 3.12.2
Pydyf version: 0.10.0
Pango version: 15003
The text was updated successfully, but these errors were encountered: