pdfkit-fresh-resume

1.1.0 • Public • Published

npm version

Toolkit for rendering a resume PDF with PDFKit.

Convert a resume (CV) in FRESH format to PDF with PDFKit. This includes an example resume JSON and an example theme. Inspired by HackMyResume, but I wanted more low-level control over the PDF output.

The previous PDF version of my resume was generated with a FRESH resume JSON to XML to PDF with with XSL:FO and after every change I manually transform to PDF and have to close and open Adobe Reader (there is no refresh button and the PDF is locked when open in Reader so it will not overwrite when transforming). As a front-end developer I want to leverage browser sync to make the develop/review cycle more efficient.

The FRESH resume JSON, photo and the generated PDF for my own resume are not public, but I did include an example json (./example-resume.json), photo (./example-photo.jpg) and PDF (./output/example-output.png).

Details about how the preview is generated:

  1. A Node script runs when the sources change and generates the PDF, but also a JS with a data-uri version of the PDF as a variable.
  2. A static html preview.html is served that includes the data-uri JS.
  3. To do: Browsersync will be used to watch changes to the data-uri JS and will refresh preview.html in the browser.

Run

Because async/await is used, NPM 9 is required.

  • npm use 9
  • npm i
  • node index.js run examples/example-resume.json output.pdf

or globally:

  • npm use 9
  • npm i -g pdfkit-fresh-resume
  • pdfkit-fresh-resume run ~/.npm/pdfkit-fresh-resume/example-resume.json output.pdf

options:

  • With alternative template: pdfkit-fresh-resume run ~/.npm/pdfkit-fresh-resume/example-resume.json output.pdf -t ~/.npm/pdfkit-fresh-resume/app/template/otherTemplate.js

Running with -w/--watch

This is an experimental feature

  • pdfkit-fresh-resume run ~/.npm/pdfkit-fresh-resume/example-resume.json output.pdf -w
  • Run http-server in another terminal
  • Open http://localhost:8080/preview.html in the browser
  • After updating the template or the input JSON, the console will log "🔥Hot update". After that refresh the browser while clearing the cache to see changes.

TODO

Readme

Keywords

none

Package Sidebar

Install

npm i pdfkit-fresh-resume

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

166 kB

Total Files

21

Last publish

Collaborators

  • mdvanes