Skip to content

Creating new PDF on React Function #2230

@oniej

Description

@oniej

Hi, I'm new on jsPDF, and using jsPDF on Reactjs.

On the previous version, on creating new jsPDF,
The code that I use is like this:

 const page = {
            layout: 'p', //p=portrait, l=landscape
            papersize: {
                height: 330.2, //330.2mm
                width: 215.9, //215.9mm
                unit: 'mm'
            }
}

 var doc= new jsPDF(page.layout, page.papersize.unit, [page.papersize.width, page.papersize.height]);

And Shown like this:

1

It's working fine on the previous version, and I'm using 'mm' / millimeter for some circumstances.

Now, when I updated into new version of jsPDF, problem occurs.
The height and width that I assign on creating new jsPDF was not working properly.
It shown like this now.

2

I think the height and width that should be millimeters, became pixels.

Though I'm not so sure, if the problem occurs inside on jsPDF, or on Reactjs

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