segment-boneyard / nightmare

A high-level browser automation library.
https://open.segment.com
19.54k stars 1.08k forks source link

Issues with rendering canvas (Chart.js) in PDFs #1527

Open nukeop opened 5 years ago

nukeop commented 5 years ago

We're using Nightmare in our backend server to convert some pages that feature canvas-based charts to PDF. This works fine for typical HTML content, but the canvas-based charts always stick out of their respective containers. Here's a screenshot of what it looks like:

2019-02-11-163949_665x488_scrot

The white area is the margin. I'm not sure if this is something people working on Nightmare can fix, as I've observed similar behaviour trying to convert one of those pages to PDF using Vivaldi (the browser) and its "print to pdf" feature. Would you happen to know how to mitigate this problem?