SBaronda.com a little place I like to call home.


Easy React to PDF Option for Resume

Apr. 8, 2016

I've been trying to get my resume to export to a PDF easily. I've been banging my head on a couple different options. From using wkhtmltopdf to try convert my raw webpack version, to trying to build out my resume as a static page and then using wkhtmltopdf. There were little problems everywhere.

My final solution is to use electron-pdf in place of wkhtmltopdf against my raw webpack version. It's as easy as this:

npm run dist && electron-pdf dist/index.html resume.pdf

One thing that I needed to change in my dist/index.html file was to use relative paths for my bundle.js.

Thanks to Fraser Xu for blogging about this and introducing me to it.

While this is easy, I still think rendering to static files is a better option in the long run. Using React / Webpack / Babel / SCSS made it easy to get out the first revision of the resume, but getting it to the final medium made it a little harder. For now I'll stick with this and look at different React static site generators. Looking at you metalsmith and gatsby.


comments powered by Disqus