Skip to content

Hidden canvas not being printed #159

@sprietNathanael

Description

@sprietNathanael

Hi!
I'm using your module to print custom components that are not displayed. I hide the component's container and pass the ref of the inner component. It works greatly, and allows me to make a print version of what is displayed.
I'm trying to print charts from chartjs lib. I put the chart in the inner component, but when I try to print, nothing happens and I got this error :

index.js:111 Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
    at HTMLIFrameElement.f.onload (http://localhost:3000/static/js/0.chunk.js:300198:45)

Do you have any idea on how to print canvas elements that are not drawn?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions