react-to-pdf icon indicating copy to clipboard operation
react-to-pdf copied to clipboard

blank pdf generated in production

Open Razi321 opened this issue 4 years ago • 1 comments

in development everything work fine but in production i only see a blank page

const ref = React.createRef();

<div>
// code of the ui that will be printed 
</div>

<Pdf targetRef={ref} filename="code-example.pdf">
        {({ toPdf }) => <button onClick={toPdf}>Generate Pdf</button>}
 </Pdf>

Development : Screen Shot 2021-01-16 at 16 54 32

Production : Screen Shot 2021-01-16 at 16 54 41

Razi321 avatar Jan 16 '21 08:01 Razi321

Try using the latest version, probably some html2canvas dependency related https://github.com/ivmarcos/react-to-pdf/releases/tag/0.0.14

ivmarcos avatar May 18 '21 22:05 ivmarcos

I'm getting blank PDF even in development mode, Webpack 4.

pranav-inaira avatar May 15 '24 18:05 pranav-inaira