Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Combining Two PDF Files

Combining Two PDF Files

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 2.0k 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.
  • M Offline
    M Offline
    ManiRon
    wrote on 21 Aug 2018, 04:00 last edited by
    #1

    Is there any way to combine two PDF file generated using QT?

    J 1 Reply Last reply 21 Aug 2018, 04:33
    0
    • M ManiRon
      21 Aug 2018, 04:00

      Is there any way to combine two PDF file generated using QT?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 21 Aug 2018, 04:33 last edited by
      #2

      @ManiRon How did you generate them?

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

      1 Reply Last reply
      0
      • M Offline
        M Offline
        ManiRon
        wrote on 21 Aug 2018, 04:35 last edited by
        #3

        using Qprinter

        J 1 Reply Last reply 21 Aug 2018, 10:24
        0
        • M ManiRon
          21 Aug 2018, 04:35

          using Qprinter

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 21 Aug 2018, 10:24 last edited by
          #4

          @ManiRon I don't think Qt provides anything for this.
          But can't you generate one PDF instead of generating two and then merging?

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

          1 Reply Last reply
          0
          • M Offline
            M Offline
            ManiRon
            wrote on 21 Aug 2018, 10:27 last edited by
            #5

            sorry. Ya but i am trying to add a header to the PDF using the HTML and then i want to print the text is there any way i can do this

            1 Reply Last reply
            0
            • M Offline
              M Offline
              ManiRon
              wrote on 21 Aug 2018, 10:28 last edited by
              #6

              My HTML Code :

              <!DOCTYPE html>
              <html>
              <head>
              <style>
              .logo {
              width: 150px;
              height: 120px;

              }

              .logoHeader {
              height: 120px;
              vertical-align: middle;
              text-align: center;
              }

              .floatLeft { float: left; }

              .floatRight { float: right; }
              </style>
              </head>
              <body>

              <header>
              <img class="logo floatLeft" src="Logo.png" alt="Logo" />

              <img class="logo floatRight"  src="Data.gif" alt="Logo" />
              
              <h1 class="logoHeader">REPORT</h1>
              

              </header>

              </body>
              </html>

              1 Reply Last reply
              0
              • M Offline
                M Offline
                ManiRon
                wrote on 21 Aug 2018, 10:32 last edited by
                #7

                This is my QT Code :
                QFile styleFile( "widget.qss" );
                styleFile.open( QFile::ReadOnly );
                QString hex = QString::fromLatin1( styleFile.readAll() );
                styleFile.close();
                QTextDocument document;
                QTextDocument document1;
                QString data = ui->teData->toPlainText();
                document.setHtml(hex.append(data));
                QPrinter printer;
                printer.setOutputFormat(QPrinter::PdfFormat);
                printer.setPaperSize(QPrinter::A4);
                printer.setOutputFileName("test.pdf");
                QPainter painter;
                painter.begin(&printer);
                painter.setBrush(Qt::transparent);
                painter.end();

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SebastienD
                  wrote on 25 Jan 2021, 14:40 last edited by
                  #8

                  Hi,
                  To add header and footer I use the C library of https://wkhtmltopdf.org/

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    addisonfreya
                    wrote on 15 May 2024, 11:25 last edited by
                    #9
                    This post is deleted!
                    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