Skip to content

jsPDF: custom font styling problem #3655

@AyanAcharya

Description

@AyanAcharya

hello,
i made a pdf using jspdf with custom font called Nunito Sans.i used doc.html(). But after using this font the css inside this not working properly.but in default font which provide by jspdf the style works perfectly.

issues->

  1. the words are overlapping side by side.
    2.tried other custom font like dm-sans the problem was also there.
  2. , . / ' ' ; this characters also not move with words.

`

const componentAsHTML = `



 <div  class="bg-white h-full rounded-2xl" >
<p class="font-nunito-sans">  Lorem ipsum dolor sit amet consectetur adipisicing elit. Esse, consequuntur accusantium sequi itaque dolores assumenda debitis commodi nostrum. Odio, dolor. Quo aliquid neque vitae veniam omnis odio quae at non?</p></div>`;



doc.html(componentAsHTML, {
  callback: function () {
    doc.save("downloaded-pdf.pdf");
  },
  x: 50,
  y: 20,
});

}`
Screenshot 2023-10-12 at 12 16 13 PM

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