eligrey / eligrey/FileSaver.js
file-saver saveAs : Error while opening the pdf
- Dominant language
- JavaScript
- Stars
- 22k
- Forks
- 4.3k
- PR merge metrics
- No merged PRs in 30d
Description
I am saving a pdf to my local machine, using saveAs from 'file-saver' library. Data is provided locally, it is not fetched from server.
Pdf is getting saved successfully, but while opening the pdf I am getting an error as **File type plain text document (text/plain) is not supported** though I am mentioning type as pdf.
Below is the code. I am developing the application using reactjs.
```
import { saveAs } from 'file-saver';
const blob = new Blob([ ], { type: 'application/pdf'
})
saveAs(blob, "trial.pdf" );
```
**Attatching screenshot of the error**

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.