可能是因为在创建打印容器时设置了display: none,导致打印时容器不可见。可以尝试将printContainer.style.display的值改为block,或者将其直接添加到document.body而不是printDocument.body。此外,还可以检查PDF Blob流是否正确加载,并确保浏览器支持打印PDF。

printPDFspdfBlobs const iframe = documentcreateElementiframe; iframestyledisplay = none; documentbodyappendChildiframe; const printWindow = iframecontentWindow iframecontentDocum

原文地址: http://www.cveoy.top/t/topic/isra 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录