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

Text overlapping in chrome latest version on using html2canvas javascript library #3194

Open
nishant-appvent opened this issue Sep 2, 2024 · 3 comments

Comments

@nishant-appvent
Copy link

363686157-bb109689-7cf5-4068-bb86-a0770784d5f0
The actual correct HtmlElement

363686266-6abffc22-5e4c-49bc-923d-1f46f0374d33
The image after converting it through html2canvas version "^1.4.1".

KnvMmi9G
image on commenting this code in node_modules.
var segmentWords = function (value, styles) { // if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) { // // eslint-disable-next-line @typescript-eslint/no-explicit-any // var segmenter = new Intl.Segmenter(void 0, { // granularity: 'word' // }); // // eslint-disable-next-line @typescript-eslint/no-explicit-any // return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; }); // } return breakWords(value, styles); };

Bug reports:

I am facing this issue in latest chrome version i.e. 128.0.6613.84. While it was working fine with chrome version 127.0.6533.119. Can any one please suggest any solution for this?
Can you please look into it, @niklasvh?

Specifications:

  • html2canvas version tested with: 1.4.1
  • Browser & version: Google chrome 128.0.6613.84.
  • Operating system: Ubuntu 20.04.6 LTS
@suddath-somani
Copy link

Facing the same issue. We are using jspdf to convert static html template to pdf, jsPdf internally uses html2canvas for this conversion. Everything was working fine before, but now after chrome v-128 update, the generated pdf seems to break.

sample_jspdfpng

Can anyone suggest an alternative library to convert static html to pdf?

Note: The html to be downloaded is not being rendered, so the alternative should be able to handle the conversion without rendering.

@nishant-appvent
Copy link
Author

We fixed this by removing "zoom" css property from that element. Have a look at this chrome release note, We were also facing this on using scale so we removed it.

@suddath-somani
Copy link

Yes i figured. Our application's layout is structured as such that it is not possible to remove zoom property at this point.

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

2 participants