Reputation: 47
I am working with a data entry and reporting app built in React JS. After data entry is complete 5 different graphics are generated which are currently separate pages. I am looking for a way to turn those pages into a downloadable PDF. I have seen a few methods of converting React to PDF including Canvas to JPG to PDF and React-to-pdf but im not sure which option would actually work best for what I'm trying to achieve. I need each graphic to populate on its own page and shrink to fit on one page. The PDF should also be sized for A4 paper in portrait orientation.
Any advice on this or tutorials would be greatly appreciated.
Upvotes: 0
Views: 851
Reputation: 46
I would try to create a page with separate A4 size sheet for each graphics on the same component and then use some framework or existing library to generate the pdf.
You can try https://react-pdf.org/
Hope it gives some inspiation!
Upvotes: 1