I'm new to React Js and i'm trying to print a file from a url using printJS.
My intention is to access the DB and get a url of pdf file to print, and then print it (without opening a new page if possible).
For testing, after returning with the url i'm just trying to print a local file and not the url given from the db(I assume there might problematic due to security issues, CORS, etc.)
After importing the library into the project i'm trying to do:
printJS('path/to/file/a.pdf');
I don't get any error, and it seems nothing happens, except this warning:
Resource interpreted as Document but transferred with MIME type application/pdf: "blob:http://localhost:3000/18bdc43e-6b53-47ea-91e4-bb62ad76dcc6".
The file exists and when i'm using the url bar and putting path/to/file/a.pdf, i'm able to access the pdf.