Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set vfs of pdfMake in esbuils angular 16 #2628

Closed
ahmed-a-ibrahim opened this issue Sep 23, 2023 · 2 comments
Closed

set vfs of pdfMake in esbuils angular 16 #2628

ahmed-a-ibrahim opened this issue Sep 23, 2023 · 2 comments

Comments

@ahmed-a-ibrahim
Copy link

import * as pdfMake from 'pdfmake/build/pdfmake';
import * as pdfFonts from 'pdfmake/build/vfs_fonts';

(pdfMake as any).vfs = pdfFonts.pdfMake.vfs;

[ERROR] Cannot assign to import "vfs"

libs/table/src/lib/table/pdfExport/printDoc.ts:3:8:
  3 │ pdfMake.vfs = pdfFonts.pdfMake.vfs;
    ╵         ~~~

Imports are immutable in JavaScript. To modify the value of this import, you must export a setter function in the imported file (e.g. "setVfs") and then import and call that function here instead.

@mateusmrosa
Copy link

`this._notifier = notifier;

this._scriptService.load('pdfMake', 'vfsFonts');

//pdfMake.vfs = pdfFonts.pdfMake.vfs;

(pdfMake as any).vfs = pdfFonts.pdfMake.vfs;`


Here this way worked for me!

@liborm85
Copy link
Collaborator

liborm85 commented Nov 2, 2024

Resolved see #2654 (comment).

@liborm85 liborm85 closed this as completed Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants