Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEnginePage printToPdf footer
Qt 6.11 is out! See what's new in the release blog

QWebEnginePage printToPdf footer

Scheduled Pinned Locked Moved Unsolved QtWebEngine
7 Posts 5 Posters 2.5k 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.
  • M Offline
    M Offline
    M.Cocktail
    wrote on last edited by M.Cocktail
    #1

    Hi,

    I'm using QWebEnginePage whit setHtml et printToPdf to create a new PDF. I want to add page number like (page # of #) on each page. How can i do that ?

    Thanks
    M.C

    1 Reply Last reply
    1
    • M Offline
      M Offline
      manishsharma
      wrote on last edited by
      #2

      Hi,

      Any update on this topic. I am also interested in adding a footer to the pdf. Can it be done?

      Regards,
      Manish

      JonBJ 1 Reply Last reply
      0
      • artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by
        #3

        Hi, I think what you need is QPdfWriter. You can manipulate rich text content using QTextDocument and associated classes - how to approach the subject is written here.

        For more information please re-read.

        Kind Regards,
        Artur

        M 1 Reply Last reply
        0
        • M Offline
          M Offline
          MajidKamali
          wrote on last edited by
          #4

          This is more of a css issue and actually it's very hard to achieve
          https://stackoverflow.com/questions/15797161/browser-support-for-css-page-numbers

          M 1 Reply Last reply
          0
          • artwawA artwaw

            Hi, I think what you need is QPdfWriter. You can manipulate rich text content using QTextDocument and associated classes - how to approach the subject is written here.

            M Offline
            M Offline
            manishsharma
            wrote on last edited by
            #5

            @artwaw thanks for the tip, looks like QTextDocument only supports a subset of html and css features. I did a quick sample using QPdfWriter & QTextDocument but it could not render the html file properly due to un-supported css tags.

            1 Reply Last reply
            0
            • M MajidKamali

              This is more of a css issue and actually it's very hard to achieve
              https://stackoverflow.com/questions/15797161/browser-support-for-css-page-numbers

              M Offline
              M Offline
              manishsharma
              wrote on last edited by
              #6

              @MajidKamali Did you try this approach and had it worked? I tried page counters but could not get it working. Please let me know if you have any sample or example. Thanks!

              1 Reply Last reply
              0
              • M manishsharma

                Hi,

                Any update on this topic. I am also interested in adding a footer to the pdf. Can it be done?

                Regards,
                Manish

                JonBJ Online
                JonBJ Online
                JonB
                wrote on last edited by
                #7

                @manishsharma
                https://bugreports.qt.io/browse/QTBUG-61032
                ? Not a solution, more a confirmation of lack of feature?

                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