Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. QWebView: print with page break
Forum Update on Tuesday, May 27th 2025

QWebView: print with page break

Scheduled Pinned Locked Moved Qt WebKit
10 Posts 3 Posters 7.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dbor
    wrote on last edited by
    #1

    Hello,

    is it possible to print a html page with including page breaks with the QWebView?
    The html page includes this style: page-break-before:always. But the printer ignore the page break.

    Thanks!
    David

    1 Reply Last reply
    0
    • B Offline
      B Offline
      benjamin.poulain
      wrote on last edited by
      #2

      Are you sure the stylesheet is not defined only for a specific media like screen?

      Stylesheet can be specific to media type ("http://www.w3.org/TR/CSS2/media.html":http://www.w3.org/TR/CSS2/media.html ). You might want to have one for the "print" type.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dbor
        wrote on last edited by
        #3

        The style is not defined for a specific media: ... <tr style='page-break-before:always;'> ...

        1 Reply Last reply
        0
        • B Offline
          B Offline
          benjamin.poulain
          wrote on last edited by
          #4

          Hum, then I guess it could be bug. Do you have the same problem with other WebKit port (Chrome, Safari, etc)?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dbor
            wrote on last edited by
            #5

            I'm able to print the html-File with firefox correctly. Unfortunately QtWebView ignore the page break.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              benjamin.poulain
              wrote on last edited by
              #6

              Firefox is based on Gecko, not WebKit. That is a totally different engine.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dbor
                wrote on last edited by
                #7

                Okay, sorry.
                I've installed Chrome and Chrome ignored the page breaks too.

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  benjamin.poulain
                  wrote on last edited by
                  #8

                  Ok, this is a problem with the engine itself then, very likely a bug.

                  Could you open a bug on "https://bugs.webkit.org/":https://bugs.webkit.org/ with a test case showing the problem? You should mention you tried on QtWebKit and Chrome. The component in "Printing".

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    dbor
                    wrote on last edited by
                    #9

                    https://bugs.webkit.org/show_bug.cgi?id=48523

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      ihaveajob
                      wrote on last edited by
                      #10

                      I wonder if this is related to this QWebView print issue I filed yesterday: https://bugreports.qt.io/browse/QTBUG-45572
                      It's a P3 priority right now, but I imagine if others are encountering it in their code and they follow the issue, it might receive more attention.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved