Skip to content

jsPDF contents cut off issue with vue components and tailwind #3560

@ChamkhiAnas

Description

@ChamkhiAnas

"I have read and understood the contribution guidelines.".

I am using jsPDF to convert HTML components into a PDF.

Bellow is the code for that,

var doc = new jsPDF({orientation: 'l',unit: 'px',format: [1250,1100],compress : true});
let component=document.getElementById('document');
doc.html(component,{
pagesplit: true,
margin: [10, 0, 50, 0],
callback: function (doc) {

      doc.save("report.pdf");


    },
    x: 0,
    y: 0,

    });

The resulting PDF looks like. The resulting PDF looks like.
bbug2

I expect jsPDF to move the component to the next page whenever its find that the size of the component is bigger than the rest of the current page.

PS: im importing many vue components to convert them to PDF , i've tried to upload the project in jsFiddle but i have many components and the project is big , any solution plz ? im stuck here for more than a week

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions