-
Added
pdfmake.setUrlResourceConcurrency(concurrency)to limit concurrent URL resource downloads per document (default:5) -
Added
pdfmake.registerUrlProtocol(protocol, handler)to support custom URL protocols and replace existing protocol handlers; omitting the handler uses the default fetch downloaderExample of registering the
blobprotocol with the default fetch downloader:pdfmake.registerUrlProtocol('blob');
Example of registering a custom
assetprotocol with a custom downloader:pdfmake.registerUrlProtocol('asset', async (url, headers, validateUrlAccessPolicy) => { // Fetch logoBytes using url and headers, eg: // var logoBytes = await fs.readFile(filename); // Call validateUrlAccessPolicy(targetUrl) before following each redirect; it throws if access is denied. // Return the final URL after all redirects, or the original url if there were none. return { buffer: logoBytes, url: finalUrl }; });
Usage in a document definition:
pdfmake.createPdf({ content: [{ image: 'logo' }], images: { logo: 'asset://logo' } });
The handler receives the URL, request headers and a
validateUrlAccessPolicy(url)function, and returns the binary data and final URL. CallvalidateUrlAccessPolicy(targetUrl)before following each redirect; it throws if access is denied. -
Added
pdfmake.unregisterUrlProtocol(protocol)to remove a URL protocol handler and clear its shared resource cache -
Added the
lineHeightModestyle property to control howlineHeightis applied:'fontHeight'(default; previous behavior) - the line height is the font's natural height multiplied bylineHeight'css'- the line height isfontSize * lineHeightand the text is vertically centered in the line box (half-leading), as in CSS
-
Upgrade Unicode Line Breaking Algorithm (UAX #14) to Unicode 18.0.0
-
Fixed double-counted horizontal margins when centering or right-aligning images, SVGs, QR codes and canvases
-
Fixed canvas paths ignoring canvas positioning and alignment, and not reserving space for their drawn content
-
Fixed list bullet and number markers not following the alignment of centered or right-aligned lists
-
Fixed long text in full-width
colSpancells unnecessarily wideningautocolumns in tables with*columns -
Fixed line breaking across inline fragments and preserved explicit line breaks with
noWrap -
Fixed PDF hyperlinks containing Unicode characters, including internationalized domain names
-
Fixed pagination with
dontBreakRowsso rows connected byrowSpanstay together when they fit, and oversized groups retain their borders when split across pages -
Fixed subsequent sections using the wrong page size after an oversized unbreakable block failed to fit
-
Fixed misplaced ordered list markers at page breaks
-
Fixed ordered list markers being cut off at the first space when the
separatorcontains spaces