JSPDF问题 - 图像渲染

发布于 2025-02-06 08:47:59 字数 589 浏览 0 评论 0原文

我正在使用 JSPDF库来生成带有4张图像的MRI报告。每当提交给服务器的请求时,这些图像都会保存到指定的目录中,他们在每个请求时都会更改

将它们从目录渲染到报告时,第一个请求的图像不是新请求的图像。 JSPDF中是否有一种缓存?

generateMRIReport(patientNumber){
    window.jsPDF = window.jspdf.jsPDF;
    const MRI_REPORT = new jsPDF();
     MRI_REPORT.addImage(`WEB-INF/media/testing_mods_${patientNumber}.png`, 'PNG', 5, 80, 196, 70);
     MRI_REPORT.addImage(`WEB-INF/media/testing_preds.png_${patientNumber}.png`, 'PNG', 5, 160, 196, 70);
     MRI_REPORT.save(`NEUROPH_${patientNumber}_MRI_REPORT.pdf`);
}

I am using jsPDF library to generate a MRI report with 4 images. Every time a request submitted to a server, these images are saved to a specified directory and they are changing with each request.

when rendering them from the directory to the report, the images from the first request is rendered not the new ones.
Is there a type of caching in jsPDF ?

generateMRIReport(patientNumber){
    window.jsPDF = window.jspdf.jsPDF;
    const MRI_REPORT = new jsPDF();
     MRI_REPORT.addImage(`WEB-INF/media/testing_mods_${patientNumber}.png`, 'PNG', 5, 80, 196, 70);
     MRI_REPORT.addImage(`WEB-INF/media/testing_preds.png_${patientNumber}.png`, 'PNG', 5, 160, 196, 70);
     MRI_REPORT.save(`NEUROPH_${patientNumber}_MRI_REPORT.pdf`);
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文