Skip to content

v2.0.0

Compare
Choose a tag to compare
@Uzlopak Uzlopak released this 11 Aug 08:55
· 122 commits to master since this release

Finally a new release!

A lot has changed since the last release:

  • jsPDF is now co-maintained by yWorks and we merged the yWorks fork into this repo adding a lot of new features like patterns, matrices, simple path operations, etc. See the readme for details.
  • Modernized the output bundles: there are now bundles for ES modules, UMD and a special node version. We renamed the files in dist for consistency: jspdf.debug/min.js is now jspdf.umd(.min).js. We also changed the name of the global variable to jspdf (lower case) when using script tags to be consistent with the new es modules format and named imports/exports. For backwards compatibility add this line:
window.jsPDF = window.jspdf.jsPDF
  • Added typings for TypeScript support.
  • Removed APIs that were previously marked as deprecated. Namely: addHTML, fromHTML, html2pdf, addSvg, addButton, addTextField, addChoiceField, cellInitialize, setFontStyle, setFontType, clip_fixed.
  • Fixed the file-saver npm/bower install issue where jsPDF depended on a (non-existent) version directly from GitHub.
  • Made it compatible with all major toolkits and frameworks.
  • Refactored big parts of the code.
  • A lot of small and big bugfixes. Especially thanks to @SmythConor, @bwl21, @32leaves, @mktcode, @durs, @kakugiki, @AdamGold and many others!

Here an (incomplete) list of additional bugfixes and changes:

  • #2835: Fixed reading of compound glyphs when using custom fonts
  • #2834: Fixed usage of custom fonts in context2d/when using the html method
  • #2824: Added maxWidth parameter to getTextDimensions
  • #2817: Fixed top margin in html method that occurred with html2canvas@1.0.0-rc5
  • #2816: Fixed escaping of font names with spaces
  • #2702: Fix context2d lineWidth scaling
  • #2806: Fix sanitizing of HTML passed as string to the html method
  • #2797: Fix scaling issue with Acroform fields
  • #2793: Fix autopaging issue in context2d with 10 or more pages
  • addImage and addFont accept now urls as parameters so the conversion to dataURLs is now only needed if you want to avoid CORS restrictions
  • WebP and JPEG Raw are now supported.
  • unnecessary data conversions are now reduced, so for example images should now render faster

There are some breaking changes in the API. But these are mostly API-methods which you should not use anyway.

While this release is a big step in the right direction, there are still many open issues (currently ~90). The maintainers of this repo (currently mostly @HackbrettXXX) have very limited time and can't resolve them all without the help of the community. This is another shout out to the community: if you like this project and want to make it even more awesome, consider spending one or two hours on improving it. Pull requests are very much appreciated!