Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsPDF.html truncates some whitespace characters from each element #3742

Open
geoidesic opened this issue Jun 18, 2024 · 0 comments
Open

jsPDF.html truncates some whitespace characters from each element #3742

geoidesic opened this issue Jun 18, 2024 · 0 comments

Comments

@geoidesic
Copy link

geoidesic commented Jun 18, 2024

jsPDF v 2.5.1

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

  pdf.html('<h1>How to Train Your Dragon</h1>', {
    callback: function (doc) {
      pdf.save(`${journal.name}.pdf`);
    },
    autoPaging: 'text',
    jsPDF: pdf,
    windowWidth: 600,
    width: 600
  });
  

The output in the PDF is "Howto TrainYourDragon". Note the missing spaces between some words.

Similar problems reported by other users: https://stackoverflow.com/questions/69705309/jspdf-html2canvas-losing-spaces-and-misaligning-text-generally

@geoidesic geoidesic changed the title jsPDF.html truncates the first space character from each element jsPDF.html truncates some whitespace characters from each element Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant