失败:尝试在angular9中下载pdf时没有文件

时间:2020-07-06 12:14:32

标签: pdf angular9

我从服务器获取pdf网址通过使用url,我正在下载pdf

downloadAgreement(applicationData: any): void {
        const link = document.createElement('a');
        link.setAttribute('target', '_blank');
        link.setAttribute('href', 'applicationData.lagFileLocation');
        console.log(applicationData.lagFileLocation);
        link.setAttribute('download.pdf');
        document.body.appendChild(link);
        link.click();
        link.remove();
    }

0 个答案:

没有答案