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

Printing PDF with Headers & Footers

Scheduled Pinned Locked Moved General and Desktop
pdfprintingqtextdocument
4 Posts 2 Posters 3.0k Views
  • 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.
  • V Offline
    V Offline
    Vinorcola
    wrote on 3 Sept 2015, 16:03 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Sept 2015, 20:27 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
      • V Offline
        V Offline
        Vinorcola
        wrote on 8 Sept 2015, 08:00 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
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 8 Sept 2015, 20:33 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

          1/4

          3 Sept 2015, 16:03

          • Login

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