Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Solved How to save website as image using Qt.

    General and Desktop
    2
    7
    1625
    Loading More Posts
    • 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
      Shidharth last edited by

      Hi All,

      How to save webpage to image using qt.

      Regards,
      Siddharth.

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        A webpage is hard to save as an image as such.

        But you could use
        http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html
        To take a picture of it.

        So you could open page in browser and take picture.

        Else you need to use webkit and print to pdf. for something like a picture.

        1 Reply Last reply Reply Quote 1
        • S
          Shidharth last edited by

          Hi

          thanks for ur reply..
          using above technique can I get a full webpage?

          thanks
          Siddu..

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @Shidharth last edited by

            @Shidharth

            well only if full page is shown on screen.

            Else you can use
            http://doc.qt.io/qt-5/qwebview.html#details
            and see if u can make it render to a pdf.

            Why you need web pages as an images ?

            S 1 Reply Last reply Reply Quote 1
            • S
              Shidharth @mrjj last edited by Shidharth

              @mrjj

              Thank for your quick reply.
              I have create small project to export to image(like export to pdf).

              Thanks,
              Siddu

              mrjj 1 Reply Last reply Reply Quote 1
              • mrjj
                mrjj Lifetime Qt Champion @Shidharth last edited by

                @Shidharth
                Ok, then Qwebview and QPrinter
                QPrinter printer(QPrinter::HighResolution);
                printer.setOutputFormat(QPrinter::PdfFormat);
                Might work.

                S 1 Reply Last reply Reply Quote 0
                • S
                  Shidharth @mrjj last edited by

                  @mrjj

                  Thank U so much!!!

                  Regards,
                  Siddu..

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post