Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPrinter pagination

QPrinter pagination

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 857 Views 2 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
    Mark81
    wrote on last edited by
    #1

    I'm going to print some long html table using a QTextDocument. On each page I will put a header and a footer. I'm able to paint all the stuff on the page, but I don't understand how to split pages.

    The data source for each table is a QList<MyStruct>. The structure contains all the data to be printed, say each item is one row. Right now I'm iterating the QList and append to the html the <tr>/<td> tags. When I reach the bottom of a page I should issue a page break and continue on the following one. But how I can know I'm reaching the bottom margin?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Did you try the
      http://doc.qt.io/qt-5/qtextdocument.html#print
      It can split into pages, but im not sure how good it is with one big table.

      M 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        Did you try the
        http://doc.qt.io/qt-5/qtextdocument.html#print
        It can split into pages, but im not sure how good it is with one big table.

        M Offline
        M Offline
        Mark81
        wrote on last edited by
        #3

        @mrjj I'll give it a try. Also found this, that is quite promising.

        1 Reply Last reply
        1

        • Login

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