Questions tagged [react-pdf]

React renderer for creating PDF files on the browser and server

409 questions
0
votes
1 answer

How to send an image generated dynamically of a

I am working on a Reporting App with React, I am using Recharts to generate some charts then I need to include them in the final report generated with react-pdf and to do so I need them in png/jpg format. In order to do so, I have created a function…
0
votes
1 answer

react-pdf throwing Rendered more hooks than during the previous render

I'm implementing react-pdf to show a pdf within a web view. The react app works with Typescript and Next if that helps in any way. So far, this is my code const MyPage: NextPage = () => { // some code here const [numPages, setNumPages] =…
Emipad
  • 35
  • 1
  • 8
0
votes
0 answers

im using this @pdftron/webviewer for rendering a pdf file and used react-pdf ass well but getting error

Why am I getting this error? And I used another library react-pdf but it shows "failed to load pdf file". and I am fetching a pdf file from aws bucket .but it showing this error i attached a photo of error as well please do help me out…
0
votes
2 answers

Is there a way to disable `user-select: none` in react-pdf?

I would like to allow users to copy and paste text from PDF documents. However when I inspect the page (with Chrome dev tools) where we are rendering the PDF document, I notice there are styles that set user-select to none. I can't find anything in…
0
votes
0 answers

React-PDF unable to load PDF file

I'm following the tutorial here for React-PDF I essentially added the sample github repository to my codesandbox. My CodeSandbox file is linked here in my codesandbox I've created a page with the PDF to be displayed at https://ynk0g.csb.app/ But I'm…
Katie Melosto
  • 1,047
  • 2
  • 14
  • 35
0
votes
0 answers

Download PDF from link and display it

I have backend link which I click (or pass it to tag) it starts downloading. How can I display i? I dont want users to be able to download it, just want to display it in my react component. I already tried something like this: async function…
rm98
  • 1
0
votes
1 answer

React-pdf rendering affecting the whole UI Thread

I'm using react-pdf to render a pdf. The rendered pdf will change as I type on an input field. The process goes like this... First, when the input field changes, it triggers setBlobData setBlobData: async (template) => { try { let…
deymbwoi
  • 125
  • 3
  • 10
0
votes
1 answer

How to nicely generate and display a picture of a PDF on the screen using React-PDF?

I am trying to create a user-interface in Javascript (React) that allows users to generate PDFs on the screen. The idea is having input boxes on the left, which when filled in, immediately populate the fields on the PDF on the right. I am currently…
Pythoner
  • 460
  • 6
  • 23
0
votes
2 answers

how to convert to application/pdf response to file in axios?

I'm getting response from the API in application/pdf response type. I need to convert this to file or base64 format to show a the file in react-pdf library. How can I achieve this? Any help will much be appreciated
Rajath
  • 2,611
  • 8
  • 27
  • 43
0
votes
1 answer

Re-rendering issues when loading all pdf pages in "react-pdf"

I am trying to load all the pages but it goes into infinate loop(basically re-rendering). React.memo is not helping me here. const PdfRender = React.memo(({ pdfURL, pages, setPages }: any) => (
0
votes
1 answer

Displaying multiple PDF files in reactjs

I am new to react and I have multiple pdfs that I am trying to display depending on the link selected. I have managed to display a PDF from a selectable list of links of my PDFs stored inside the src directory. However, the same pdf appears for all…
tanaka98
  • 1
  • 1
0
votes
1 answer

How do I upload pdf file/blob to S3?

I'm using react-pdf library and it generates me a blob and url as shown in the docs: https://react-pdf.org/advanced#on-the-fly-rendering Blob object copied from the console: {blob: Blob} blob: Blob size: 3597607 type:…
Karolis
  • 143
  • 3
  • 12
0
votes
0 answers

Webpack large bundle size with duplicate modules

I see a huge increase in bundle size in my react app, and there are 13 bundles, each one about 3Mb, and they all share react-pdf and material-ui. I have no idea how to solve this, the app works but I am concerned. source-map-explorer output : Here…
0
votes
1 answer

react-pdf on server side

I am trying to use react-pdf to create pdf document on the server side. However on running my express server I get this error ^ SyntaxError: Invalid or unexpected token at Object.Module._extensions..js…
qwas
  • 77
  • 8
0
votes
0 answers

How to open the fast a large PDF file from Amazon bucket s3 in ReactJS

I have solve cors issue from S3 bucket . it is my cors settings [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "PUT", "POST", "DELETE" ], …
Asliddin
  • 13
  • 4