Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Lynn Mitchell
Lynn Mitchell
5,133 Points

How would you go about converting a HTML form to PDF?

Hello Treehouse! I am working on a form where the user would be able to fill it out then save it as a PDF and then print it. Has anyone does this before or know how to do it? I have seen a lot of APIs but not any of them completely free.

It's not easy to do it on client side (in the browser) We usually solve this problem involving server-side code. I found this solution however it can help for you: jsPDF

1 Answer

A good plugin is pdfMake.

The website has an option to see how your HTML converts PDF on the fly.

If you need any help to get going let me know.