Incorporates many of the awesome contributions in context of the Hacktoberfest. Thanks to all the contributors!
- #2944: Fix PDF compression. Special thanks to @markotaht!
- 👍 #2959: Add support for PDF encryption. Special thanks to @owenl131!
- #3018: Fix font name escaping
- #3017: Fix dependencies in bower.json
- #3014: Added typings for the events API
- #2982: Bump dompurify version to fix cve-2020-7691
- #2981: Fix Canvg import
- 🚀 #2946: Remove API, that was removed in the 2.0.0 release, also from the typings
- #2943: Fix links on pages with different size than the first page
- #2942: Fix multiline texts in combination with the
- #2933, #3021: Fix typings of exported types like
- 📚 #2915: Fix documentation of
- #2906: Fix
"Could not load <module>"error messages
- #2905: Fix usages of atob/btoa in Internet Explorer and "old Edge"
🚀 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.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:
🛠 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.
🛠 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
- 🛠 #2817: Fixed top margin in
htmlmethod 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
- #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!
v1.5.3December 27, 2018
v1.5.2December 20, 2018
v1.5.1December 20, 2018
The important stuff:
- 👍 TTFFonts should now be better supported
- ♻️ putStream is now refactored. Because some people use putStream in internal functions-set for their plugins, despite it is not an API, please be careful
- API.internal.pageSize.width and .height are again working.
- we have now a new html-method, depending on html2canvas and our context2d-module
- 👀 fromHTML and addHTML are not supported anymore. See below
- 📚 Documentation is now up to date (as far as possible)
- compression now works
👍 We will not support any longer
🔌 You are free to submit PRs, but we will not invest more time in these two plugins. We have now a new .html method, based on html2canvas and our canvas2d plugin - based on the html2pdf-Plugin by @eKoopmans . This plugin will be maintained in the future. This should lead to more reliable results for your projects. And it will give us the time to focus on the core functionality of pdf-generation because we will not use our energy for writing/supporting/extending 2 html plugins. If you still want to use
fromHTMLas they are still in jspdf. But if some changes break those plugins, you can still use jsPDF 1.4.1, which has a stable version for both plugins.
- 3ce138f minor changes in
acroform.jsto work properly with polyfills
- 🖨 33a3089 Fix AcroForm Print Bug
- a483c9b setFont(): warn if font is not found
- c0fa3ce add a font converter
- 👍 bcf14ed fix for #1876 Uint8Array AddImage Support
- 0️⃣ 88f7d07 set default DV in acroform.js to null
- 🏗 48ca33c restructure build files
- 🚚 b6b175a modify jsPDF to handle latest html2canvas version, remove html2canvas and Stackblur from project and make it an external dependency
- 🔌 2af8438 modify context2d-plugin to work like a real 2d-context
- ♻️ 511afdd 4bd7d5c refactor context2d-plugin
- 🗄 87fd3f2 deprecate fromHTML and addHTML, add html-plugin, which is based on html2canvas and solution of @eKoopmans
- 🛠 1449e14 Bugfix/dataurl validation addimage
- f6f5c36 putTotalPages works now with customfonts
- 🛠 1449e14 bugfix dataurl validation in addimage
- 📚 f251457 small changes in cell.js, add more documentation
- 📚 970b03d Restructure doc generation and add more documentation
- ♻️ 1019eca major refactoring of jspdf.js, add alot of unit testing
- c53beb6 Font Dictionary now has toUnicode entry to be able to copy paste out from pdf viewer, thanks to @zhangchen0514
- 🛠 5c489f1 bugfix in addimage.js generateAliasFromData had problem with ArrayBuffers
- ade1227 FlateEncode, ASCIIHexencode and compression is not working
- 0890ad5 Fix TTF Fonts Not Working when indexToLocFormat is 0, thanks to @briandevet
- 🐎 d8b698c Modify addimage.js so that the validations are done when conversions throw errors (increases performance)
- 1ea40e4 added a bidiEngine to jsPDF. now there is no necessity for an lang: 'ar' flag in .text-method, it will be solved automatically
- ♻️ 42e0564 completely refactored acroform.js (again). now acroform classes have better attributess and methods. it is now documented too.
- ♻️ cd4b710 annotations.js got refactored, now acroform-elements and annotations can be used at the same time
- 8f33f4b new folder structure. put sourceode into src-folder. Thus should result into less confusion, because before people were sometimes using jspdf.js and complained about non-working methods, but it was because they should have used dist/jspdf.debug.js or min.js
and some minor stuff, which we forgot to mention
- d66d52b Add UserUnit option and limit pages to 14400x14400 UserUnits according to PDF Reference
- b1704fa fix invalid typecheck in acroform.js for attribute maxLength, thx to @samlanning
- 59ca71d add baseline option to API.text
- 💻 be04de1 addimage.js now loads png-images directly and doesnt process them through canvas, Image-Elements of Browser-DOM now load directly the files
- d3e1dba pages can have now artBox, bleedBox, cropBox, trimBox - values, internal processing of mediaBox is changed, still needs proper API methods
- 📚 65bba3c Correct the documentation in jspdf.js, thx to @silvioprog
- 🏗 45dbf21 improve version handling while building the distribution, thx to @bwl21
- 68b41fb add miterLimit functionality to pdf and context2d
- 🛠 Base64-validation of images fixed (ea4c174 )
- Internal use of different css-colornames methods reduced to one (e43a913, 5d0b760)
- ⚡️ Update canvg to recent version (e43a913)
- ⚡️ Update context2d so that it can handle properly transform-method (e43a913)
- ➕ Add methods to TextField and other Elements like
var TextField = new jsPDF.API.AcroForm.TextField()or
var TextField = new doc.AcroFormTextField();in AcroForm.js
- 🚑 Hotfix html2canvas so that whitespace doesnt result in to corrupted PDF (31bb2fd)
- ✂ Remove nodeJS-Loading-Method from addImage( Commit 7a1089a)
- ➕ Added gif- and bmp-support (38b50f4)
- 🛠 Fixed a performance-leak in
extractInfoFromBase64DataURIin addImage-Plugin (c0a5e3a)
- ➕ Add fallback filetype to filetype recognition in
getImageFileTypeByImageDatain addImage.js (3d32fb7)
- ➕ Add documentation to addImage.js (3d32fb7)
- ➕ Add addSvgAsImage-method and renaming
addSVGfor backwards-compatibility to svg.js (3d32fb7)
- 🏗 Make
build.jsindependent from git call (c2d8501)
- Modify split_text_to_size.js and jspdf.js to handle unicode strings , add unit tests for methods of split_text_to_size (4efd59c, f03af75, 25e8330, f03af75)
- ➕ Add unit tests for arabic-parser and fix bugs found by unit tests (fc81d12)
This is a biggie!
As usual, thanks to everyone who has contributed!
📚 We'll be adding to the Unicode documentation as we go.
Big thanks to @arasabbasi for getting this shipped!
🚀 The three main aspects of this release were UTF-8-support, increased NodeJS/AngularJS/WebPack-support and stabilizing jsPDF by fixing bugs.
🔌 jsPDF supports finally UTF-8 by having the ability to use custom fonts. We want to thank here especially to contributor @sphilee, who programmed the TTFFont.js library file, which is the core of this great feature. Because of the specialties of the arabic-writing-system we have a separate plugin for that writing system.
🏗 In the light of the increased amount of reported issues by nodeJS/angularJS/WebPack-users we focused in this build on increased compatibility with nodeJS and other third-party-software. We hope that those changes will solve the reported issues to your sufficiency.
🛠 A lot of bugfixes were applied to the core and the addimage.js-plugin.
- 👍 Now API.text is supporting rotation, multiline, right, center and justify alignment to a satisfying level.
- ➕ addimage.js now recognizes images by the magic headers. The PNG-Engine now supports Interlace-mode and CMYK.
- ♻️ acroform.js got refactored and works now in Internet Explorer 11, too
- 🛠 and many many small bugfixes here and there
🛠 As jsPDF has grown, we've been managing some technical debt. Some of this is from before NPM existed - so those dependencies were brought in through git. That's now fixed, which should mean you can install jsPDF into containers without git.
🚚 We also removed a load of old unneeded files. We'll continue tidying up, as we have some pretty big changes coming up soon.
🛠 Main fixes include:
- 🚚 7f5008b Move deps to npm
- daacf2c Added a Code of Conduct document
- 🛠 41bcbfa Fixed an issue with memory leaks for large images
- ef7ecda Tidied up a bunch of old file
As always, let me know how you get on! Please report any issues using the template, creating a working jsbin example really helps us to sort the issue out quickly.