Open emahuni opened 4 years ago
My solution was to clone the element and add a class to it, then assign a different set of css rules to that class.
e.g:
var element = document.getElementById('element-to-pdf').cloneNode(true);
element.classList.add("pdf-format");
html2pdf(element, {
filename: 'html2pdf.pdf',
image: { type: 'jpeg', quality: 1 }
})
I have been digging around to find a solution to this and was disappointed that I could find none. Here is my solution after going through html2pdf code. Unfortunately they don't document the lib very concisely and this is why we are glob-trotting looking for answers like this.
This enables me to manipulate the document however I like as you would with onclone.