Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdvanes/pdfkit-fresh-resume
Convert a resume (CV) in FRESH format to PDF with PDFKit. This includes an example resume JSON and an example theme.
https://github.com/mdvanes/pdfkit-fresh-resume
Last synced: 5 days ago
JSON representation
Convert a resume (CV) in FRESH format to PDF with PDFKit. This includes an example resume JSON and an example theme.
- Host: GitHub
- URL: https://github.com/mdvanes/pdfkit-fresh-resume
- Owner: mdvanes
- License: mit
- Created: 2017-02-09T06:07:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-20T07:24:09.000Z (about 2 years ago)
- Last Synced: 2024-09-23T22:17:04.086Z (about 2 months ago)
- Language: JavaScript
- Size: 164 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - mdvanes/pdfkit-fresh-resume - Convert a resume (CV) in FRESH format to PDF with PDFKit. This includes an example resume JSON and an example theme. (others)
README
[![npm version](https://badge.fury.io/js/pdfkit-fresh-resume.svg)](https://badge.fury.io/js/pdfkit-fresh-resume)
> Toolkit for rendering a resume PDF with PDFKit.
Convert a resume (CV) in [FRESH format](https://github.com/fresh-standard/FRESCA) to PDF
with [PDFKit](http://pdfkit.org/). This includes an example resume JSON and an example theme. Inspired
by [HackMyResume](https://github.com/hacksalot/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. Webpack dev middleware is used to watch changes to the data-uri JS and will refresh the preview 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
* `pdfkit-fresh-resume run ~/.npm/pdfkit-fresh-resume/example-resume.json output.pdf -w`
* Open http://localhost:3456 in the browser to see the preview for the PDF.
* After updating the template or the input JSON, the console will log "🔥Hot update". After that the browser will reload and show the changes.# TODO
* Implement a full template that can render an entire resume.json
* Linting: eslint app/\*\*/*.js fails because pdf.js contains async and that is an experimental feature which [can't be parsed by eslint directly](https://github.com/babel/eslint-plugin-babel/issues/6), this might be fixed by using eslint-babel parser.
* See also https://github.com/MrRio/jsPDF (.docx support: https://github.com/MrRio/DOCX.js)