$http.get(‘/receivePDFUrl‘
$http.get(‘/receivePDFUrl‘, {responseType: ‘arraybuffer‘}) // 设置$http get请求的responseType为arraybuffer .success(function(data){ var file = new Blob([data], {type: ‘application/pdf‘}); // 使用Blob将PDF Stream 转换为file var fileUrl = URL.createOjectURL(file); window.open(fileUrl); // 在新的页面中打开PDF })
blob数据ajax传输
,温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/30574.html