Questions tagged [react-to-print]

Questions related to the npm package react-to-print

react-to-print

44 questions
9
votes
2 answers

How to use react-to-print with TypeScript?

I usually use react-to-print (https://www.npmjs.com/package/react-to-print) for printing React components with a low effort and great flexibility. I'm starting to write my applications with TypeScript, and this is the first time I need to combine…
Axel León
  • 426
  • 6
  • 17
2
votes
0 answers

How to force page breaks inside of a table when printing

I have a problem with the table border not being perfect if the page is more than 1, here is a picture of the print preview results: Here's the sample code I hope the table between the page spacing has a border.
2
votes
0 answers

Argument appears to not be a ReactComponent. Keys:

I need to print a component for that i'm using react-to-print package. here everything is working fine. when i try to customize it based on my requirement i'm getting this error. i tried to search in the google but didn't get any proper solution. so…
2
votes
1 answer

page breaking in React to create pdf

I am generating pdf using react-to-print library, But i want to break the page in new page, There is css property break-after:always, it can work, but not all major browser supports it now, Anyone know any other method then brute force margin…
Karan Janthe
  • 37
  • 1
  • 4
1
vote
1 answer

NPM react-to-print fails to render text

I am adding support to my website for printing the current page. My website is built with React Js. I am using 'react-to-print', a NPM module, to print the current page. I am following instructions from this page. I am observing an intermittent…
P. Avery
  • 779
  • 1
  • 16
  • 34
1
vote
1 answer

react parent component not getting updated

I have a parent component (functional), child component (class). The parent component is print component which uses react-to-print to show print-preview the child component. I have a scenario where I have to update the style (height) of a…
Rajesh Barik
  • 183
  • 2
  • 3
  • 12
1
vote
1 answer

Optimizing react-to-print for all/most browsers and mobile devices

I'm working on a sample react-to-print resume template for a larger portfolio website. I optimized this page using Chrome and Edge on a laptop, however when the print button is clicked using Firefox, the background color in the .name-contact class…
1
vote
2 answers

react-to-print design issue when I use MUI Grids

I am using Mui Grid components with dynamic md={6 or 12} in a loop while rendering. When I try to export my PDF, there is a design issue in the print window. arry.map(item => // somethig here... )
Amir
  • 92
  • 1
  • 7
1
vote
2 answers

Not able to change the QR code size in react-to-print

I am using https://www.npmjs.com/package/react-qr-code to generate QR code on my website. I want to change the size of this qr code when I print this qr code in PDF file. can I change the size of qr code in pdf file without changing the size on…
Drashti Kheni
  • 1,065
  • 9
  • 23
1
vote
1 answer

How to fix style when i print with react-to-print?

i have a problem when i will print using react-to-print, that problem is with style of page, when i print the html, it print like: when i print and i dont want that, i want to print like (but without the buttons) enter image description here but i…
TD Perez
  • 111
  • 4
1
vote
4 answers

Correct use of ReactToPrint?

The problem is that the button that is supposed to give the option to print is not working anymore. the error in the console says: To print a functional component ensure it is wrapped with `React.forwardRef`, and ensure the forwarded ref is used.…
IMMERHAZE
  • 51
  • 1
  • 9
1
vote
0 answers

Print React component on every page

I'm using the react-to-print library but asking more generally - if I have a sidebar React component that I want to be printed on every page, is this possible? Kind of like a header/footer but a React component instead, that doesn't necessarily…
sy89
  • 195
  • 2
  • 14
1
vote
2 answers

ReactJS - How to print all the content of a Scrollable elment with react-to-print

I have a
tag that has a list of elements, the list can be long so I gave a fixed height to the
tag and overflow:auto property to have a scrollable list in case of overflow. Now I have a button at the bottom of this
to print the…
Hisoka
  • 101
  • 3
  • 15
1
vote
0 answers

How to remote console error message in React

I'm using react-to-print in order to print a page. It works fine but the page that is loaded contains some elements that have links (href). So when I click on print, in console tab it shows the following error message: "react-to-print" was unable…
Leo Messi
  • 5,157
  • 14
  • 63
  • 125
1
vote
1 answer

How can I print an page with react-to-print

I need a print button on my form. I was doing an research for a library to do that, and I found this one: https://www.npmjs.com/package/react-to-print I was thinking about this flow: a component import and add a line in my code to call that…
Cristiano Felipe
  • 117
  • 1
  • 10
1
2 3