diegomura / react-pdf

📄 Create PDF files using React
https://react-pdf.org
MIT License
14.66k stars 1.16k forks source link

Download PDF with dynamic data #1787

Open rasteli opened 2 years ago

rasteli commented 2 years ago

Hi, there!

I'm generating a PDF document with dynamic data from a form. I've managed to render the document on the web successfully and, as soon as the data is entered, the document gets re-rendered with the new data.

PDF Document: PDF Document

Document on the web: Document on the web

The problem, though, is when I try to download the document, what I get is the one with none of the data. I get a blank page. I'm using the usePDF hook to get the instance and the url from it. I pass the url to the href property of an anchor tag. 3

I attempted to use the update function from the hook and the PDFDownloadLink component, but the same problem occurs. Does anyone have some idea on why this is happening?

Next: 12.1.4
React: 18.0.0
@react-pdf/renderer: 2.1.1
diegooa116 commented 2 years ago

Hello, sorry, did you have any problem when you ran the command npm install '@react-pdf/renderer --save' with React 18.0.0 version?

I'm very new to React, and I'm trying to use React-pdf and I haven't been able to install the library.

error React

adamsitar commented 2 years ago

This problem was discussed in https://github.com/diegomura/react-pdf/issues/736

leean613 commented 2 years ago

Hello, sorry, did you have any problem when you ran the command npm install '@react-pdf/renderer --save' with React 18.0.0 version?

I'm very new to React, and I'm trying to use React-pdf and I haven't been able to install the library.

error React im using react 17 to run, i supose react-pdf does not support react18 yet.