Blank canvas elements when rendering PDF's in --headless
Reported by
mrski...@gmail.com,
Feb 5 2018
|
||||||||
Issue descriptionChrome Version : 65.0.3312.0 URLs (if applicable) : https://dashboards.cluvio.com/dashboards/wx7y-53qr-pv5o/shared?sharingToken=759d96a5-da83-493c-833e-6b8f694a6189 What steps will reproduce the problem? (1) Ensure you're operating with the --headless switch as this feature is only available in that mode (2) Visit a website/URL with a <canvas> element that contains graphics. (3) Use the PDF method of the remote protocol here: https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF What is the expected result? Canvas elements should print out properly in PDF's What happens instead? Canvas elements are currently printed out as transparent/white. Please provide any additional information below. Attach a screenshot if possible. Originally filed in the puppeteer project here: https://github.com/GoogleChrome/puppeteer/issues/1731 (I'll post a link back to this bug for visibility). Also it appears that the screenshot method properly captures the canvas element's contents. I'm not sure if they use similar rendering means, but wanted to point that out as it could be an indicator. Thanks!
,
Feb 5 2018
Couple more notes: - printing to PDF in regular Chrome works correctly - it is almost for sure not a timing-related issue, as a) waiting very long before rendering does not help and b) rendering screenshot first and pdf second (on the same browser instance via puppeteer) renders screenshot correctly and PDF blank - may be related more specifically to WebGL (used by Mapbox-GL in the link above), as rendering other canvas content works without issue
,
Feb 6 2018
,
Feb 7 2018
,
May 23 2018
We can replicate this issue - see https://github.com/ffffranklin/mapbox-headless-poc for example code of how WebGL canvases render to PDF as transparent images instead of map images. This is also using the Mapbox GL JS library v0.45.0
,
Oct 25
@Ryan I'm also seeing blank canvas elements when rendering PDF's of Mapbox GL JS maps, however when make puppeteer use google-chrome rather than chromium then it's working.
await puppeteer.launch({ executablePath: '/usr/bin/google-chrome' });
,
Jan 17
(6 days ago)
Maybe folks that understand GL accelerated Canvas can help us understand why the print-to-PDF canvases are only blank in headless mode. Whereas normal printing works, and page.screenshot() in headless mode also works.
,
Jan 17
(6 days ago)
,
Jan 17
(6 days ago)
,
Jan 18
(4 days ago)
kbr@, this sounds like it may be WebGL related - are there known limitations you're aware of re. headless WebGL or printing WebGL? Can you help triage? Also, can anyone confirm the specific platforms this happens on. Right now I'm assuming any desktop platform?
,
Jan 18
(4 days ago)
I'm not sure if it's helpful, but this comment in Puppeteer's issue might be a signal to the issue: https://github.com/GoogleChrome/puppeteer/issues/1731#issuecomment-447629436. I've also noticed that doing a <canvas>toDataURL() call doesn't work unless the drawing buffer is preserved (in _headful_). I'm not sure if that's intentional or not.
,
Jan 18
(4 days ago)
It's per specification that WebGL-rendered canvases drawn to other ones, read back, or having toDataURL done against them once they're composited returns a blank canvas with preserveDrawingBuffer:false. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by skyos...@chromium.org
, Feb 5 2018Status: Untriaged (was: Unconfirmed)