Uploaded image for project: 'Qt WebBrowser'
  1. Qt WebBrowser
  2. QTWB-82

first <br> ignored when converting HTML to PDF using QT WebEngine / Chromium

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 1.0
    • General
    • None
    • Windows

      When converting an HTML document to PDF using the QT WebEngine (or Chromium headless), the first <br> tag inside a <li> element is consistently ignored. This results in missing line breaks in the generated PDF. The issue does not occur in browser rendering, only during PDF export.

       

      Steps to reproduce:

      1. Create an HTML file with:
        {{<ul>
        <li>test<br>Text with expected line break</li>
        </ul>}}
      2. Convert the file to PDF using QT WebEngine or Chrome headless.
      3. Observe that the <br> is ignored in the output PDF.

      Workaround:
      Inserting a dummy <br> tag before the <ul> (e.g. <br style="display:none">) causes the first <br> inside <li> to be respected during PDF rendering.

      Expected behavior:
      All <br> tags should be respected during PDF conversion, regardless of their position.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt_webengine_team Qt WebEngine Team
            mischal Michael Thummerer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes