Cuando uso la función html2pdf() para descargar en formato PDF, en esa imagen no se muestra la representación del enlace. El enlace mencionado a continuación utilizado deja un espacio en blanco en el PDF. No muestra ninguna imagen en PDF.
"https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=http://hellovcard.com/6160175f9b7f3&choe=UTF-8&chof=gif" <img src="https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=http://hellovcard.com/6160175f9b7f3&choe=UTF-8&chof=gif" alt="qr code">Código que he usado:
function saveAsPDF() { var element = document.getElementById('printableArea'); var opt = { margin: 0.3, filename: 'download.pdf', image: {type: 'jpeg', quality: 1}, html2canvas: {scale: 4, dpi: 72, letterRendering: true}, jsPDF: {unit: 'in', format: 'A2'}, html2canvas: { onclone: (element) => { const svgElements = Array.from(element.querySelectorAll('svg')); svgElements.forEach(s => { const bBox = s.getBBox(); s.setAttribute("x", bBox.x); s.setAttribute("y", bBox.y); s.setAttribute("width", bBox.width); s.setAttribute("height", bBox.height); }) } }, }; html2pdf().set(opt).from(element).save(); } 