React renderer for creating PDF files on the browser and server
Questions tagged [react-pdf]
409 questions
8
votes
1 answer
Error: stream.push() after EOF in react-pdf
Im trying to open a pdf document using react-pdf
const PDFDocument = () => {
const [PDFData, setPDFData] = useState(() => {
const data = localStorage.getItem('pdfData')
return JSON.parse(data)
})
useEffect(() => {
…

Chris Carr
- 105
- 1
- 8
8
votes
2 answers
@react-pdf/renderer. How to generate PDF and download it
I managed to generate the pdf document and show it on the page but I am struggling to setup an option to download it.
It is possible to setup something like click here to download the document?
Please refer to the code below:
import React,…

Ronildo Braga Junior
- 455
- 1
- 4
- 15
8
votes
2 answers
Zoom in/Zoom out using React-PDF
In my ReactJS application I need to add the functionality of zoom in/zoom out. I am using react-pdf to display PDF in my web app. A/C to the documentation there is a scale prop by using which I can scale the pdf page.
But using scale prop doesn't…

Rahul
- 5,594
- 7
- 38
- 92
7
votes
3 answers
react-pdf in nextjs is not letting to make build
I am using react-pdf and react-pdf/renderer in nextjs after creating the file and adding the code it works perfectly but when I make the production build it continues to make the build and never stops.
here is the code
import React from…

Noman
- 594
- 1
- 18
7
votes
2 answers
How to add recharts to react-pdf
I am using 'recharts' to create graphs for my project,
and 'react-pdf' for generating a report.
'Recharts' creates a svg on the DOM when using it and a graph is displayed.
Is there a way I can use these two together, and add my 'recharts' component…

Daniel Cohen
- 121
- 1
- 7
7
votes
2 answers
react-pdf generation is very slow in combination with umijs
I included react-pdf in a fresh umi project:
PDF-Generation 150 Text-components took arround 311.44 ms without umi
Using umi: 7179.40 ms
Every single element takes about 10X more in umi projects!
Code example I tried
import React from…

mleister
- 1,697
- 2
- 20
- 46
7
votes
0 answers
Insert the QR code generated into pdf document in react-pdf/renderer
I'm currently using both QRcode.react to generate the codes and @react-pdf/renderer to create the pdf document.
var QRCode = require('qrcode.react');
< QRCode value="http://facebook.github.io/react/" />
Problem: The QR code only works when…

CHENG LAM HOE
- 71
- 1
6
votes
3 answers
How do I fix garbled text in my react-pdf viewer?
I have created a pdf viewer using react-pdf. When I display certain pdfs, the text is choppy and unreadable. I have tried zooming in and out of the document and it is choppy in different ways at different scales. Sometimes the text even looks okay…

Malcolm G
- 504
- 5
- 11
6
votes
4 answers
How to render an svg logo in React-pdf document in the dom?
I have a project, where I am using React-pdf to generate a document. I want to add an SVG logo to this document. According to the React-pdf documentation, they have an element called
Svg that is a container that defines a new coordinate system and…

Sorin
- 111
- 1
- 6
6
votes
1 answer
react-pdf: use PDFDownloadLink asynchronously without blocking the rest of the application
I'm using PDFDownloadLink from the react-pdf package to generate a PDF on the fly in my application and allow the user to download a report based on data being passed to the component that generates the PDF document. However, there are more than 400…

JohnRDOrazio
- 1,358
- 2
- 15
- 28
6
votes
0 answers
How to render a recharts graph in a pdf using react-pdf
I have been using the recharts library for the dashboards in a NextJs app and a new requirement came through to download tables and charts through a PDF.
On the github for the react-pdf there was an issued raised that has now been closed due to the…

Leonardo
- 183
- 2
- 6
6
votes
0 answers
Add annotations to react-pdf and get coordinates of annotations with respect to pdf
I have a requirement where I have to open an existing pdf in a canvas and draw resizable and draggable rectangles in the pdf and get coordinates of these rectangles drawn.
This is my code to display the pdf.
import React, { PureComponent } from…

Elaine Martis
- 61
- 1
- 3
6
votes
2 answers
How to convert PDF to Image in ReactJS
I am developing a course platform using ReactJS. When the user finishes a course he can download the PDF file.
I need a version of the same file as an image (png or jpg), but I haven't found any way to do that. Can someone help me?
To generate the…

Lucas Lopes
- 1,373
- 3
- 14
- 23
6
votes
1 answer
React pdf downloads blank
I am using React hooks and the react-pdf from react-pdf
I tried 3 different React pdf converters, and this is the one that has been working best so far. It still isn't working great tho - I can't see how to make it not either run out of memory or…

Davtho1983
- 3,827
- 8
- 54
- 105
6
votes
1 answer
Can I set PDF resolution (pixels per inch) in react-pdf?
Some background:
There is no native pixel resolution for a PDF document. This is because PDF documents are scaled using inches. Each PDF viewer then determines how many pixels it will display per inch (e.g. Adobe Acrobat is 110px/in).
My…

sookie
- 2,437
- 3
- 29
- 48