Skip to content

Set the margin to pdf page #2295

Closed
Closed
@suhasbhattu

Description

@suhasbhattu

I am using jsPDF version 1.5.3 and I want to convert HTML into PDF. I also want to add margin to each pages of PDF so that content should not get cut while splitting it to next page. I have written following code until now:

var pdf = new jsPDF('p', 'pt', 'a4');

var margin = {top: 10, right: 20, bottom: 10, left: 20};

pdf.html(document.getElementById('content'), {
      callback : function (pdf) {
          pdf.save('content.pdf');
      }
});

I have a margin to set, but didn't find any way to set. Does anyone help me out here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions