Created
November 25, 2016 11:37
-
-
Save timneutkens/f5eaa9f94cf4e1152149801054e6967c to your computer and use it in GitHub Desktop.
Save PDF using javascript (isomorphic-fetch and file-saver)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'isomorphic-fetch' | |
import { saveAs } from 'file-saver' | |
fetch('/url/with/pdf', { | |
headers: { | |
'Content-Type': 'application/pdf' | |
}, | |
responseType: 'blob' | |
}).then(response => response.blob()) | |
.then(blob => saveAs(blob, 'test.pdf')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Спасибо