I'm using jsPDF and html2canvas to convert a div
to pdf:
<a onclick="makePdf()">PDF</a>
<div id="divToPdf">Some content here</div>
However I don't want my div
displayed on the screen. I tried using hidden
property to hide the div
:
<a onclick="makePdf()">PDF</a>
<div id="divToPdf" hidden>Some content here</div>
The problem is that the hidden
property results in a blank pdf document. How do I go about hiding the div
without this problem?
div
to pdf, not printing it.The media query in your answer seems to be for printing. – Luckey