Questions tagged [react-pdf]

React renderer for creating PDF files on the browser and server

409 questions
0
votes
1 answer

react-pdf fixed footer text disappears when I change fontSize

Using react-pdf with n number of pages, so I have a fixed footer with page numbers. When I change the fontSize the page number disappears when using the render prop. The first page does not use the render prop and that text will display no matter…
bonum_cete
  • 4,730
  • 6
  • 32
  • 56
0
votes
0 answers

CRA 5 and react-pdf: PDF won't load

I'm using react-scripts@5.0.1 and react-pdf@5.7.2. No matter what I try I can't get it to load a pdf. Originally I had the following setup, which was working with react-scripts start, but would fail on build with the following error: Module not…
0
votes
0 answers

React 18 react-pdf/renderer - "Can't resolve 'stream'"

I just started a new project with create-react-app (React 18). After installing react-pdf/renderer library, having the following error: ERROR in ./node_modules/blob-stream/index.js 1:21-47 Module not found: Error: Can't resolve 'stream' in…
0
votes
1 answer

PDF viewer not working when set the file data as Base64 using React

I am trying to display the PDF file in my react page using "react-pdf"package. I am getting the correct base64 file format from the Rest APi call, but file is not showing in UI.Once i get the data from API, the display message changed to Loading…
0
votes
1 answer

What is the best way to export a report to PDF in ReactJS

I have a reports app that runs ReactJS on the client-side and NodeJS on the server-side. The app displays a report and contains content like Tables, Graphs, SVGs and more. I want to export this report to PDF with a proper layout with the click of a…
0
votes
0 answers

AWS bucket can't show pdf files on specific routes

My nextjs app (v12.1.3) allows users to upload files. The server stores them in an AWS s3 bucket. I store them in this way: import _ from 'lodash'; import AWS from 'aws-sdk'; import { v4 as uuidv4 } from 'uuid'; import { config } from…
Loudrous
  • 1,039
  • 10
  • 29
0
votes
1 answer

how can i upload react-pdf/renderer displayed pdf to aws s3 storage and download that pdf using s3 link

hello guys i am rendering a pdf on my react application using react-pdf/renderer react pdf and now i want to upload that rendered pdf directly to the aws s3 storage I have successfully made an api to upload files to s3 storage and its working fine…
0
votes
1 answer

React PDF not rendering PDF in IOS 15.5

I am using react-pdf to render a pdf in a react application which is then rendered via WebView in ios and android. The pdf render works in android. In ios, I am getting this error Total canvas memory use exceeds the maximum limit (224 MB). …
0
votes
1 answer

Upload react-pdf dynamically generated file to Sanity using NextJS

I'm working on an e-commerce app built on NextJS and Sanity, so far I've made some mock products with all the necessary requirements, a user login system and checkout. I've been trying to make an invoice system so that when the user confirms an…
dominus
  • 11
  • 4
0
votes
1 answer

How to view PDF doc from Firebase storage in React using react-pdf?

I would like to view a pdf file from firebase storage in my React app, the problem is I would like to view the file after the page is loaded and the 'getDownloadURL' firebase method is async. I tried to do something like this: const MyPage =…
Nadav Holtzman
  • 210
  • 4
  • 13
0
votes
1 answer

react-pdf changing page on a pdf cause the page to scroll all up

I'm using react-pdf (github link) to display a pdf on my react app. This is the code: import { useColor } from '@/hooks'; import { ArrowLeftIcon, ArrowRightIcon } from '@chakra-ui/icons'; import { HStack, Spinner, Text, VStack } from…
ste
  • 3,087
  • 5
  • 38
  • 73
0
votes
1 answer

Output of react-pdf/renderer not compatible with pdf-lib

I am trying to render a PDF into memory using @react-pdf/renderer's pdf method then feed the resulting bytes into pdf-lib's PDFDocument object. The reason I'm doing this is because react-pdf doesn't allow for embedding (merging) other PDFs and the…
asdf
  • 2,927
  • 2
  • 21
  • 42
0
votes
0 answers

created pdf doesn't display in production build and dev build page, but locally it works well

Describe the bug I develop a PDFfile and display those PDFfile by using PdfViewer on a page. When I develop on a local, it works well. But When I build a page, PDFViwer and any Pdf don't display. I don't know how to fix this. In the production page,…
MIAㅜ_ㅜ
  • 71
  • 1
  • 7
0
votes
1 answer

Is there a way to apply background color to files while loading in iframe?

I am getting the pdf URL from an API which needs to be shown in an iframe. The pdf is getting loaded but it is taking the background color as black (probably the default browser color). Tried adding allowtransparency="true" style="background-color:…
0
votes
2 answers

How do you import Javascript file from node_modules into react using Vite?

How do you load a static asset from node_modules in my case pdf.js (from the build folder of node_modules) so I don't have to set the version every time I update it. I am migrating from Webpack to Vite, so this is how I use it in my webpack project…
William Zink
  • 189
  • 4
  • 15