Comparing version
# Changelog | ||
## 0.3.0-beta.16 - 2025-04-26 | ||
- Update pdfkit to 0.17.0 | ||
- Update Roboto font (version 3.011) | ||
- Fixed URL resolving for same URL in browser | ||
- Fixed sharing URL resolver for not available URLs | ||
## 0.3.0-beta.15 - 2025-01-01 | ||
@@ -11,3 +18,3 @@ | ||
- Fix big size pdfmake bundle for browser | ||
- Fixed big size pdfmake bundle for browser | ||
@@ -14,0 +21,0 @@ ## 0.3.0-beta.13 - 2024-12-15 |
@@ -23,3 +23,3 @@ "use strict"; | ||
options.tableLayouts = this.tableLayouts; | ||
let printer = new _Printer.default(this.fonts, this.virtualfs, this.urlResolver); | ||
let printer = new _Printer.default(this.fonts, this.virtualfs, this.urlResolver()); | ||
const pdfDocumentPromise = printer.createPdfKitDocument(docDefinition, options); | ||
@@ -26,0 +26,0 @@ return this._transformToDocument(pdfDocumentPromise); |
@@ -26,3 +26,3 @@ "use strict"; | ||
super(); | ||
this.urlResolver = new _URLBrowserResolver.default(this.virtualfs); | ||
this.urlResolver = () => new _URLBrowserResolver.default(this.virtualfs); | ||
this.fonts = defaultClientFonts; | ||
@@ -29,0 +29,0 @@ } |
@@ -52,8 +52,13 @@ "use strict"; | ||
if (url.toLowerCase().indexOf('https://') === 0 || url.toLowerCase().indexOf('http://') === 0) { | ||
fetchUrl(url, headers).then(buffer => { | ||
this.fs.writeFileSync(url, buffer); | ||
if (this.fs.existsSync(url)) { | ||
// url was downloaded earlier | ||
resolve(); | ||
}, result => { | ||
reject(result); | ||
}); | ||
} else { | ||
fetchUrl(url, headers).then(buffer => { | ||
this.fs.writeFileSync(url, buffer); | ||
resolve(); | ||
}, result => { | ||
reject(result); | ||
}); | ||
} | ||
} else { | ||
@@ -60,0 +65,0 @@ // cannot be resolved |
@@ -9,3 +9,3 @@ "use strict"; | ||
super(); | ||
this.urlResolver = new URLResolver(this.virtualfs); | ||
this.urlResolver = () => new URLResolver(this.virtualfs); | ||
} | ||
@@ -12,0 +12,0 @@ _transformToDocument(doc) { |
{ | ||
"name": "pdfmake", | ||
"version": "0.3.0-beta.15", | ||
"version": "0.3.0-beta.16", | ||
"description": "Client/server side PDF printing in pure JavaScript", | ||
@@ -13,28 +13,28 @@ "main": "js/index.js", | ||
"linebreak": "^1.1.0", | ||
"pdfkit": "^0.16.0", | ||
"xmldoc": "^1.3.0" | ||
"pdfkit": "^0.17.0", | ||
"xmldoc": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.26.4", | ||
"@babel/core": "^7.26.0", | ||
"@babel/cli": "^7.27.0", | ||
"@babel/core": "^7.26.10", | ||
"@babel/plugin-transform-modules-commonjs": "^7.26.3", | ||
"@babel/preset-env": "^7.26.0", | ||
"@eslint/js": "^9.17.0", | ||
"@babel/preset-env": "^7.26.9", | ||
"@eslint/js": "^9.25.1", | ||
"assert": "^2.1.0", | ||
"babel-loader": "^9.2.1", | ||
"babel-loader": "^10.0.0", | ||
"brfs": "^2.0.2", | ||
"browserify-zlib": "^0.2.0", | ||
"buffer": "6.0.3", | ||
"core-js": "3.39.0", | ||
"eslint": "^9.17.0", | ||
"eslint-plugin-jsdoc": "^50.6.1", | ||
"expose-loader": "^5.0.0", | ||
"buffer": "^6.0.3", | ||
"core-js": "^3.41.0", | ||
"eslint": "^9.25.1", | ||
"eslint-plugin-jsdoc": "^50.6.11", | ||
"expose-loader": "^5.0.1", | ||
"file-saver": "^2.0.5", | ||
"globals": "^15.14.0", | ||
"mocha": "^11.0.1", | ||
"globals": "^16.0.0", | ||
"mocha": "^11.1.0", | ||
"npm-run-all": "^4.1.5", | ||
"process": "^0.11.10", | ||
"rewire": "^7.0.0", | ||
"shx": "^0.3.4", | ||
"sinon": "^19.0.2", | ||
"shx": "^0.4.0", | ||
"sinon": "^20.0.0", | ||
"source-map-loader": "^5.0.0", | ||
@@ -44,6 +44,6 @@ "stream-browserify": "^3.0.0", | ||
"svg-to-pdfkit": "^0.1.8", | ||
"terser-webpack-plugin": "^5.3.11", | ||
"terser-webpack-plugin": "^5.3.14", | ||
"transform-loader": "^0.2.4", | ||
"util": "^0.12.5", | ||
"webpack": "^5.97.1", | ||
"webpack": "^5.99.7", | ||
"webpack-cli": "^6.0.1" | ||
@@ -50,0 +50,0 @@ }, |
# pdfmake [![Node.js CI][githubactions_img]][githubactions_url] [![GitHub][github_img]][github_url] [![npm][npm_img]][npm_url] [![Bower][bower_img]][bower_url] [![Packagist][packagist_img]][packagist_url] [![CDNJS][cdnjs_img]][cndjs_url] | ||
[githubactions_img]: https://github.com/bpampuch/pdfmake/workflows/Node.js%20CI/badge.svg?branch=master | ||
[githubactions_img]: https://github.com/bpampuch/pdfmake/actions/workflows/node.js.yml/badge.svg?branch=master | ||
[githubactions_url]: https://github.com/bpampuch/pdfmake/actions | ||
[github_img]: https://img.shields.io/github/release/bpampuch/pdfmake.svg | ||
[github_img]: https://img.shields.io/github/release/bpampuch/pdfmake.svg?colorB=0E7FBF | ||
[github_url]: https://github.com/bpampuch/pdfmake/releases/latest | ||
@@ -8,0 +8,0 @@ |
@@ -21,3 +21,3 @@ import Printer from './Printer'; | ||
let printer = new Printer(this.fonts, this.virtualfs, this.urlResolver); | ||
let printer = new Printer(this.fonts, this.virtualfs, this.urlResolver()); | ||
const pdfDocumentPromise = printer.createPdfKitDocument(docDefinition, options); | ||
@@ -24,0 +24,0 @@ |
@@ -24,3 +24,3 @@ import pdfmakeBase from '../base'; | ||
super(); | ||
this.urlResolver = new URLBrowserResolver(this.virtualfs); | ||
this.urlResolver = () => new URLBrowserResolver(this.virtualfs); | ||
this.fonts = defaultClientFonts; | ||
@@ -27,0 +27,0 @@ } |
@@ -56,8 +56,13 @@ const fetchUrl = (url, headers = {}) => { | ||
if (url.toLowerCase().indexOf('https://') === 0 || url.toLowerCase().indexOf('http://') === 0) { | ||
fetchUrl(url, headers).then(buffer => { | ||
this.fs.writeFileSync(url, buffer); | ||
if (this.fs.existsSync(url)) { | ||
// url was downloaded earlier | ||
resolve(); | ||
}, result => { | ||
reject(result); | ||
}); | ||
} else { | ||
fetchUrl(url, headers).then(buffer => { | ||
this.fs.writeFileSync(url, buffer); | ||
resolve(); | ||
}, result => { | ||
reject(result); | ||
}); | ||
} | ||
} else { | ||
@@ -64,0 +69,0 @@ // cannot be resolved |
@@ -8,3 +8,3 @@ const pdfmakeBase = require('./base').default; | ||
super(); | ||
this.urlResolver = new URLResolver(this.virtualfs); | ||
this.urlResolver = () => new URLResolver(this.virtualfs); | ||
} | ||
@@ -11,0 +11,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13896077
0.68%91749
0.44%+ Added
+ Added
- Removed
- Removed
Updated
Updated