parallax/jsPDF

autoPaging: 'text' messes up lineheights

Open

#3,403 opened on Apr 6, 2022

View on GitHub
 (9 comments) (6 reactions) (0 assignees)JavaScript (4,596 forks)batch import
Bughelp wanted

Repository metrics

Stars
 (28,280 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

HTML

<h2>Hi there,</h2><p>this is a <em>basic</em> example of <strong>tiptap</strong>. <br>Next up: A bullet list:</p><ul><li><p>Free Open Source Software</p></li><li><p>Plattform independent</p></li></ul><p>Let’s try a code block:</p><pre><code class="language-css">
body {
    background-color: rgba(200,200,24,1);
}
</code></pre><p>1 Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt </p>

JSPDF

doc.html(editorcontent, {
          callback: (doc) => {     },
          x: 0,
          y: 0,
          margin: [20,20,20,20],
          width :400,
          windowWidth:420,
          autoPaging: 'text',  //text, slice, false
});

As you can see in the following screenshots the < em > and the < strong > tags as well as < code >< pre > tag are messed up somehow.

autoPaging: slice :+1: Screenshot_20220406_211512 autoPaging: text :-1: Screenshot_20220406_211605

i am using "jspdf": 2.5.1 "node": 16.13.2

Contributor guide