Skip to content

Commit

Permalink
fixed sharing URL resolver for not available URLs #2828
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Jan 3, 2025
1 parent 9974c93 commit feb4afe
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed URL resolving for same URL in browser
- Fixed sharing URL resolver for not available URLs

## 0.3.0-beta.15 - 2025-01-01

Expand Down
2 changes: 1 addition & 1 deletion src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class pdfmake {
options.progressCallback = this.progressCallback;
options.tableLayouts = this.tableLayouts;

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);

return this._transformToDocument(pdfDocumentPromise);
Expand Down
2 changes: 1 addition & 1 deletion src/browser-extensions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let defaultClientFonts = {
class pdfmake extends pdfmakeBase {
constructor() {
super();
this.urlResolver = new URLBrowserResolver(this.virtualfs);
this.urlResolver = () => new URLBrowserResolver(this.virtualfs);
this.fonts = defaultClientFonts;
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const URLResolver = require('./URLResolver').default;
class pdfmake extends pdfmakeBase {
constructor() {
super();
this.urlResolver = new URLResolver(this.virtualfs);
this.urlResolver = () => new URLResolver(this.virtualfs);
}

_transformToDocument(doc) {
Expand Down

0 comments on commit feb4afe

Please sign in to comment.