This repository contains a simple Node.js
application designed to automate printing of an HTML resume to PDF (using the excellent Puppeteer package), along with a Makefile
so you can just run make
and have your HTML resume printed automatically. I fully realize that this is pretty excessive, but I got extremely tired of having to launch a browser, load or refresh my resume, print it to PDF, and then open it in yet another program just to see if my formatting or content changes came out the way I wanted. I'm also an automation enthusiast, and this was a chance to exercise those muscles a little.
There's no reason you couldn't use this to print other things, but I've made some assumptions on formatting and number of pages that are really designed just for printing a single-page document where the bottom margin should be slightly larger than the others (to visually balance with the normal large and space-filled header of a resume).
If you have Homebrew
installed (or are willing to have it installed for you), all you have to do is:
$ git clone https://github.com/mplew-is/resume-printer
$ cd resume-printer
$ cp /path/to/resume.html [/path/to/resume.css] Sources/
$ make open
The Makefile
is set up to automatically:
- Install Homebrew if it is not installed
- Install Node through Homebrew if not installed
- Install the Node dependencies needed
- Print your resume to PDF
- Note that it is assumed your resume is named
resume.html
, seeAdvanced usage
below for other options
- Note that it is assumed your resume is named
- Open your resume in your OS-configured PDF viewer
The above quick-start is great just to make sure everything works, but the real value of having an HTML resume to me is to be able to source-control it, and in order to do that using the prescribed Sources
directory above, you'd have to fork this repository and make your changes - which you can absolutely do, but I also don't want to force you to do that if there's a better option.
To that end, this repository is designed to be used as a git submodule in a sub-directory of your actual resume source. A sample Makefile is provided to allow you to easily configure printing from a different directory than the standalone defaults; the intent is that you copy this file into the "supermodule" containing your resume, customize it with your actual parameters, and then can run make open
as before.
That is, you can run the following from your resume repository:
$ git submodule add https://github.com/mplew-is/resume-printer
$ cp resume-printer/sample.mk ./Makefile
$ make open
The default configuration has your HTML file being ./resume.html
(relative to your Makefile
) and will save to ./resume.pdf
, but those and a few more options are easily configurable. The following targets are exposed for convenience, and constitute the API for this build system (anything else that happens to be present is an implementation detail and is subject to change):
-
make [build]
: build your PDF to your configured location -
make open
: open your built PDF with your OS-registered document viewer -
make clean
: delete the built PDF
Personally I really like Homebrew (and it's gotten really good on Linux nowadays), so by default I assume you're willing to use it and make anything else opt-out. The good news is that it's really easy to do that: literally just install node
(that is, have npm
available on your PATH
somewhere) via the method of your choosing, and none of the Homebrew installation steps will run.
The reason I did this is that I'm a big fan of Zero Install and similar techniques that minimize user interaction with regards to dependency management and bootstrapping a new project. One of the most frustrating things I find is when the documentation on how to get started from scratch is either incomplete or outdated; by explicitly encoding the bootstrapping as part of the code, it means all of that is part of the project itself and much more likely to remain up-to-date.