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. Printing PDF with Headers & Footers
Forum Updated to NodeBB v4.3 + New Features

Printing PDF with Headers & Footers

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

    Hi everybody,

    I'm using a QTextDocument to print a PDF file via QPdfWriter. I wanted to know if there is a way to attach headers and footers to pages when printing the PDF?

    Thanks.

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

      Hi,

      AFAIK, you should do it as part of your document generation before sending to the printer.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • VinorcolaV Offline
        VinorcolaV Offline
        Vinorcola
        wrote on last edited by
        #3

        Hi,

        Thanks. But I haven't find any method in QTextDocument to do that. Do you have to put custom blocks into the document for each page? And if so, how do you make sure the footer stick to the bottom of the page?

        Thanks for your help.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You can find an example of this in the "Advanced Qt Programming: Creating Great Software with C++ and Qt 4" book code samples.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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