Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Requirement to print the tr with className="onlyInLastPage" in the last page and just above the footer

I have a requirement, where i have to print the Doctor Prescription in A4 page or pages. Depending on the content it may take page or pages. -> each page will have a header and footer which are ...
anil kumar's user avatar
0 votes
0 answers
25 views

How to Prevent Component Splitting Across Pages in A4 Layout Using React and react-to-print?

I am building a React application where I need to render content on A4-sized pages for printing. I’m using the react-to-print library to handle the printing functionality. The issue I’m facing is that ...
Khaled Kammoun's user avatar
0 votes
1 answer
94 views

How can I print without rendering it using react-to-print?

Is it possible to use react-to-print without rendering the details to the ui? What i'm trying to do is create a print button without rendering the other details coming from child component. ...
Stykgwar's user avatar
  • 671
1 vote
0 answers
76 views

Disable page break until everything is printed. Print from website

I am using react-to-print with Nextjs. Problem This is the problem. I don't want it to break and want it to continue and treat it as 1 page. I have POS-80C thermal printer, and it cuts on every page. ...
Fat Fatty's user avatar
  • 263
5 votes
1 answer
575 views

How to Disable Print Dialog When Using react-to-print in React?

I'm currently using the react-to-print library in my React application to enable printing functionality for a component. However, whenever I trigger the print action, a print dialog box pops up, which ...
swet parvadiya's user avatar
0 votes
0 answers
187 views

How to print specific content on each page in react js?

I am unable to print specific content on each page of the printed document in react js. My table is printed on 2 pages and the other details are not printed along with the table. import React, { ...
Muhammad Shumail Mushtaq's user avatar
0 votes
1 answer
157 views

Identifying Clicked Button in Preview Modal When Performing Print Operation with react-to-print

I want to perform a print operation using react-to-print and I want to know which button (print or cancel) is clicked in the opened preview modal for this operation. How can I do that? I tried using ...
Yunus Emre Arslan's user avatar
1 vote
0 answers
1k views

how i adjust page size in react to print library

i am using react to print library in one of my react js functional component. i want to adjust the page size according to my need. for one component i need to adjust my page size to a4 for printing ...
Noman Arshad's user avatar
1 vote
1 answer
1k views

react to print not printing background color

Hi I am using a library react-to-print to print my react component into a pdf form. here is the code below export default function Index() { const handlePrint = useReactToPrint({ content: () =&...
Naruto's user avatar
  • 109
0 votes
1 answer
930 views

How to silently print a React component on the default printer using react-to-print with Electron

import { useReactToPrint } from 'react-to-print'; const printsRef = useRef() const handlePrint = useReactToPrint({ content: () => printsRef.current, pageStyle: ` @page { ...
kanishka kumarasiri's user avatar
0 votes
1 answer
249 views

React-to-Print Issue: Updated State not Reflected in Print Output

I am using react-to-print to print bills in my billing-system app. I've encountered an issue where one of the states (rows), containing a list of bills, is updated just before printing to consolidate ...
Abhijeet's user avatar
0 votes
1 answer
97 views

Table Footer not fixed in the bottom of every page in ios devices

Table Footer not fixed in the bottom of every page in ios devices. it works fine in android and windows devices The code is: const downloadPdfRef = useRef(); let date = new Date(); const ...
Faisal Ur Rehman's user avatar
1 vote
0 answers
196 views

Enable printing wide and long tables on multiple pages

I have a long and wide table I am working with. Here is an example The rows print on multiple pages just fine, but the columns are being truncated and I can't figure out a way to also have separate ...
datawiz95's user avatar
1 vote
1 answer
402 views

Custom header in npm react-to-print

I need to create a custom header that will be inserted at the beginning of each new page in my PDF export. I tried many ways but none of them worked I also tried to find a way in the documentation : ...
Matěj Musílek's user avatar
3 votes
0 answers
403 views

CSS break-inside: avoid not working in Safari & Firefox browsers for printing; some content & tables are broken between pages. Any alternatives?

I am encountering an issue with the CSS property. break-inside: avoid; not functioning as expected in Safari and Firefox browsers specifically, during the printing process. Despite applying this ...
Jayathilake TN's user avatar
1 vote
0 answers
706 views

react-to-print prints different layout

I want to print in reactjs a Know Your Customer Form on button press after filling customer details. So to do this I made two Forms; First one is the normal one filled through the client to fill ...
Mustafa Adel's user avatar
1 vote
1 answer
1k views

Trying to print multiple components on separate pages using react-to-print

I'm using react-to-print and I have a list of components I want printed each on its separate page. When pressing on the button I get the error Argument appears to not be a ReactComponent. Keys: 0,1 I ...
Abdelmasieh Baselious's user avatar
-1 votes
1 answer
441 views

How to print a nested component correctly with react-to-print

This is my main form component to print: import { Fragment, useRef } from "react"; import FormDataPrint from "../Printer/FormDataPrint"; import ReactToPrint from "react-to-...
Frank HAWK's user avatar
0 votes
0 answers
157 views

How do you print out FullCalendar `timeGridWeek` starting at a specific time

I have a FullCalendar component I am using in my React project and everything is working great, except for the printing out the week view. import FullCalendar from '@fullcalendar/react'; import { ...
TwoShorts's user avatar
  • 548
0 votes
0 answers
113 views

In multiple image print one image per page on many pages

I just occur one problem that i want to create invoice but when invoice get item image than it break A4 size so i want to print that if item have image than i want to print a only single product per ...
Mohan Dhila's user avatar
2 votes
0 answers
305 views

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 ...
Muhamad Hanif Muhsin's user avatar
0 votes
0 answers
382 views

Improving print quality from React app to dot matrix printer

I am working on a React app where I use the "react-to-print" library to print content to a dot matrix printer. However, when I print from the React app, the text is printed in bold letters ...
Harshit Sahu's user avatar
0 votes
1 answer
1k views

How can I trigger React-to-Print using the print option in the context menu?

I have a React component that displays a table and I am using the React-to-Print library to enable printing functionality. Currently, the printing is triggered by a button click, but I would like to ...
Nok13's user avatar
  • 1
0 votes
0 answers
144 views

Page header and content is overlaping while printing in react. using react to print

I want to print a page, that overlaps page header with page content, also Page number not working. i am using react-to-print. And below css for styling I want to print a page with page number without ...
Shameer Ahmed's user avatar
0 votes
0 answers
377 views

react-to-print gives empty screen for printing

I am working on an ionic react application. clicking on Print this out! taking me to the print screen. But getting an empty screen to print. My Print Component: import React, { useRef } from 'react'; ...
Mohammed Safwan's user avatar
1 vote
1 answer
634 views

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 ...
P. Avery's user avatar
  • 809
0 votes
2 answers
297 views

keydown event not getting caught in react unless I cause a re-render

I'm trying to print specific components of my app using react-to-print library. I'm trying to override the event of pressing ctrl+p for printing by using event.preventDefault() and it's working for ...
Rahul Mallick's user avatar
1 vote
1 answer
1k views

Custom footer with ReactToPrint

I'm trying to print my custom React functional component (save as PDF) by using ReactToPrint package. So far everything goes fine, until I wanted to modify Footer of document in print dialog (see ...
Juraj's user avatar
  • 31
0 votes
0 answers
483 views

I have a problem with react-print not printing the dimensions i want

So i have a resume creator app and when the user is finished he can store his resume in pdf. It works pefectly in a wide screen like a monitor but on a phone it doesn't.Now that happens because i have ...
Jay's user avatar
  • 19
0 votes
0 answers
127 views

How to enable print in React application where page rendered as section under <Route>

I have enabled react-to-print module, import { useReactToPrint } from "react-to-print"; In the present code from App.jsx, main-presenter.jsx is been invoked. import MainPresenter, {...
Dev Anand Sadasivam's user avatar
0 votes
1 answer
3k views

react-to-print Page numbers Display

const handlePrint = useReactToPrint({ content: () => currentRef, pageStyle: ` @page { size: auto; margin: 11mm 17mm 17mm 17mm; @top-right-corner { ...
Ashan's user avatar
  • 31
1 vote
0 answers
394 views

trying to print duplicated component with react-to-print

I have a component that I'm trying to print using react-to-print, is there any way I can print this component duplicated in one page? here is my code: import React, {useRef} from 'react'; import { ...
Houssam Mrabet's user avatar
0 votes
1 answer
289 views

ReactJS : React-to-print & Navigate : Uncaught TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_1__.useRef) is not a function

I try to do a sort of "go back" action. I have a page that is the preview of what I want to print with react-to-print. Everything works perfectly : components appears, when I click on "...
Aliénor's user avatar
0 votes
0 answers
252 views

how to make useReactToPrint get the last update(state)

I want to print the facture of selling , for that i used useReactToPrint but the problem is that it takes the last update of my values, for example if i add two numbersin the selling price field it ...
Isra_Yas's user avatar
1 vote
1 answer
89 views

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 ...
Rajesh Barik's user avatar
1 vote
1 answer
1k views

React to Print is showing blank page in React JS

I am trying to add the print feature on a div's content. But the Print VIewer is showing a blank White page. This is the first time I'm using Print-to-react Library. I am not sure what is the Problem ...
Hassan Muhammad Sabir's user avatar
1 vote
1 answer
2k views

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, ...
user19913971's user avatar
1 vote
2 answers
1k views

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 => <Grid md={item....
Amir's user avatar
  • 132
1 vote
0 answers
2k views

React to print fixed footer overlapping contents

I am using a react-to-print library to print some reports that are dynamic. The problem is I need a fixed footer on every page while printing and I have a fixed footer which overlaps the content ...
Saral Karki's user avatar
  • 5,382
2 votes
2 answers
2k views

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 ...
Drashti Kheni's user avatar
2 votes
0 answers
2k views

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 ...
shanmuga priya's user avatar
2 votes
1 answer
2k views

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 ...
Karan Janthe's user avatar
0 votes
0 answers
100 views

CodeSanBox Example react-to-print in PC working but laptop not show data

I'm following the example codesanbox with react-to-print :https://codesandbox.io/s/kmmw7l39y7?file=/index.js The PC working Okay but the laptop not work I don't now why my laptop is not working Please ...
Nguyen Lam's user avatar
1 vote
1 answer
4k views

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 ...
TD Perez's user avatar
  • 111
1 vote
4 answers
16k views

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....
IMMERHAZE's user avatar
0 votes
1 answer
4k views

React passing props (react-to-print)

Hi I have been using this package react-to-print to print document and it works really well. Passing value to child component works and I can print the dynamic data too. However, I am facing problem ...
todd's user avatar
  • 335
-1 votes
1 answer
157 views

Can you use an export default function, with ReactToPrint?

I am trying to implement ReactToPrint, to print out the contents of the export default function ToDoList (Which returns a map of the Todo cards from another class). export default function ToDoList({ ...
Skilled Rook's user avatar
1 vote
0 answers
439 views

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 ...
sy89's user avatar
  • 193
0 votes
0 answers
1k views

how to prevent Dynamic content overlapped on header and footer in React-to-print package

I have an issue that the dynamic HTML content is overwriting on the header and footer. dynamic content is coming from the response of API and I have shown in the component but while printing this PDF ...
Dhaval Prajapati's user avatar
0 votes
1 answer
2k views

ANTD table Print using ReactToPrint component

I am trying to print ANTD table using ReactToPrint hook, everything seems to work fine, but I want to show some text on top of page before print. means I want to show some text for header purpose, ...
Muhammad Faheem Chughtai's user avatar