Open xbln opened 1 week ago
Welcome to fpdf2, @xbln !
As requested in the bug report template (that you summarily deleted instead of using it), please show us a minimal code example that produces the described result.
The explanation you gave us does not make it possible to reproduce the effect you're seeing. And if we can't reproduce an error, then we can't fix it.
I agree with @gmischler, we need some SHORT code snippet to be able to help you 🙂
As mentioned in the bug report template that you must have seen, this page provides good explanation on how to craft a good minimal, reproducible example: https://stackoverflow.com/help/minimal-reproducible-example
Sorry, here is the code:
from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.write_html("""
<p>Is:</p>
<ul>
<li>Unordered list</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li>
</ul>
<ol>
<li>Ordered list</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li>
</ol>
Should be:
<ul>
<li>Ordered list</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et<br>
dolore magna aliqua. Ut enim ad minim veniam</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et<br>
dolore magna aliqua. Ut enim ad minim veniam</li>
</ul>
<ol>
<li>Ordered list</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et<br>
dolore magna aliqua. Ut enim ad minim veniam</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et<br>
dolore magna aliqua. Ut enim ad minim veniam</li>
</ol>
""")
pdf.output("html.pdf")
Output is:
A few days ago #1170 has been merged, which fixes this (already reported in #1073).
Most likely your test with 2.7.10 (current HEAD) was just before that. Can you try that again please?
The
indentation of list items is not flush on a new lineShould be:
But is:
* jfjkjkfjfd dflfdlflklkfd lkfdklfdklmf fdklfdklfd ldfklfdklfd lkdfklfkld dflkfdkldf ldfklkkldfl fdldflkfdklklfd ldflkfdlkdfl ldf df fd lldf ldfllkfdklfkl lkfdklfdkl kldfklfdlkfd lkdflkfdlkdflk lkdfkllkfdkfd ldfl fd
Use of tag_indents={"li": 5} doesn´t help I checked also ver 2.7.10 (master), but no improvement