Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-122382

html2pdf Conversion Issue with image Assets



    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 6.2.12
    • None
    • Linux/Wayland, Linux/X11



      During the conversion of HTML webpages to PDF using the html2pdf example, image assets, including .jpg, .png, etc files, intermittently fail to display in the final output PDF file. In some instances, the images appear as broken image placeholders, while in others, there is simply a blank space at their designated location within the PDF document.

      Steps to Reproduce:

      1.  build example: WebEngine Widgets Html2Pdf Example
      2. Run the built binary using the following command: 
        ./html2pdf https://qt.io output.pdf
      1. Check the output.pdf file you'll observe Issues with image assets

      Expected Behavior: The converted PDF file should consistently display all image assets, in their respective locations within the PDF document without any issues. Images should be properly embedded and visible.

      Actual Behavior: In the converted PDF file, image assets intermittently fail to display correctly. Some images appear as broken image placeholders, while others result in blank spaces at their designated locations within the PDF document.


      OS: Ubuntu 22.04 

      PDF viewer: Evence- GNOME Document Viewer 42.3, chrome web browser

      Note: please check the attached Images and output pdf file for reference:


        1. broken images.png
          broken images.png
          31 kB
        2. expect for missing images.png
          expect for missing images.png
          9 kB
        3. missing images.png
          missing images.png
          4 kB
        4. output.pdf
          1.14 MB

        Issue Links

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



              qt_webengine_team Qt WebEngine Team
              alrizwan Alber Rizwan
              0 Vote for this issue
              2 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes