Resolve JSPDF errors when converting HTML to PDF by using html2canvas to render DOM elements as images.