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

Black pages PDF file download after 10 pages

Open SaadAli11 opened this issue 2 years ago • 2 comments

I downloaded PDF of table DataGrid in Nextjs and after 10 pages or 500+ rows in the table, the pdf shows the black pages. I also attached the PDF file. movement.pdf

SaadAli11 avatar Jan 23 '24 09:01 SaadAli11

There is a limitation on the size of the canvas in the browser which is used internally to generate the image included in the pdf, which is probably the cause here. So it's not suitable for a large number of pages, unfortunately. You can try decreasing the resolution as a workaround.

Similar issue: https://github.com/ivmarcos/react-to-pdf/issues/83#issuecomment-1729683593

ivmarcos avatar Jan 30 '24 02:01 ivmarcos

I'll include this in the README soon as an important note.

ivmarcos avatar Jan 30 '24 02:01 ivmarcos