Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the following aspects of SVG handling:
image
propertyI don't currently have the time to write additional tests regarding this, but I needed this asap for a project I'm working on and I think it's a good addition to the SVG functionality of the library. So help is welcome by the current maintainer or any other volunteer contributor to add tests.
That said, I tested this successfully in the dev-playground with inline SVG, from a URL and as base64 string, both using
{ image: '...' }
as well as{ svg: '...' }
.Once the docs get updated for 0.2, the notice "except it is not currently possible to refer to SVGs by file or re-use from a dictionary" currently visible at https://pdfmake.github.io/docs/0.1/document-definition-object/svgs/ should also be removed, and maybe it should be noted that either the
svg
(for backwards compatibility) orimage
property can be used.