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. Print checkbox box into file pdf
Forum Update on Monday, May 27th 2025

Print checkbox box into file pdf

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.1k 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.
  • S Offline
    S Offline
    Safer
    wrote on last edited by
    #1

    Hi everyone,
    I would need some advice: how can I print a checkbox item (to understand a checked or unchecked box) in a pdf file?
    I state that I create the pdf file with Qprinter.
    I tried to create a checkbox with html tags and through QTextDocument and then setHtml only prints the label part of the checkbox and not the box.
    How can I do it?

    JonBJ 1 Reply Last reply
    0
    • S Safer

      Hi everyone,
      I would need some advice: how can I print a checkbox item (to understand a checked or unchecked box) in a pdf file?
      I state that I create the pdf file with Qprinter.
      I tried to create a checkbox with html tags and through QTextDocument and then setHtml only prints the label part of the checkbox and not the box.
      How can I do it?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Safer
      Have a read of https://stackoverflow.com/questions/37074966/printing-a-checked-checkbox-tick-box-with-html-and-css.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Safer
        wrote on last edited by
        #3

        Thanks JonB, but nothing .. unfortunately it doesn't work and I don't print the box ...

        JonBJ 1 Reply Last reply
        0
        • S Safer

          Thanks JonB, but nothing .. unfortunately it doesn't work and I don't print the box ...

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Safer
          If you say so, I thought the Accepted Solution there looked like it might work.

          If not then it's obviously not easy/possible to get a checkbox. Can only suggest you might have to make do with, say, an X for a checked box.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Safer
            wrote on last edited by
            #5

            the important thing is that the checked or unchecked box is displayed in the pdf file statically, that is, I am only interested in printing it .. then for check management I will do it with the software code before printing

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

              Hi
              You can render a QCheckBox to QPrinter.
              https://doc.qt.io/qt-5/qwidget.html#render
              Not sure if you mean a real checkbox or some HTML something.

              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