Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Need to Print Text with Larger Font Size...!
Forum Updated to NodeBB v4.3 + New Features

Need to Print Text with Larger Font Size...!

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 2.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.
  • R Offline
    R Offline
    Rohith
    wrote on last edited by
    #1

    HI,
    In my embedded device i need to print the "Text on Paper" with a bigger font size, how can i increase the size of using Qt Application so that i can pass the string to our printer API in order to print font with bigger size on paper.

    Please guide me,

    Thanks in advance,
    Rohith.G

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

      Hi
      Just adjust the Font in the painter you use for printing?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Rohith
        wrote on last edited by
        #3

        Hi Mrjj,

        Thanks for replying, sorry to say this i didn't get what you have said.!

        Thanks in advance,
        Rohith.G

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

          Hi
          http://doc.qt.io/qt-5/printing.html

             QPrinter printer;
              printer.setOutputFormat(QPrinter::PdfFormat); 
              printer.setOutputFileName("/my.pdf");
              QPainter painter;
              QFont font=painter.font() ;
              font.setPointSize ( 64 ); /// BIIG
              painter.setFont(font);
              painter.drawText(10, 10, "Test 2");
              painter.end();
          
          1 Reply Last reply
          0
          • R Offline
            R Offline
            Rohith
            wrote on last edited by
            #5

            Hi Mrjj,

            How can print the Bigger size on "paper", the code posted by you will print in the PDF File.
            How can i get the data into String so that i can print..!

            Thanks in advance,
            Rohith.G

            jsulmJ 2 Replies Last reply
            0
            • R Rohith

              Hi Mrjj,

              How can print the Bigger size on "paper", the code posted by you will print in the PDF File.
              How can i get the data into String so that i can print..!

              Thanks in advance,
              Rohith.G

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Rohith There is no difference. Just use a real printer instead of PDF. See http://doc.qt.io/qt-5/qprinter.html#setPrinterName
              How do you actually print now?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • R Rohith

                Hi Mrjj,

                How can print the Bigger size on "paper", the code posted by you will print in the PDF File.
                How can i get the data into String so that i can print..!

                Thanks in advance,
                Rohith.G

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Rohith said in Need to Print Text with Larger Font Size...!:

                How can i get the data into String so that i can print..!

                What data is it? From where do you get it?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                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