jsPDF v2.0.0 Release Notes

Release Date: 2020-08-11 // almost 2 years ago
  • ๐Ÿš€ 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 [email protected]
    • ๐Ÿ›  #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!