Generate a PDF in React

preview_player
Показать описание


🧰 Resources

#colbyfayock #pdf #javascript #nextjs #reactjs #webdevelopment
Рекомендации по теме
Комментарии
Автор

Omg i was just looking for this! Thanks you always for the straightforward tutorials.

mrvfino
Автор

Hi Colby. Thank you for this video. I’ve been using React-PDF and I think it’s the best of the three options. However, the documentation didn’t clearly explain how to use the renderToStream method properly, and I had a lot of trouble with it, especially with TypeScript. Your solution, even though it seems like a patch, has been really helpful—thank you!

JuanMoisesTorrijos
Автор

I was using Puppeteer to generate invoices in a serverless environment, and while it worked fine, the problem was that my computation hours were getting used up too quickly. After watching your video, I decided to give React-pdf a try. Thank you for the video ❤

Looking forward to seeing you more often in my YouTube feed.

tusharphb
Автор

This is better than most paid content I've come across. You could totally rock a Front End Masters course. Thanks!

alexgochenour
Автор

Awesome video on a niche topic. Really helpful!

asadsalehumar
Автор

The react-pdf/renderer option doesn't seem to work anymore on Nextj14 and 15 and React 18? I tried V3 and V4 and followed your code.

const stream = await renderToStream(<MyDocument />); //Code dies here.

We get error Error generating PDF: Error: Minified React error #31; Objects are not valid as a React child (found: object with keys {$$typeof, type, key, props, _owner, _store}). If you meant to render a collection of children, use an array instead.

Can you double check on a new project and see if you get the same error in your route.tsx file?

cutefatboy
Автор

Thank you for sharing this, probably gonna use react pdf for a costum format and style for my invoices, I tried pdf-lib but I think its too hard when dealing with costum designs .
Really appreciate the video thank you again!

ardianhotii
Автор

I went into this few weeks ago! Thanks for sharing!

jengkhaw
Автор

Puppeteer might share the session between users (especially in server based environments), maybe clerk handles invalidations fine, but I'd still be careful with it.

NARY
Автор

This was really helpfull. You just saved me from tons of research.

Naz-ez
Автор

Very helpful Colby as always. Thanks a ton. Can you do more advanced tutorial on React PDF?

rayusaki
Автор

Noice! Nothing like a solution that comes in at the perfect moment. I used this today 😄 Thanks!

FoodTechLife
Автор

The proposed solution with react-pdf is not working anymore with next 15. Any fixes?

giuseppebosco
Автор

Hi man thank you so much for all the tuto you have done till now, I recently completed some personal project due to your tuto on intersection observer and html dialog, everything is really smooth when concepts are explain by a pro.
Also can You please make a video on mdx with vite for a documentation or blog app.

blacksun
Автор

React-pdf/renderer is best. If you know about react native then it will be super easy to make a invoice and download without any issue. Also if you want to design with tailwindcss same as web then you can use react-pdf-tailwind.

alamgirhossain
Автор

How does embedding html work? Lets say i have a piece of html i want to embed in my new pdf?

preslavgetov
Автор

Hi Colby, thank for the video, do you know if there is a way to include selectable checkboxes inside the pdf using react-pdf/renderer?

AlamProjects
Автор

how to solve oklch issue? i can not convert to pdf in my react project & i used html2pdf library

humashakhan-yxsl
Автор

Thank you so much for your content!

I have a question: how can I implement react-pdf on Next.js for exceptionally large PDF files?

I’m dealing with a file of over 600 pages, and rendering this server-side results in a timeout as it takes over 10 seconds to process. I considered implementing a streaming solution, but I haven’t found any examples or discussions about it online. Would you recommend this approach, or do you have any other suggestions?

gianmarcoscandale
Автор

How would i go about generating a pdf from a template with form data on the backend? Great video!

jeremy