我正在尝试打开通过API下载的PDF。
API响应如下:
这是我的Angular打印功能:
print() {
this.userService.print(this.route.parent.snapshot.paramMap.get('id'))
.pipe(first())
.subscribe(
(result: any) => {
var fileURL = URL.createObjectURL(new Blob([result], { type: "application/pdf" }));
window.open(fileURL);
});
在客户端打开一个新标签,错误为“无法加载PDF文档”