1

in my use case, I have maps generated using the react-simple-maps component, I need to generate the pdf of this map, I'm trying to do this using the @react-pdf/renderer component, but it's not working!

React-pdf

React Simple Maps

See the example on CodeSandbox!



Can anyone who works generating maps with react-simple-maps and manages to generate the pdf using @react-pdf/renderer or any other component, can you point me to a solution to solve this problem?

I thank you for your help!
Cleiton Freitas
  • 387
  • 7
  • 18

1 Answers1

0

Generally you are dependent on the users browser unless you use one of your servers browsers. Here I am saving the Demo as PDF However there are a few oddities the Site is trying to send as 3 pages so I need to select 2 of 3 (1 and 3 are blanks) As with ALL PDF outputs the browser needs to Download and then send to the viewer I don't always use the inbuilt Acrobat Browser Viewer (its exploitable) so this map opens safely outside the browser.

j58g73ru93q5o459g7wi6m37y

If you save the SVG on the server and run say a headless print it should behave correctly as a single page

enter image description here

K J
  • 8,045
  • 3
  • 14
  • 36