Estoy usando JsPDf para convertir el elemento html dom a pdf pero después de generar PDf. El tamaño del PDF agrega espacio adicional y lo hace más pequeño. Por favor, consulte el enlace para obtener más detalles.
const _generatePdf = ()=>{ // var [width , height] = size var page_el = document.getElementById("doc") var width = page_el.clientWidth* (96/72) var height = page_el.clientHeight * (96/72) // console.log(page_el.offsetWidth*(96/72), width) var doc = new jsPDF({ orientation:"l", unit:"pt", format:[height, width], }) console.log(doc.internal.pageSize.getWidth(), width) console.log(doc.internal.pageSize.getHeight(), height) doc.html(document.querySelector("#page"),{ callback:function(pdf){ // console.log(pdf) pdf.save("mypdf.pdf") }, html2canvas:{ scale:1 } }) }