Next.js Discord

Discord Forum

Best way to export HTML code render as a png

Unanswered
Morelet’s Crocodile posted this in #help-forum
Open in Discord
Avatar
Morelet’s CrocodileOP
I am trying to make a share button that shares your "game results receipt" as a png image. What is the best way of going about this?

just @ me if you have any advice! I am using typescript, react, and next.js. đŸ˜„
Image

10 Replies

Avatar
the easiest way for you as developer is to use the window.print function. Like that a print prompt will be opened and there the user can select the correct file format to save the specific results.

You might want to also create a shareable link, so it can be easily shared with others
Avatar
@Morelet’s Crocodile solved?
Avatar
Morelet’s CrocodileOP
Still figuring it out!
Avatar
Cape lion
I think there's an npm library to create a png from html
Avatar
Where do you need help with? Tell me your question. Where do you have issues?
Avatar
Morelet’s CrocodileOP
Im at a hackathon right now so i just have to focus on this project for this weekend đŸ˜‚ but afterwards ill get back to the project that I need to html to image thing
Avatar
We can only help you, when you tell us where you have issues
Avatar
Morelet’s CrocodileOP
What im saying is when i say "still figuring it out" im at a hackthon right now so Im not working on this project at the moment
but once this event is over, ill be able to work on that project again and if I need help ill let you know