Search code examples
htmlcsshtml2pdf

How can I use html2pdf to render the whole page


how to let my html2pdf render the whole page? please see the example image Current page PDF

exportToPDF() {
let data = Object.assign({}, this.$refs);
            html2pdf(data.document, {
            margin: 1,
            filename: "invoice.pdf",
            image: { type: "jpeg", quality: 0.98 },
            html2canvas: { dpi: 300, letterRendering: true, },
            jsPDF: { unit: "in", format: "a4", orientation: "l" },
            });            
},

Solution

  • After change a4 format to b4 everything works well, thanks guys.

    Solved Image