React to PDF Printing | React Tutorial

  Рет қаралды 90,230

Hong Ly Tech

Hong Ly Tech

Күн бұрын

We will learn how to convert anything inside React component into PDF file and be able to print. Let's find out, guys!
SUBSCRIBE: bit.ly/Subscrib... & turn on notifications to find out when I upload new videos.
Hong Ly Tech
honglytech.com
Websites used in this video
www.npmjs.com/...
COVID-19 Live Now URL
GitHub Repo
github.com/lyh...
GitHub Pages URL: lyhd.github.io...
Netlify URL: vigilant-noeth...
Website: www.hongly-port...
Medium: / lyhong.rupp
Facebook: / honglytechfb
Facebook Page: / honglytech
Instagram: / hongly_tech
Twitter: / honglytech
Facebook Page (Think): / kitthink
#react #pdf #printing

Пікірлер: 66
@tbtester3378
@tbtester3378 3 жыл бұрын
What if we already have an app written with functional components? The above doesn't work.
@2Dimples4U
@2Dimples4U 3 жыл бұрын
Exactly what I needed. Is there a way to have that little print icon that usually wraps around a window of a component?
@Deepak-ye8vt
@Deepak-ye8vt Жыл бұрын
Nice explanation with less time.Great Job sir.
@StephenArpad
@StephenArpad 7 ай бұрын
How can i reduce the whole content inside the printing page? I tried overloading the pageStyle prop, but for some unkown reason to me, it's not doing anything. Any ideas? Thanks
@kdgyimah
@kdgyimah 3 жыл бұрын
Thanks for the tutorial, I got the same result with {window.print()}. Is there a way to save the PDF file into the state? I want to submit the file to the backend on generation
@HARSH11ify
@HARSH11ify 2 жыл бұрын
Thanks buddy, you're a saviour!!
@AjayKumar-jx5qb
@AjayKumar-jx5qb 10 ай бұрын
Just wondering if there is a way to add page number and table of contents for larger content. Thank.
@chiragprajapati6312
@chiragprajapati6312 4 жыл бұрын
hey nice, but what if I want to add some header to print but I don't want to show it on component
@yuribaldini1126
@yuribaldini1126 2 жыл бұрын
Thanks for sharing!! It was really helpfull.
@VishalPatel-hl8ir
@VishalPatel-hl8ir 4 жыл бұрын
I want to create an Invoice on button click & export same invoice in pdf. Can you please help me to do the same ?
@Fattpiu
@Fattpiu 2 жыл бұрын
What happens if my printer is out of ink or out of paper? Is there a way to capture that?
@gangaprasadk
@gangaprasadk 3 жыл бұрын
Thanks for the tutorial. Its great. Can we make ComponentToPrint as a functional component instead of class component. Also, can we print directly without the Print Dialog.
@utkarshsinghchauhan7113
@utkarshsinghchauhan7113 2 жыл бұрын
did you get the solution for printing directly without the print dialog box?
@gangaprasadk
@gangaprasadk 2 жыл бұрын
@@utkarshsinghchauhan7113 no
@RyuAdventures
@RyuAdventures 3 жыл бұрын
Nice tutorial I have a question, Does it works inside a React+Electron APP ?
@SHATHISHB
@SHATHISHB 6 ай бұрын
how to add page numbers?
@travel_worldwide_365
@travel_worldwide_365 3 жыл бұрын
Nice explanations .Great !
@MrTouqeerhameed
@MrTouqeerhameed 3 жыл бұрын
Thank you for the wonderful tutorial
@abubakarwaqas9807
@abubakarwaqas9807 3 жыл бұрын
Pdf is creating but when I tried to select text than it was not select ? please can you tell me what is the reason. Thanks advance
@kacperkepinski4990
@kacperkepinski4990 2 жыл бұрын
can i add something as a footer for every page?
@ahmaat19
@ahmaat19 3 жыл бұрын
Can I use with hooks because it's giving me an error that needs only class-based components?
@BenniK88
@BenniK88 3 жыл бұрын
Did you find an answer?
@ahmaat19
@ahmaat19 3 жыл бұрын
@@BenniK88 yes.
@BenniK88
@BenniK88 3 жыл бұрын
@@ahmaat19 Can you help me. As I got the same issue. Can you post your solution? Thanks in advance
@ahmaat19
@ahmaat19 3 жыл бұрын
@@BenniK88 you can find how I implemented here github.com/ahmaat19/restaurant-system
@redyk4073
@redyk4073 3 жыл бұрын
Thank you guy it's was helpful
@mrskrish9584
@mrskrish9584 3 жыл бұрын
Any possibility to specify where to page break
@khandoor7228
@khandoor7228 4 жыл бұрын
Nice tool Hong thanks for showing this.
@honglytech
@honglytech 4 жыл бұрын
Thanks KhanDoor
@sayantansaha2703
@sayantansaha2703 3 жыл бұрын
if i need to change that printing page style,how to set that ? for an example in my webpage there is an auto generated qrcode, and i want to print that only & also i want that QR-image printed in the middle of that a4.please help!!
@istvanerdos7682
@istvanerdos7682 2 жыл бұрын
Hey! Thanks for sharing this! Do you have any idea about how I could print a table with scrollable content? I've tried to set it to landscape mode, but it does not work for me.
@akinjidesleek
@akinjidesleek 2 жыл бұрын
If its a table you should probably try downloading in csv format with react-csv
@istvanerdos7682
@istvanerdos7682 2 жыл бұрын
@@akinjidesleek Thank you! Finally, we decided to create a custom print component for it in which the cells are breaking down into the next line. I have used flexbox divs to build the "breakable" table component.
@uzmamustafa3293
@uzmamustafa3293 2 жыл бұрын
Can you show me the custom print component output, i need to print a scrollable content table too so.
@priyan6380
@priyan6380 2 жыл бұрын
@@uzmamustafa3293 same I'm also having problem while printing scrollable content
@KamalMaulanaAdha
@KamalMaulanaAdha Жыл бұрын
so helpful thanks
@sivaprasadreddy5038
@sivaprasadreddy5038 4 жыл бұрын
hi i am facing isse with when we print checked checkbox and selected dropdown value not printed can u pls help me on that
@asyncasync
@asyncasync 3 жыл бұрын
A complete and utter waste of time and absolutely useless. You cannot select the text after generating the PDF. This is like an April fools joke. What exactly is the point of this if you cannot copy the text?
@hemanthkumar9137
@hemanthkumar9137 4 жыл бұрын
thanks for this tutorial :)
@Jay-bh9ke
@Jay-bh9ke 3 жыл бұрын
Does it support print all tab content instead of active tab
@saikalyan8073
@saikalyan8073 3 жыл бұрын
Can we do this get a power point presentation
@johanrivas8015
@johanrivas8015 4 жыл бұрын
the component to print must be a class component ?
@travelfiend
@travelfiend 4 жыл бұрын
Yep, seems that way. You get a weird error when trying with function components
@johanrivas8015
@johanrivas8015 4 жыл бұрын
@@travelfiend thanks for replying
@markbarlescu1853
@markbarlescu1853 3 жыл бұрын
@@travelfiend Is this still an issue? I'm going to be using this soon. So the component to print MUST be a class component still?
@webamplifiereducation1768
@webamplifiereducation1768 2 жыл бұрын
is this can be used for pos?
@fattchong1619
@fattchong1619 2 жыл бұрын
how do you use the onPrintError function?
@allaboutvideos4788
@allaboutvideos4788 3 жыл бұрын
Thank, Will this work on android app?
@honglytech
@honglytech 3 жыл бұрын
This is only running in the browsers. Not mobile apps.
@ngneerin
@ngneerin 3 жыл бұрын
Best
@AjayTheGamer07
@AjayTheGamer07 3 жыл бұрын
In browser . we can give ctrl + P in any website it will show print as pdf so why we are doing code like this.can you explain?
@honglytech
@honglytech 3 жыл бұрын
You can try window.print()
@AjayTheGamer07
@AjayTheGamer07 3 жыл бұрын
@@honglytech Thank you
@arghyapaul8760
@arghyapaul8760 3 жыл бұрын
Suppose if we want to ignore a table coloum before coverting it to pdf and when it will be converted to pdf then in the pdf file the last or first coloum will be removed. how will I do that
@austintochukwuasoluka1502
@austintochukwuasoluka1502 8 ай бұрын
Media query
@shivampawar8421
@shivampawar8421 3 жыл бұрын
Thanks for sharing
@abhishekshah2964
@abhishekshah2964 3 жыл бұрын
How to print with one row at a time with this ?
@rajeshkolluri448
@rajeshkolluri448 Жыл бұрын
If possible explain the code
@bunnyngim2758
@bunnyngim2758 3 жыл бұрын
Hi Any vdo talk about electronJS and Vue with Printer? Thank
@honglytech
@honglytech 3 жыл бұрын
Not yet bro. But I added the two items to the list
@basitbasit2547
@basitbasit2547 3 жыл бұрын
not good in production mode :'(
@manujamadushan9471
@manujamadushan9471 2 жыл бұрын
😍
@its_just_me_
@its_just_me_ 3 жыл бұрын
At the time I am watching this, the video has 11k views, 111 likes and 11 dislikes.. 😄
@leelalekkala5587
@leelalekkala5587 3 жыл бұрын
sir in my case instead of save option it is showing print option. after clicking on print option it disappear. how will I solve that?
@blood4bones366
@blood4bones366 4 жыл бұрын
Thank you for this
Generate a PDF in React
23:38
Colby Fayock
Рет қаралды 11 М.
АЗАРТНИК 4 |СЕЗОН 2 Серия
31:45
Inter Production
Рет қаралды 1,1 МЛН
HAH Chaos in the Bathroom 🚽✨ Smart Tools for the Throne 😜
00:49
123 GO! Kevin
Рет қаралды 13 МЛН
How to Print React Component on Click | React Js | Save as PDF
10:47
Mitter - Your Tech Mate
Рет қаралды 1,7 М.
Print in React| Print with React| How to print in React.js
4:05
Easy Coding
Рет қаралды 49 М.
ReactPDF Basic Setup
11:12
Arslan
Рет қаралды 102 М.
Nextjs and React PDF Tutorial: WATCH THIS BEFORE STARTING YOUR PDF
9:45
How to download web pages as PDF in React JS
6:46
Code Pro
Рет қаралды 31 М.
All useEffect Mistakes Every Junior React Developer Makes
22:23
How To Debug React Apps Like A Senior Developer
21:07
Web Dev Simplified
Рет қаралды 138 М.
How to download React JSX to PDF
5:53
JS Solutions
Рет қаралды 26 М.
Beautiful Area Charts in React with Recharts
23:11
Leigh Halliday
Рет қаралды 44 М.