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.
Images used to be registered in the document definition. In v0.5.4, support for loading images directly from the file system was added. However, this feature gives the library access to all files on the system, which may be a security concern.
This commit adds support for including images by a URL. The
image
property of an image block now supportsdata:
,file:
, andhttp(s):
URLs. File names are interpreted as relative to a resource root that must be set by thesetResourceRoot()
method on thePdfMaker
class. Compatibility with the previous API is maintained, but theimages
property in a document definition is deprecated.An
fs
module is introduced to read files from the file system. Since this module is not available in browser environments, it is loaded using dynamic imports to prevent runtime errors. This required to raise the minimal ES version to 2020.