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

<img> without "height" attribute fails to leave enough blank space for itself #632

Closed
Bubbu0129 opened this issue Dec 21, 2022 · 3 comments · Fixed by #634
Closed

<img> without "height" attribute fails to leave enough blank space for itself #632

Bubbu0129 opened this issue Dec 21, 2022 · 3 comments · Fixed by #634
Assignees

Comments

@Bubbu0129
Copy link

Describe the bug

Error details
In write_html(), <img> without "height" attribute will not leave enough blank space for itself. As a result, following contents overlaps with the image.

Minimal code

from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.write_html("""<img src="/path/to/img" width="500">
<p>text</p>
""")
pdf.output("issue_632.pdf")

Environment

  • OS (Linux i686)
  • Python version: 3.9.2
  • fpdf2 version: Latest

If necessary, I am ready to launch a PR to fix this.

@Bubbu0129 Bubbu0129 added the bug label Dec 21, 2022
@Lucas-C Lucas-C added the html label Dec 21, 2022
@Lucas-C
Copy link
Member

Lucas-C commented Dec 21, 2022

Thank you for reporting this @Bubbu0129!

Would you like to submit a PR in order to fix this?

@Lucas-C
Copy link
Member

Lucas-C commented Dec 21, 2022

@allcontributors please add @Bubbu0129 for bug

@allcontributors
Copy link

@Lucas-C

I've put up a pull request to add @Bubbu0129! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants