I was exactly a few hours away planning to research this because I'm going to use it in a project I'm doing. And thank you for the video and also for your effort in making the video available in several languages. This will help a lot of people, you gained a subscriber.
@CandDevАй бұрын
thank you 👋🏻
@iabhitechАй бұрын
Avoid directly creating pdf via image, unless there is only image, it will blur the pdf on zoom and text will be not selectable.
@CandDevАй бұрын
you're absolutely right about the text not being selectable, but we can fix the blur by adjusting the scale. Thanks for the feedback
@abdarkerАй бұрын
exactly
@florianrichter4180Ай бұрын
i did it with Puppeteer. yes it's a bit more complicated but it works great and i have it OCR ready right away
@tiptrcks396029 күн бұрын
Bro why do even use that technique of embedding literally a screenshot to a pdf? Use react-pdf library for that purpose It provides components like view, text etc that renders to native pdf components that are not screenshots and are selectable, and copy able and you can use css to customize it as well(only limitation is you can't use grid) no formating issue whatsoever 😅
@shubhampawar7921Ай бұрын
Or you could just write css to hide elements when printing and then "Generate PDF" button simply does Ctrl-P shortcut. This way you save installing/maintaining extra packages
@haiderjaafer8164Ай бұрын
Great lesson... Can make lesson on how to run reports in nextjs typescript... So can print reports example of jasper reports
@alitonoliveira170026 күн бұрын
Dynamic graphs or charts would be awesome.
@CandDev25 күн бұрын
great idea.
@iSoul9528 күн бұрын
Brilliant tutorial, thank you- Bytheway, the way you pronounce 'height' really confused me and I ended up scrolling back a couple of times the first time you explained what the 'w' and 'h' represented! The 'gh' is silent and isn't pronounced (Hite). Again, great stuff 💪
@CandDev27 күн бұрын
thank you, Sorry about my pronunciation, my English isn’t perfect, but I’m working on it. Glad you found the tutorial helpful.
@iSoul9526 күн бұрын
@@CandDev No worries at all! Keep up the excellent work
@kimtoshi_444Ай бұрын
Great knowledge 🎉❤
@pasindu0528Ай бұрын
But in this case we must render the design if we need to convert several pages then how to handle it. all pages should render, are there any alternative solution
@CandDevАй бұрын
for multi page pdf generation, you can create an array of page components: const pageComponents = [ , , ]; // generating PDF for (let i = 0; i < pageComponents.length; i++) { // Add a new page after the first page if (i > 0) { pdf.addPage(); } } but for more complex multi page pdf you can use react-pdf.
@ardianhotii29 күн бұрын
@@CandDev great video thank you so much also can you please make a video using react-pdf to do this , like for example I want the header to be in all pages and the body of the pdf is too large so it can't fit in one page but has to continue in other pages with the same header and footer , please I would love that , if you do please reply here when you upload it if possible
@sashaBejenariАй бұрын
Thx! I have a weird bug. I have a form with inputs and the value from inputs are half hidden from bottom border of the inputs. I use shadcn.
@sanketgawande3667Ай бұрын
The only problem with this approach is that the text is not selectable since it converts html content into canvas. If you need this for really serious stuff, go with puppetter package, create pdf on backend.
@CandDevАй бұрын
you are right about the text issue. for professional pdf with selectable text, use Puppeteer or server-side PDF generation. These methods create better quality documents compared to image-based canvas conversion.
@simmslabs29 күн бұрын
Puppeteer is the best way. this approach changes the styles of some component. Even look at the header styles which doesnt sit well. Trust me ive been here before.
@bibarud301827 күн бұрын
Or simply, we can use the browser's native print API. It keeps the OCR.
@CandDev27 күн бұрын
there's no right or wrong, it really depends on what you want to implement. Sometimes, users can't rely on the browser's native print API, so options like this are helpful.
@sadique_x_28 күн бұрын
please what's the terminal extension for suggestions you're using?
@CandDev27 күн бұрын
i'm using iTerm with the zsh shell and the zsh-autosuggestions plugin for suggestions. It's super helpful
@sadique_x_27 күн бұрын
I appreciate you replying. thanks
@madmaxdevАй бұрын
can we select the text of the pdf from that?
@ardhikaryzha317Ай бұрын
How to adjust a PDF paper to fit the content only?
@johnwyck9482Ай бұрын
great topic
@thomasjodt28 күн бұрын
Is there a way to create a PDF that is not an image? I am currently needing a way to generate a PDF where people can select the text.
@CandDev27 күн бұрын
You can check out my latest video about it here: kzbin.info/www/bejne/g4ereXqsgZiKopI
@OCEMTechZoneАй бұрын
Great🎉
@abdarker29 күн бұрын
you said it's clean i can see the extra margin top inside the table Element, this is not the proper way. you gotta use react-pdf
@zeusek-213728 күн бұрын
none of typescript was written in this video.
@princyworkspace8 күн бұрын
It's an image in a pdf, unfortunatly it doesn't match all usecases