Questions tagged [react-pdf]

React renderer for creating PDF files on the browser and server

409 questions
0
votes
1 answer

react-pdf line tag doesn't generate horizontal line

I'm trying to generate a resume using react-pdf. I want to draw a horizontal line under every section title but it doesn't seem to be working. I'm following this example from the docs const Resume = () => { const info = { name: "James Bond", …
0
votes
0 answers

Encountered a TypeError: "a" is read-only, on a deployed web app that views PDF, (used Pdfme package)

This part of our deployed web app, shows an error a TypeError: "a" is read-only, this problem only shows on the deployed web app, the web app on the local host works fine, the problem is only on the deployed web app.the error on the deployed…
0
votes
0 answers

Getting error when using react-pdf library with latest version

Getting the below error when using react-pdf 6^.2.2 version. Its working fine when i am using 4.1.0 version. Module parse failed: Unexpected character '#' (1413:9) You may need an appropriate loader to handle this file type, currently no loaders are…
uma
  • 1
  • 1
0
votes
0 answers

How to get real font names in react-pdf (pdfjs)?

In my web app developed with react, I'm using react-pdf to render the pdfs. With this library, by specifying renderMode="svg" in the props, I get, in the html page, various svgs that represent the characters of my pdf. The problem is that by…
Teo7
  • 47
  • 5
0
votes
0 answers

Why does using a React component for React-PDF just use the literal name instead of the real code?

I imported the react-pdf npm library import { Page, Document } from '@react-pdf/renderer'; And then tried to use it like
Some Guy
  • 12,768
  • 22
  • 58
  • 86
0
votes
1 answer

How do I modify the height and width of the PDF being show in `react-pdf` using tailwind?

I'm trying to render a PDF through react-pdf to a certain width and height. How can I do this by using Tailwind classes? In the screenshot attached, you can see that the PDF is so much bigger than one of the components, which is the same component I…
neil_ruaro
  • 368
  • 3
  • 15
0
votes
0 answers

React-PDF: How to pan and clear canvas?

I am trying to provide pan functionality as well as the ability to clear the page when annotations are made with https://github.com/wojtekmaj/react-pdf. I am using…
usagibear
  • 303
  • 3
  • 12
0
votes
0 answers

enabling scripting in React-pdf

I'm using react-pdf + pdf.js to display pdfs in my app. Everything is working great, but I'm facing a problem I don't know how to solve. Is it possible to enable scripting inside react-pdf? Users are filling documents through my app; sometimes…
0
votes
0 answers

Is there a way to support PDFs larger than 200 inches in wojtekmaj React-PDF and Firefox?

I have an app that converts some files to PDF. When I open the file in Chrome or Edge, it loads, albeit slowly. In Abode Acrobat Reader, it loads the file but truncated. However, the file does not load correctly in Firefox, which uses PDF.js as the…
usagibear
  • 303
  • 3
  • 12
0
votes
0 answers

Not able to retrieve state in react-pdf document

Following the example here https://react-pdf.org/advanced#using-the-usepdf-hook I have a component setup on different tsx file and make it to accept props that will be use in rendering the page. However, I am not able to update the content of the…
olyjosh
  • 431
  • 7
  • 15
0
votes
0 answers

Using react-pdf to open pdf in a new tab

I'm having so much trouble using react-pdf to open in a new tab. I'm making a very simple, one page site with links that I want to connect to various pdfs. I think the webpack loader I'm using is incorrect, although I'm not sure how to find the…
Maveryck
  • 19
  • 3
0
votes
0 answers

How to unit test react-pdf renderer PDFDownloadLink loading/error?

I have implemented a PDFDownloadLink link to download my PDF with the internal error/loading state used to conditionally render different messages. The problem now is... I don't know how to unit test this. Before I introduced the inner section and…
physicsboy
  • 5,656
  • 17
  • 70
  • 119
0
votes
0 answers

React-PDF unknown font format for custom font only when not on localhost server

I have created a PDF with react-pdf that is downloaded on click on the PDFDownloadLink that is generated within the component that hosts it. This works fine when I am viewing things on my localhost express server, however once I have deployed this…
physicsboy
  • 5,656
  • 17
  • 70
  • 119
0
votes
1 answer

Trying to use react-pdf with typescript

I have a React app built with craco that I want to add react-pdf to display PDF files in a react component. I'm getting the following error: I've added the following to the craco.config.js file which apparently replaces the…
bonum_cete
  • 4,730
  • 6
  • 32
  • 56
0
votes
0 answers

How to develop a React PDF Viewer with capacity to select pdf text?

import React, {useState} from 'react' import { Document,Page } from 'react-pdf/dist/esm/entry.webpack'; import './App.css'; function App() { const [numPages, setNumPages] = useState(null); const [pageNumber, setPageNumber] = useState(1); …
Daniel
  • 1
  • 2