I'm trying to use printJS
in Angular and print an image (PNG). I did the import:
import { printJS } from "print-js/dist/print.min.js";
Then I execute this printing code in function, according to the documentation:
printJS('no-image.png', 'image');
I can't find solution to fix this.
I think you need to use default import for this library:
import printJS from "print-js";
Also, for NPM packages you should never import directly from js path. Usually you would just import from package itself, in your case print-js
.