Skip to content

Instantly share code, notes, and snippets.

View gkueny's full-sized avatar
😎
cool

Gaëtan Kueny gkueny

😎
cool
View GitHub Profile
@timneutkens
timneutkens / index.js
Created November 25, 2016 11:37
Save PDF using javascript (isomorphic-fetch and file-saver)
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'))