Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF failed when highchart axis labels are being cutoff #2030

Closed
pareshbalar opened this issue Jan 2, 2024 · 6 comments
Closed

PDF failed when highchart axis labels are being cutoff #2030

pareshbalar opened this issue Jan 2, 2024 · 6 comments
Labels
crash Problems preventing documents from being rendered
Milestone

Comments

@pareshbalar
Copy link

Hi,

Here is the image of the chart rendered in my HTML. I am using the HighChart.

image

The issue is when the labels are being cut off, weasyprint is not able to export it to PDF.

Getting the below error.

image

Workaround for me
I tried adding a margin to the right side of the chart so that the chart does not cut off and the Weasyprint was able to convert it to PDF.

image

Output PDF:

image

@liZe
Copy link
Member

liZe commented Jan 2, 2024

Hi!

Thanks for your bug report.

Could you please share your HTML file so that we can reproduce the problem?

@liZe liZe added the crash Problems preventing documents from being rendered label Jan 2, 2024
@pareshbalar
Copy link
Author

pareshbalar commented Jan 3, 2024

Here is the HTML. This is a separate HTML with the same error as I handled the above issue with a workaround solution.

chart.zip

Here is what HTML looks like

image

We are first converting web pages to HTML and then converting HTML to PDF using Weasyprint.

Here is the crash log

image

@pareshbalar
Copy link
Author

Hi @liZe , Any update on this issue?

@liZe
Copy link
Member

liZe commented Jan 10, 2024

Any update on this issue?

No, we would have written a new comment otherwise.

@alexandergitter
Copy link
Contributor

alexandergitter commented Jan 21, 2024

In the code you uploaded, the issue seems to be (at least partially) caused by one or more tspan's having their visibility set to hidden.
Here is a much simpler example that crashes in the same way:

<svg width="100px" height="100px">
  <text>
    <tspan x="10" y="10" visibility="hidden">Text</tspan>
  </text>
</svg>

@liZe
Copy link
Member

liZe commented Jan 22, 2024

@alexandergitter Thanks for the simple sample!

I think that this issue is now fixed, feedback is welcome.

(Our current SVG test coverage is poor, don’t hesitate to add new tests if you’re interested!)

@liZe liZe added this to the 61.0 milestone Jan 22, 2024
liZe added a commit that referenced this issue Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Problems preventing documents from being rendered
Projects
None yet
Development

No branches or pull requests

3 participants