这是在 Angular 2 中下载 pdf 文件的功能,当我下载 Pdf 文件时,它是损坏的文件。那么我该如何解决这个问题。\n它显示的是这样的损坏数据。\n%PDF-1.5\n%\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd \n\xe2\x86\xb566 0 对象\n<>\nendobj
\n\ndownloadFile() {\n //this.http.get('https://contactsapi.apispark.net/v1/companies/').subscribe(\n this.http.get('assets/Files/booking.pdf').subscribe(\n (response: any) => {\n console.log(response);\n let parsedResponse =(response)\n var blob = new Blob([response], {type: 'application/pdf'});\n var filename = 'booking.pdf';\n saveAs(blob, filename);\n });\n }\nRun Code Online (Sandbox Code Playgroud)\n