我正在使用html2canvas从React组件动态生成PDF,每个组件导出为PDF时,PDF都应具有页眉和页脚(我指的是demo,我将其称为PDFTemplate),但是当我单击Download PDF
,它显示此错误Uncaught TypeError: n.appendChild is not a function
如果我删除它就可以了
const currentElement = window.document
.getElementById("pdftemplate")
.appendChild(element);
html2canvas(element)
之类的元素,但我需要每个PDF都有标题请帮忙吗?
https://codesandbox.io/s/frosty-mountain-yx7jh
我将在单击下载按钮时创建一个弹出对话框。在要使用herader和所有内容渲染pdf的位置,然后下载。