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. [SOLVED] How to make a division between pages in a PDF?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] How to make a division between pages in a PDF?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.2k 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.
  • shavS Offline
    shavS Offline
    shav
    wrote on last edited by
    #1

    Hi everyone!

    In my application I need to create PDF report. To do this I'm using QWebView and QPainter. This two classes work perfect. I'm creating HTML content and then render it using QWebView. When this content will rendered in QWebView I've printing it to QPainter instance. This generated PDF file with multiple pages. But I need to create document with few sections. Every new section must starts with new page. How I can do this with HTML + QWebView + QPainter? Or I can use something else to generate PDF file.

    Thanks for the help!

    Mac OS and iOS Developer

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Web technology isn't really suitable for rendering on a paginated canvas. It is really aimed at rendering on a single big page.

      We looked into using HTML for creating reports in our application, and decided against it for mainly this reason. When generating a print, you can normally use QPrinter::newPage(), but I did not find a sane way to do that inside HTML based reports.

      1 Reply Last reply
      0
      • shavS Offline
        shavS Offline
        shav
        wrote on last edited by
        #3

        Thank for the reply!

        I will search more solutions for this problem. If I will find solution I will post it here.

        Mac OS and iOS Developer

        1 Reply Last reply
        0
        • shavS Offline
          shavS Offline
          shav
          wrote on last edited by
          #4

          Hi everyone!

          At last I've solved my problem with PDF. I'm using JavaScript to calculate top margin for every section which must start from new page.

          Mac OS and iOS Developer

          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