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

SaveAs does not work with Blobs in 2.0 #519

Closed
green3g opened this issue Jan 21, 2019 · 9 comments
Closed

SaveAs does not work with Blobs in 2.0 #519

green3g opened this issue Jan 21, 2019 · 9 comments

Comments

@green3g
Copy link

green3g commented Jan 21, 2019

The following code does not produce any file download results in chrome: In addition, no errors are given:

saveAs(blob, fileName);

See:
bpampuch/pdfmake#1599

@Ruffio
Copy link

Ruffio commented Jan 21, 2019

Have you tried what it says in the README?

image

@green3g
Copy link
Author

green3g commented Jan 22, 2019

True, worth a shot. But the readme also mentions using

import {saveAs} from 'file-saver';

@Ruffio
Copy link

Ruffio commented Jan 22, 2019

Perhaps pdfmake should update how it calls FileSaver?

@devrathnd
Copy link

Using file-saver in an angular 7 app but it isn't working when using saveAs. Amchart's export too doesn't work. saveAs doesn't throw any error and there is no file being downloaded too. But it works when using 1.3.8.

const fileSaver: any = require('file-saver');
canvas.toBlob((blob: Blob) => {
  .saveAs(blob, filename);
}, filetype);

@dagda1
Copy link

dagda1 commented Feb 22, 2019

@devrathnd depending on your tsconfig, it should be import * as FileSaver from 'file-saver'; or import FileSaver as 'file-saver'.

It is a default export

@moghthalkushal
Copy link

I am facing the same issue , despite the fact i am using import * as FileSaver from 'file-saver' , i am saving blob that is a zip of all images.

FileSaver.saveAs(content, 'AllGraphs.zip');

@Alex1100
Copy link

Alex1100 commented Mar 7, 2019

This ticket should be closed since bpampuch/pdfmake#1599 has been closed.

@green3g green3g closed this as completed Apr 3, 2019
@renilbabu03
Copy link

@devrathnd : Were you able to solve this issue? For me its working fine in development but in production its not working. And there are no errors. Using Angular 7

@renilbabu03
Copy link

import {saveAs} from "file-saver";

This saved my day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants