Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. How to save a whole page rendered in a QtWebView as an image?

How to save a whole page rendered in a QtWebView as an image?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
qtwebengineviewrender to image
3 Posts 2 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.
  • H Offline
    H Offline
    hckr
    wrote on 20 Jul 2018, 22:46 last edited by
    #1

    I need to save a page loaded in a QtWebView as an image (preferably jpg or png).
    I am interested in the whole contents of a page, not just the part which is currently visible and has to be scrolled to – from top to bottom (I assume I would have to set a width).
    It would be great if the method would not require to show the QtWebView widget on screen.

    L 1 Reply Last reply 22 Jul 2018, 20:02
    0
    • H hckr
      20 Jul 2018, 22:46

      I need to save a page loaded in a QtWebView as an image (preferably jpg or png).
      I am interested in the whole contents of a page, not just the part which is currently visible and has to be scrolled to – from top to bottom (I assume I would have to set a width).
      It would be great if the method would not require to show the QtWebView widget on screen.

      L Offline
      L Offline
      Lingfa
      wrote on 22 Jul 2018, 20:02 last edited by
      #2

      @hckr You can save a whole page to PDF, but not jpg nor png.

      m_view->page()->printToPdf(filePath);
      
      1 Reply Last reply
      1
      • H Offline
        H Offline
        hckr
        wrote on 23 Jul 2018, 21:52 last edited by
        #3

        Yes, I've seen it before. But the thing is, I'd like to 1) crop a fragment of it later, 2) save it as an image.

        1 Reply Last reply
        0

        3/3

        23 Jul 2018, 21:52

        • Login

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