invoice template and setup for jsPDF usage in ES6
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public fix logo markup redundancy Jun 22, 2018
src LABEL add and populate label from the printData + change total underl… Jun 25, 2018
.gitignore
package.json
readme.md
webpack.config.js
yarn.lock

readme.md

jsPDF Template

This a styled invoice Template jsPDF in a simple ES6 webpack setup.

Included custom fonts with this jsPDF CustomFont support plugin. Even it's said that this functionality is already integrated in jsPDF. It is now working with my used custom font.

Included svg2pdf for better SVG support. Which is also the reason why jsPDF-yworks package had to replace the original one.

Releases

For a bit simpler usage i would suggest to refer back to Version 1.0 of this development. Which isn't using jspdf-yworks package and integrates graphics as simple base64.

Setup dev env

  1. yarn install
  2. yarn run webpack

you might need to have webpack installed too.

Create custom Font file

  1. Copy your fonts into the fonts subdirectory.
  2. Run node makeFonts.js to create a new print/default_vfs.js.

Description

Print "Templates" or Components are hidden in src/print/pdf.

While src/print/jspdf.js serves the main start for the printing functionality.

Some functional tools are placed in src/print.

Issues

  • the yworks fork of jsPDF is used for their proper SVG integration
  • custom font work sans isn't working in any case. sometimes i do switch font temporally for some calculations. e.g. for functions getStringUnitWidth() or splitTextToSize()
  • currently using localStorage to save the background graphic globally for synchronous usage. Might not be the best idea.