Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to Print a Scrollable Application Window as a Full PDF in Qt
Forum Updated to NodeBB v4.3 + New Features

How to Print a Scrollable Application Window as a Full PDF in Qt

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 92 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.
  • D Offline
    D Offline
    Deep Patle
    wrote on last edited by Deep Patle
    #1

    I am working on a QML-based Qt application where I need to export the entire application window as a PDF. The window contains a scrollable area with dynamic content, but I’m facing challenges capturing all the content.

    Previously, I attempted to use grabWindow(), but it only captures the visible portion of the window and not the entire scrollable content.

    Here’s an overview of my implementation:

    1. The main application is written in QML and has a ScrollView for displaying large content.

    2. I am using a combination of QQuickWindow and C++ for generating the PDF using QPrinter and QPainter.

    Could someone guide me on how to:

    1. Capture the entire QML window, including all the content in the ScrollView, even the off-screen portions.

    2. Save the captured content as a PDF.

    Any code examples, suggestions, or references to similar use cases would be highly appreciated.

    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