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. Disable page count in QTextDocument
Forum Updated to NodeBB v4.3 + New Features

Disable page count in QTextDocument

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.3k 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.
  • F Offline
    F Offline
    filipeval
    wrote on last edited by
    #1

    Hello,

    When i print the content of a QTextDocument i get a "1" printed in the bottom of the PDF.

    How can i disable the page count at the bottom of the document?

    Regards
    Filipe V.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      The documentation says "If the document is already paginated through a specified height in the pageSize() property it is printed as-is.":http://qt-project.org/doc/qt-5/qtextdocument.html#print
      And if it is not paginated then "the current page number is printed at the bottom of each page."

      I think you need to call
      @void QTextDocument::setPageSize(const QSizeF & size)@

      before calling
      @void QTextDocument::print(QPagedPaintDevice * printer) const@

      1 Reply Last reply
      0
      • F Offline
        F Offline
        filipeval
        wrote on last edited by
        #3

        Hello andreyc,

        setPageSize does not disable pageCount, i solved this by changing the source code of the QTextDocument to remove the pageCount.

        Just comment @if (!pageNumberPos.isNull()) {@ in the qtextdocument.cpp file.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          Hi filipeval,

          Thank you for sharing your solution.

          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