Questions tagged [react-pdfrenderer]

38 questions
0
votes
0 answers

Could not resolve font for Arial,Helvetica,sans-serif, fontWeight 400. error in react-pdf/renderer library

react-pdf/renderer library throws error Could not resolve font for Arial,Helvetica,sans-serif, fontWeight 400 i'm getting this error only in production environment in local environment it is working fine. also i can't find the CDN or font file for…
kryptonian
  • 97
  • 1
  • 12
0
votes
0 answers

dispatcher.useInsertionEffect is not a function (react 18.2 and react-dom 18.2)

I'm trying to use the package react-pdf. const SummaryTable = () => ( Test ); return ( <>
0
votes
0 answers

React-pdf/renderer not uploading image from Plotly

I have an image from base64 data string I am generating from Plotly that I want to include as the src attribute in the Image tag. I am able to get the base64 data string but when I render the Image tag nothing shows up. This is the base64 string…
0
votes
0 answers

I am getting 'Page Unresponsive', when I am trying to render my pdf using react-pdf/renderer

here are my library versions: "@react-pdf/renderer": "^3.1.12", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", "web-vitals": "^2.1.4" I am sure enough that all the props passed in the below mentioned file are 100% correct in…
0
votes
1 answer

ReactPDF renderToFile not rendering arabic text

I'm trying to render PDF to file but the arabic text in the PDF displays as some encoded text like *BFJ) 'DE9DHE'*, 1'4/ 'D9H6J, *0C1) EF, etc.. -- API -- import { renderToFile } from '@react-pdf/renderer'; import TicketDownloadPDF from…
buga
  • 367
  • 2
  • 15
0
votes
0 answers

Unable to show PDF file on the webpage

I tried to use @react-pdf/renderer NPM library to embed my resume on my portfolio site. However, my resume wasn't shown correctly, as shown below: It shows only a blank page. I have checked my code again and again but couldn't spot any error. Click…
0
votes
0 answers

Facing issue to download a proper aligned pdf using the package "React-pdf/render"

I created a HTML doc using the react-pdf/render package and followed the steps mentioned in the documentation. However, when trying to download my component, I am facing an issue with downloading the correct PDF in a properly aligned way. This may…
user20663233
  • 11
  • 1
  • 2
0
votes
0 answers

React-ChartJS-2. Not Rendering in PDFViewer

I want to render the chart generated by the Bar component inside the PDFViewer but it is not working. It will display an error "Failed to create chart: can't acquire context from the given item ". I just copied the example data from the [Chart JS…
0
votes
0 answers

Run a List of Dynamic commands using Invoke-Expression in powershell

I have a PowerShell script which I am invoking to generate few pdf files the script is invoking node js script which is generating pdf files using react-pdf but issue is if one pdf generation failed it don't move on to next file on the list as I am…
Anwar Javed
  • 325
  • 3
  • 11
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/renderer throwing "Unknown font format" after build despite seeing the path to my font

Using react-pdf/renderer I am registering a font file that I have included in my src/fonts directory, however when loading the page on my environment it's throwing the dreaded Error: Unknown font format error causing my link to not…
physicsboy
  • 5,656
  • 17
  • 70
  • 119
0
votes
1 answer

How to Use Chart.js or recharts in react-pdf/renderer

I want to create pdf using react-pdf ,but for charts/graphs i have to use Chart.js or recharts ,but directly i can not implement into react-pdf , another option i have seen from a qs: How to add recharts to react-pdf but here html-to-image( const…
0
votes
0 answers

How to use update function of usePDF in react-pdf package

When the user clicks on download pdf I want to show the corresponding date and time. This below code shows date and time when the file first loaded in application not when the user click on download. How to show current timestamp in pdf?(when the…
sumeeth
  • 93
  • 5
0
votes
1 answer

Hide View in @react-pdf/renderer

If I want to hide a text on the last page of the pdf we do this: pageNumber === totalPages ? '' : 'Show this text' } /> I am trying to hide a view on the last page,…
Nimra Haider
  • 119
  • 3
  • 11
0
votes
0 answers

I am using @react-pdf/render in my react js application want to render it as HTML in pdf

I am using @react-pdf render for my react application. it generated the component in pdf, the problem now is at the level of display of the data coming from my api which are saved in html tags. it displays like this:

My Title

or I would…