React Generating pdfs on components

Viewed 118

I want to be able to generate a pdf of the page. It needs to satisfy a few requirements

  1. It must maintain the same styling (What is displayed on page must be what is displayed on pdf)
  2. The pdf that is displayed/generated must be in letter size format (8.5in x 11in)

I've looked at a few libraries, but have not found one that meets these conditions

  1. react-pdf - This allows you to state a paper size such as "A4" and it does meet condition 1. But it has limitations in that it forces you to use their basic components. You cannot put div and I imagine any other things generated by other libraries.

  2. react-to-pdf - This will let me place my own components inside the pdf and it seems to let you choose paper size. However, it does not meet condition 1, and things may get cut off.

If anyone can chime in, I would greatly appreciate it. Thanks!

0 Answers
Related