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

HTML 2 Canvas issue on MacOS #3195

Open
2 tasks done
talhameer opened this issue Sep 4, 2024 · 0 comments
Open
2 tasks done

HTML 2 Canvas issue on MacOS #3195

talhameer opened this issue Sep 4, 2024 · 0 comments

Comments

@talhameer
Copy link

Please make sure you are testing with the latest release of html2canvas.
Old versions are not supported and issues reported for them will be closed.

Please follow the general troubleshooting steps first:

  • You are using the latest version
  • I'm using from npm

Bug reports:

I'm creating HTML-to-PDF using this package. The HTML preview is perfect on all devices including Mac and Windows. But when I make a PDF, everything goes smoothly on Windows and all browsers. But on Mac, I face some issues related to image placement on MacBook when I make PDFs. On Safari, the image is not displayed. And on Google Chrome the image is zoomed and not positioned centered as it is previewed.

The following are the CSS styles that are being applied.

export const ImageWrapper = styled.div`
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1 / 1;
  margin-bottom: 20px;

  img {
    position: absolute;
    width: 100%;
    height: auto;
  }
`;

Please let me know how I can fix this issue.

Specifications:

  • html2canvas version tested with: 1.4.1
  • Browser & version: Chrome and Safari
  • Operating system: MacOS
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