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. Convert HTML to PDF

Convert HTML to PDF

Scheduled Pinned Locked Moved Unsolved General and Desktop
48 Posts 9 Posters 9.2k 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
    Marcus Barnet
    wrote on 9 Jun 2021, 14:25 last edited by
    #21

    thank you, I did as you suggested and now I get no errors when I try to call QWebPage.

    Later, this evening, I will try to use it for the PDF and I will update you.

    1 Reply Last reply
    2
    • M Offline
      M Offline
      Marcus Barnet
      wrote on 9 Jun 2021, 21:50 last edited by Marcus Barnet 6 Sept 2021, 23:15
      #22

      I tried to convert the html to pdf, it works fine even if this process doesn't include a PNG image which is included in the HTML page.

      Unfortunately, this image is very important since it is a logo which must be included also in the PDF file. (I use the <img> tag to insert the image)
      Is there any specific reason for not including the image?

      Moreover, I noticed that the table borders are displayed in grey color while they should be black.
      This is the code I'm using:

        ```
             QWebPage page;
             page.mainFrame()->setHtml(html_scheda);
      
             QPrinter printer(QPrinter::HighResolution);
             printer.setOrientation(QPrinter::Portrait);
             printer.setOutputFormat(QPrinter::PdfFormat);
             printer.setPaperSize(QPrinter::A4);
             printer.setPageMargins(QMarginsF(5, 5, 5, 5));
             QString fileName = "C:/folder/test.pdf";
             printer.setOutputFileName(fileName);
      
             page.mainFrame()->print(&printer);
      
      A 1 Reply Last reply 10 Jun 2021, 08:28
      0
      • M Marcus Barnet
        9 Jun 2021, 21:50

        I tried to convert the html to pdf, it works fine even if this process doesn't include a PNG image which is included in the HTML page.

        Unfortunately, this image is very important since it is a logo which must be included also in the PDF file. (I use the <img> tag to insert the image)
        Is there any specific reason for not including the image?

        Moreover, I noticed that the table borders are displayed in grey color while they should be black.
        This is the code I'm using:

          ```
               QWebPage page;
               page.mainFrame()->setHtml(html_scheda);
        
               QPrinter printer(QPrinter::HighResolution);
               printer.setOrientation(QPrinter::Portrait);
               printer.setOutputFormat(QPrinter::PdfFormat);
               printer.setPaperSize(QPrinter::A4);
               printer.setPageMargins(QMarginsF(5, 5, 5, 5));
               QString fileName = "C:/folder/test.pdf";
               printer.setOutputFileName(fileName);
        
               page.mainFrame()->print(&printer);
        
        A Offline
        A Offline
        artwaw
        wrote on 10 Jun 2021, 08:28 last edited by
        #23

        @Marcus-Barnet from documentation: External objects referenced in the content are located relative to baseUrl. I'd search in that direction.

        For more information please re-read.

        Kind Regards,
        Artur

        M 1 Reply Last reply 11 Jun 2021, 21:08
        0
        • A artwaw
          10 Jun 2021, 08:28

          @Marcus-Barnet from documentation: External objects referenced in the content are located relative to baseUrl. I'd search in that direction.

          M Offline
          M Offline
          Marcus Barnet
          wrote on 11 Jun 2021, 21:08 last edited by
          #24

          @artwaw said in Convert HTML to PDF:

          @Marcus-Barnet from documentation: External objects referenced in the content are located relative to baseUrl. I'd search in that direction.

          The problem is that the logo is loaded from the network, so I do not know what kind of base_url I should specify.

          This is the HTML where I load the picture:

          html_scheda = "<table align=\"center\" border=\"0\" style=\"border-collapse: collapse; width: 21cm; height: 29 cm;\"> <tbody> <tr> <td style=\"width: 100%;\"> <table border=\"0\" style=\"height: 146px; width: 100%; border-collapse: collapse; margin-left: auto; margin-right: auto;\"> <tbody> <tr style=\"height: 0px;\"> <td style=\"width: 50%; height: 146px; text-align: center;\" rowspan=\"4\"><img width=\"200\" align=\"center\" src=\"http://www.robo-dyne.com/pics/pump_logo.png\" alt=\"\" /></td>
          

          What should I use as baseurl in this situation?

          A 2 Replies Last reply 12 Jun 2021, 12:28
          0
          • A Offline
            A Offline
            AlexMaly
            wrote on 11 Jun 2021, 22:23 last edited by
            #25

            We had the same problem and while webkit is viable option it does not support everything we needed.
            We tried a few options, but the best result was produced with using chrome:
            It can do it in headless mode
            google-chrome --headless --disable-gpu --print-to-pdf=file1.pdf http://www.example.com/

            So if you could make sure chrome is installed on your system, this would be an approach I recommend.

            M 1 Reply Last reply 13 Jun 2021, 18:11
            0
            • M Offline
              M Offline
              Marcus Barnet
              wrote on 12 Jun 2021, 06:40 last edited by
              #26

              Does this work also on Windows?

              Even if I would prefer to use QT functionalities to export the PDF.

              J 1 Reply Last reply 12 Jun 2021, 07:55
              0
              • M Marcus Barnet
                12 Jun 2021, 06:40

                Does this work also on Windows?

                Even if I would prefer to use QT functionalities to export the PDF.

                J Offline
                J Offline
                JonB
                wrote on 12 Jun 2021, 07:55 last edited by JonB 6 Dec 2021, 07:56
                #27

                @Marcus-Barnet
                I will throw this in. I do not know if it is right/will help, but....

                I previously suggested you use the supported/supplied Qt WebEngine, not Qt WebKit. But for whatever reason you have gone down the WebKit route :) I do not compile anything Qt (Linux). For Windows I do not know whether you have to compile or whether you download already-built. I gather WebEngine requires MSVC, not MinGW, but that seems to be what you are using anyway.

                Web Engine uses the chromium engine. From @AlexMaly's post, I'm thinking/hoping this would do the necessary "chrome" facility for you, and access external URLs without problem?

                You would have to check. I leave you with this possibility....

                M 1 Reply Last reply 12 Jun 2021, 11:05
                0
                • J JonB
                  12 Jun 2021, 07:55

                  @Marcus-Barnet
                  I will throw this in. I do not know if it is right/will help, but....

                  I previously suggested you use the supported/supplied Qt WebEngine, not Qt WebKit. But for whatever reason you have gone down the WebKit route :) I do not compile anything Qt (Linux). For Windows I do not know whether you have to compile or whether you download already-built. I gather WebEngine requires MSVC, not MinGW, but that seems to be what you are using anyway.

                  Web Engine uses the chromium engine. From @AlexMaly's post, I'm thinking/hoping this would do the necessary "chrome" facility for you, and access external URLs without problem?

                  You would have to check. I leave you with this possibility....

                  M Offline
                  M Offline
                  Marcus Barnet
                  wrote on 12 Jun 2021, 11:05 last edited by
                  #28

                  @JonB said in Convert HTML to PDF:

                  @Marcus-Barnet
                  I will throw this in. I do not know if it is right/will help, but....

                  I previously suggested you use the supported/supplied Qt WebEngine, not Qt WebKit. But for whatever reason you have gone down the WebKit route :) I do not compile anything Qt (Linux). For Windows I do not know whether you have to compile or whether you download already-built. I gather WebEngine requires MSVC, not MinGW, but that seems to be what you are using anyway.

                  Web Engine uses the chromium engine. From @AlexMaly's post, I'm thinking/hoping this would do the necessary "chrome" facility for you, and access external URLs without problem?

                  You would have to check. I leave you with this possibility....

                  I didn't use WebEngine because I thought that WebKit was easier! But it is not working as expected, so I'll give it a try! :)
                  I think I should use this one: https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-html2pdf-example.html as an example and make it fit my needs, is it correct?

                  Thank you!

                  J 1 Reply Last reply 12 Jun 2021, 11:11
                  0
                  • M Marcus Barnet
                    12 Jun 2021, 11:05

                    @JonB said in Convert HTML to PDF:

                    @Marcus-Barnet
                    I will throw this in. I do not know if it is right/will help, but....

                    I previously suggested you use the supported/supplied Qt WebEngine, not Qt WebKit. But for whatever reason you have gone down the WebKit route :) I do not compile anything Qt (Linux). For Windows I do not know whether you have to compile or whether you download already-built. I gather WebEngine requires MSVC, not MinGW, but that seems to be what you are using anyway.

                    Web Engine uses the chromium engine. From @AlexMaly's post, I'm thinking/hoping this would do the necessary "chrome" facility for you, and access external URLs without problem?

                    You would have to check. I leave you with this possibility....

                    I didn't use WebEngine because I thought that WebKit was easier! But it is not working as expected, so I'll give it a try! :)
                    I think I should use this one: https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-html2pdf-example.html as an example and make it fit my needs, is it correct?

                    Thank you!

                    J Offline
                    J Offline
                    JonB
                    wrote on 12 Jun 2021, 11:11 last edited by
                    #29

                    @Marcus-Barnet said in Convert HTML to PDF:

                    I think I should use this one: https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-html2pdf-example.html as an example and make it fit my needs, is it correct?

                    Indeed. I didn't know that example existed. Looks like what you are wanting to do, so seems a good starting point!

                    1 Reply Last reply
                    0
                    • M Marcus Barnet
                      11 Jun 2021, 21:08

                      @artwaw said in Convert HTML to PDF:

                      @Marcus-Barnet from documentation: External objects referenced in the content are located relative to baseUrl. I'd search in that direction.

                      The problem is that the logo is loaded from the network, so I do not know what kind of base_url I should specify.

                      This is the HTML where I load the picture:

                      html_scheda = "<table align=\"center\" border=\"0\" style=\"border-collapse: collapse; width: 21cm; height: 29 cm;\"> <tbody> <tr> <td style=\"width: 100%;\"> <table border=\"0\" style=\"height: 146px; width: 100%; border-collapse: collapse; margin-left: auto; margin-right: auto;\"> <tbody> <tr style=\"height: 0px;\"> <td style=\"width: 50%; height: 146px; text-align: center;\" rowspan=\"4\"><img width=\"200\" align=\"center\" src=\"http://www.robo-dyne.com/pics/pump_logo.png\" alt=\"\" /></td>
                      

                      What should I use as baseurl in this situation?

                      A Offline
                      A Offline
                      artwaw
                      wrote on 12 Jun 2021, 12:28 last edited by
                      #30

                      @Marcus-Barnet I will try to build basic webkit browser and check that for you later today. You got me curious. To all my knowledge and experience this should work just fine.

                      For more information please re-read.

                      Kind Regards,
                      Artur

                      1 Reply Last reply
                      0
                      • M Marcus Barnet
                        11 Jun 2021, 21:08

                        @artwaw said in Convert HTML to PDF:

                        @Marcus-Barnet from documentation: External objects referenced in the content are located relative to baseUrl. I'd search in that direction.

                        The problem is that the logo is loaded from the network, so I do not know what kind of base_url I should specify.

                        This is the HTML where I load the picture:

                        html_scheda = "<table align=\"center\" border=\"0\" style=\"border-collapse: collapse; width: 21cm; height: 29 cm;\"> <tbody> <tr> <td style=\"width: 100%;\"> <table border=\"0\" style=\"height: 146px; width: 100%; border-collapse: collapse; margin-left: auto; margin-right: auto;\"> <tbody> <tr style=\"height: 0px;\"> <td style=\"width: 50%; height: 146px; text-align: center;\" rowspan=\"4\"><img width=\"200\" align=\"center\" src=\"http://www.robo-dyne.com/pics/pump_logo.png\" alt=\"\" /></td>
                        

                        What should I use as baseurl in this situation?

                        A Offline
                        A Offline
                        artwaw
                        wrote on 12 Jun 2021, 12:55 last edited by artwaw 6 Dec 2021, 13:11
                        #31

                        @Marcus-Barnet Hi,
                        I got some spare time right now and this is the result:
                        07303d40-b166-4486-b49c-fb02ccc1fe67-image.png

                        Code:

                        #ifndef MAINWINDOW_H
                        #define MAINWINDOW_H
                        
                        #include <QMainWindow>
                        #include <QtWebKit>
                        #include <QtWebKitWidgets>
                        #include <QtPrintSupport>
                        
                        QT_BEGIN_NAMESPACE
                        namespace Ui { class MainWindow; }
                        QT_END_NAMESPACE
                        
                        class MainWindow : public QMainWindow
                        {
                            Q_OBJECT
                        
                        public:
                            MainWindow(QWidget *parent = nullptr);
                            ~MainWindow();
                        
                        private:
                            Ui::MainWindow *ui;
                            QWebPage *page;
                        };
                        #endif // MAINWINDOW_H
                        
                        #include "mainwindow.h"
                        #include "ui_mainwindow.h"
                        
                        MainWindow::MainWindow(QWidget *parent)
                            : QMainWindow(parent)
                            , ui(new Ui::MainWindow)
                        {
                            ui->setupUi(this);
                            page = new QWebPage(this);
                            page->mainFrame()->setHtml("<table align=\"center\" border=\"0\" style=\"border-collapse: collapse; width: 21cm; height: 29 cm;\"> <tbody> <tr> <td style=\"width: 100%;\"> <table border=\"0\" style=\"height: 146px; width: 100%; border-collapse: collapse; margin-left: auto; margin-right: auto;\"> <tbody> <tr style=\"height: 0px;\"> <td style=\"width: 50%; height: 146px; text-align: center;\" rowspan=\"4\"><img width=\"200\" align=\"center\" src=\"http://www.robo-dyne.com/pics/pump_logo.png\" alt=\"\" /></td>");
                            ui->view->setPage(page);
                            QPrinter *printer = new QPrinter(QPrinter::HighResolution);
                            printer->setPageSize(QPrinter::A4);
                            printer->setOutputFormat(QPrinter::PdfFormat);
                            printer->setOutputFileName(QFileDialog::getSaveFileName(this,"Save location",QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
                            page->mainFrame()->print(printer);
                            delete printer;
                        }
                        
                        MainWindow::~MainWindow()
                        {
                            delete ui;
                        }
                        
                        QT       += core gui webkit webkitwidgets printsupport
                        
                        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                        
                        CONFIG += c++11
                        CONFIG +=s dk_no_version_check
                        
                        # You can make your code fail to compile if it uses deprecated APIs.
                        # In order to do so, uncomment the following line.
                        #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                        
                        SOURCES += \
                            main.cpp \
                            mainwindow.cpp
                        
                        HEADERS += \
                            mainwindow.h
                        
                        FORMS += \
                            mainwindow.ui
                        

                        Resulting pdf file is here: https://trollnet.com.pl/dwn/webkitTest.pdf

                        I'd say it works?

                        EDIT:
                        UI has one QWidget in the grid layout promoted to QWebView (named, surprisingly, view).
                        I did additional tests where I removed the displayed part (which was added only to test the page anyway) and resulting pdf file is exactly the same, so we can exclude presence of QWebView form having any impact. QWebPage rendering and printout works perfectly fine with the sample you provided.

                        For more information please re-read.

                        Kind Regards,
                        Artur

                        M 1 Reply Last reply 13 Jun 2021, 17:09
                        1
                        • A artwaw
                          12 Jun 2021, 12:55

                          @Marcus-Barnet Hi,
                          I got some spare time right now and this is the result:
                          07303d40-b166-4486-b49c-fb02ccc1fe67-image.png

                          Code:

                          #ifndef MAINWINDOW_H
                          #define MAINWINDOW_H
                          
                          #include <QMainWindow>
                          #include <QtWebKit>
                          #include <QtWebKitWidgets>
                          #include <QtPrintSupport>
                          
                          QT_BEGIN_NAMESPACE
                          namespace Ui { class MainWindow; }
                          QT_END_NAMESPACE
                          
                          class MainWindow : public QMainWindow
                          {
                              Q_OBJECT
                          
                          public:
                              MainWindow(QWidget *parent = nullptr);
                              ~MainWindow();
                          
                          private:
                              Ui::MainWindow *ui;
                              QWebPage *page;
                          };
                          #endif // MAINWINDOW_H
                          
                          #include "mainwindow.h"
                          #include "ui_mainwindow.h"
                          
                          MainWindow::MainWindow(QWidget *parent)
                              : QMainWindow(parent)
                              , ui(new Ui::MainWindow)
                          {
                              ui->setupUi(this);
                              page = new QWebPage(this);
                              page->mainFrame()->setHtml("<table align=\"center\" border=\"0\" style=\"border-collapse: collapse; width: 21cm; height: 29 cm;\"> <tbody> <tr> <td style=\"width: 100%;\"> <table border=\"0\" style=\"height: 146px; width: 100%; border-collapse: collapse; margin-left: auto; margin-right: auto;\"> <tbody> <tr style=\"height: 0px;\"> <td style=\"width: 50%; height: 146px; text-align: center;\" rowspan=\"4\"><img width=\"200\" align=\"center\" src=\"http://www.robo-dyne.com/pics/pump_logo.png\" alt=\"\" /></td>");
                              ui->view->setPage(page);
                              QPrinter *printer = new QPrinter(QPrinter::HighResolution);
                              printer->setPageSize(QPrinter::A4);
                              printer->setOutputFormat(QPrinter::PdfFormat);
                              printer->setOutputFileName(QFileDialog::getSaveFileName(this,"Save location",QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
                              page->mainFrame()->print(printer);
                              delete printer;
                          }
                          
                          MainWindow::~MainWindow()
                          {
                              delete ui;
                          }
                          
                          QT       += core gui webkit webkitwidgets printsupport
                          
                          greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                          
                          CONFIG += c++11
                          CONFIG +=s dk_no_version_check
                          
                          # You can make your code fail to compile if it uses deprecated APIs.
                          # In order to do so, uncomment the following line.
                          #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                          
                          SOURCES += \
                              main.cpp \
                              mainwindow.cpp
                          
                          HEADERS += \
                              mainwindow.h
                          
                          FORMS += \
                              mainwindow.ui
                          

                          Resulting pdf file is here: https://trollnet.com.pl/dwn/webkitTest.pdf

                          I'd say it works?

                          EDIT:
                          UI has one QWidget in the grid layout promoted to QWebView (named, surprisingly, view).
                          I did additional tests where I removed the displayed part (which was added only to test the page anyway) and resulting pdf file is exactly the same, so we can exclude presence of QWebView form having any impact. QWebPage rendering and printout works perfectly fine with the sample you provided.

                          M Offline
                          M Offline
                          Marcus Barnet
                          wrote on 13 Jun 2021, 17:09 last edited by
                          #32

                          @artwaw said in Convert HTML to PDF:

                          @Marcus-Barnet Hi,
                          I got some spare time right now and this is the result:
                          07303d40-b166-4486-b49c-fb02ccc1fe67-image.png

                          Code:

                          #ifndef MAINWINDOW_H
                          #define MAINWINDOW_H
                          
                          #include <QMainWindow>
                          #include <QtWebKit>
                          #include <QtWebKitWidgets>
                          #include <QtPrintSupport>
                          
                          QT_BEGIN_NAMESPACE
                          namespace Ui { class MainWindow; }
                          QT_END_NAMESPACE
                          
                          class MainWindow : public QMainWindow
                          {
                              Q_OBJECT
                          
                          public:
                              MainWindow(QWidget *parent = nullptr);
                              ~MainWindow();
                          
                          private:
                              Ui::MainWindow *ui;
                              QWebPage *page;
                          };
                          #endif // MAINWINDOW_H
                          
                          #include "mainwindow.h"
                          #include "ui_mainwindow.h"
                          
                          MainWindow::MainWindow(QWidget *parent)
                              : QMainWindow(parent)
                              , ui(new Ui::MainWindow)
                          {
                              ui->setupUi(this);
                              page = new QWebPage(this);
                              page->mainFrame()->setHtml("<table align=\"center\" border=\"0\" style=\"border-collapse: collapse; width: 21cm; height: 29 cm;\"> <tbody> <tr> <td style=\"width: 100%;\"> <table border=\"0\" style=\"height: 146px; width: 100%; border-collapse: collapse; margin-left: auto; margin-right: auto;\"> <tbody> <tr style=\"height: 0px;\"> <td style=\"width: 50%; height: 146px; text-align: center;\" rowspan=\"4\"><img width=\"200\" align=\"center\" src=\"http://www.robo-dyne.com/pics/pump_logo.png\" alt=\"\" /></td>");
                              ui->view->setPage(page);
                              QPrinter *printer = new QPrinter(QPrinter::HighResolution);
                              printer->setPageSize(QPrinter::A4);
                              printer->setOutputFormat(QPrinter::PdfFormat);
                              printer->setOutputFileName(QFileDialog::getSaveFileName(this,"Save location",QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
                              page->mainFrame()->print(printer);
                              delete printer;
                          }
                          
                          MainWindow::~MainWindow()
                          {
                              delete ui;
                          }
                          
                          QT       += core gui webkit webkitwidgets printsupport
                          
                          greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                          
                          CONFIG += c++11
                          CONFIG +=s dk_no_version_check
                          
                          # You can make your code fail to compile if it uses deprecated APIs.
                          # In order to do so, uncomment the following line.
                          #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                          
                          SOURCES += \
                              main.cpp \
                              mainwindow.cpp
                          
                          HEADERS += \
                              mainwindow.h
                          
                          FORMS += \
                              mainwindow.ui
                          

                          Resulting pdf file is here: https://trollnet.com.pl/dwn/webkitTest.pdf

                          I'd say it works?

                          EDIT:
                          UI has one QWidget in the grid layout promoted to QWebView (named, surprisingly, view).
                          I did additional tests where I removed the displayed part (which was added only to test the page anyway) and resulting pdf file is exactly the same, so we can exclude presence of QWebView form having any impact. QWebPage rendering and printout works perfectly fine with the sample you provided.

                          I really do not know what to say, but I tried your code and it doesn't work for me!
                          It doesn't display the image in the PDF file.

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            Marcus Barnet
                            wrote on 13 Jun 2021, 17:59 last edited by
                            #33

                            it's strange because everything else works fine, but the images are not displayed.

                            1 Reply Last reply
                            0
                            • A AlexMaly
                              11 Jun 2021, 22:23

                              We had the same problem and while webkit is viable option it does not support everything we needed.
                              We tried a few options, but the best result was produced with using chrome:
                              It can do it in headless mode
                              google-chrome --headless --disable-gpu --print-to-pdf=file1.pdf http://www.example.com/

                              So if you could make sure chrome is installed on your system, this would be an approach I recommend.

                              M Offline
                              M Offline
                              Marcus Barnet
                              wrote on 13 Jun 2021, 18:11 last edited by
                              #34

                              @AlexMaly said in Convert HTML to PDF:

                              We had the same problem and while webkit is viable option it does not support everything we needed.
                              We tried a few options, but the best result was produced with using chrome:
                              It can do it in headless mode
                              google-chrome --headless --disable-gpu --print-to-pdf=file1.pdf http://www.example.com/

                              So if you could make sure chrome is installed on your system, this would be an approach I recommend.

                              This solution works and it is able to generate the PDF by including also the images, but I can't scale the result PDF.
                              I need to fit all the content in a A4 format and to do so I need to scale the print to 93%. It seems that chrome doesn't provide this feature.

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                Marcus Barnet
                                wrote on 13 Jun 2021, 20:42 last edited by
                                #35

                                At the moment, I solved the conversion problem by using wkhtmltopdf.

                                However, I was trying to generated a PDF file to be able to send it by email as an attachment since sometimes the HTML webpages are blocked by the antivirus (I guess) and they cannot be read by the user.
                                I was thinking to solve the problem by sending PDF files instead of HTML, but the attachments keep to be blocked on some smartphones!!

                                A 1 Reply Last reply 14 Jun 2021, 11:53
                                0
                                • M Marcus Barnet
                                  13 Jun 2021, 20:42

                                  At the moment, I solved the conversion problem by using wkhtmltopdf.

                                  However, I was trying to generated a PDF file to be able to send it by email as an attachment since sometimes the HTML webpages are blocked by the antivirus (I guess) and they cannot be read by the user.
                                  I was thinking to solve the problem by sending PDF files instead of HTML, but the attachments keep to be blocked on some smartphones!!

                                  A Offline
                                  A Offline
                                  artwaw
                                  wrote on 14 Jun 2021, 11:53 last edited by
                                  #36

                                  @Marcus-Barnet That, I believe, is a problem with settings of the said smartphone mail client or account and I am not sure if you can do anything to prevent that.
                                  Ugly solution might be to ditch pdf and render a4 size png image and include that as an attachment (but I am totally not sure if that would work with mail filters).

                                  For more information please re-read.

                                  Kind Regards,
                                  Artur

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    Marcus Barnet
                                    wrote on 14 Jun 2021, 14:04 last edited by
                                    #37

                                    But it's strange because if I sent the same PDF file as attachment by using my mail client, then they receive it.

                                    The problem occurs only when I send it by my QT application.

                                    A 1 Reply Last reply 14 Jun 2021, 15:01
                                    0
                                    • M Marcus Barnet
                                      14 Jun 2021, 14:04

                                      But it's strange because if I sent the same PDF file as attachment by using my mail client, then they receive it.

                                      The problem occurs only when I send it by my QT application.

                                      A Offline
                                      A Offline
                                      artwaw
                                      wrote on 14 Jun 2021, 15:01 last edited by
                                      #38

                                      @Marcus-Barnet I'd examine headers set by mail client and by Qt code.

                                      For more information please re-read.

                                      Kind Regards,
                                      Artur

                                      1 Reply Last reply
                                      2
                                      • M Offline
                                        M Offline
                                        Marcus Barnet
                                        wrote on 15 Jun 2021, 20:38 last edited by Marcus Barnet
                                        #39

                                        Following your suggestion, I tried to compare both mail headers, but they look almost similar to me even if the email client seems to convert the mail text to HTML.

                                        This is the header for the email sent by the QT code:

                                        Delivered-To: email@gmail.com
                                        Received: by 2002:a05:6838:e2d1:0:0:0:0 with SMTP id h17csp4107691nke;
                                                Tue, 15 Jun 2021 13:31:50 -0700 (PDT)
                                        X-Received: by 2002:a17:906:60d3:: with SMTP id f19mr1464991ejk.413.1623789110147;
                                                Tue, 15 Jun 2021 13:31:50 -0700 (PDT)
                                        ARC-Seal: i=1; a=rsa-sha256; t=1623789110; cv=none;
                                                d=google.com; s=arc-20160816;
                                                b=I/NjJ997YuEPNSd5GreiyadlkrHD6KyDjm8ZkJnuZCQxGo/gNdi87wj76UVwQ4PxOT
                                                 5PDMII0Zd6ilXoCube5INmsMszMhSOyH/rOMVPtovfGLC1OEOSKUIgfDb8Z2rcKPTNSy
                                                 FU5g0Mq6/aeOttXpsuMovZiD5Pm/pwZ11wyI0jb2a5a6kGz2fcpm5HQ70FiuIF/o4tkC
                                                 Oi6s9GkLspvhmmntX2BJDlSV/bhgB7j8qMgAQUuB6bTRjiDI+zRzj8hnO6PLy1756mf8
                                                 xiDIJtJ5z3yi1CMi++EIypHP0VxEBPnyUnLkmphJKVNrBgw4QtLV+OCwjFvFMRuxoMU9
                                                 409Q==
                                        ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
                                                h=content-transfer-encoding:mime-version:subject:to:from:date
                                                 :message-id:dkim-signature;
                                                bh=0BZEuUGVIISL9vh2ZiCAePOWEZJm2fk4iWTEHYb3Klg=;
                                                b=ujrXD41yE3z9gtDpIc1nAkzU2dKdMpJOSDCYDVJnkfz1NN5IAc8/1u19cqBcmotVr1
                                                 w7RIuCQBqdnkd/g9wYgkDcVWO2/X7RH4O1c+P8ByBdpq0cR2YECFw5ivientFVgk65ju
                                                 rgJjhc76x5PKluvQQGlIvh4s/rIw+EgxOcDRZjEWVh6xeurrjiLu9RhIP+8Jn3o3z8mp
                                                 cRBN2zQ/oH3pKzf3s2XOBz+IVSztqcSIOYpkKC6cQMP553rRWU7bdLm8up30EKCmN6QF
                                                 /V4yuOuV5tWAg6s+kpreFEi9V7MRcp3zS5K2GWTKwO3TL3rBTI9YRAplhru6V631u/JL
                                                 iWvw==
                                        ARC-Authentication-Results: i=1; mx.google.com;
                                               dkim=pass header.i=@gmail.com header.s=20161025 header.b="V/05G+hO";
                                               spf=pass (google.com: domain of email@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=pumpasdmaglie@gmail.com;
                                               dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
                                        Return-Path: <pumpasdmaglie@gmail.com>
                                        Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
                                                by mx.google.com with SMTPS id e22sor17653647edu.23.2021.06.15.13.31.49
                                                for <email@gmail.com>
                                                (Google Transport Security);
                                                Tue, 15 Jun 2021 13:31:50 -0700 (PDT)
                                        Received-SPF: pass (google.com: domain of pumpasdmaglie@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
                                        Authentication-Results: mx.google.com;
                                               dkim=pass header.i=@gmail.com header.s=20161025 header.b="V/05G+hO";
                                               spf=pass (google.com: domain of pumpasdmaglie@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=pumpasdmaglie@gmail.com;
                                               dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
                                        DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                                                d=gmail.com; s=20161025;
                                                h=message-id:date:from:to:subject:mime-version
                                                 :content-transfer-encoding;
                                                bh=0BZEuUGVIISL9vh2ZiCAePOWEZJm2fk4iWTEHYb3Klg=;
                                                b=V/05G+hOVQajWYay+THCyOZe2XcQSCy1Eqw8ePT6dmHGPYurnxR3dO5cmmhEg/+4du
                                                 L4aptWvFiYKaDVZJvsCFgDphUtxxTQFBfFNWadVkzHAErBfesOehucMnz8vdaPkyI1hA
                                                 ekP2h2QuKy5/gRpOfTVqQg5nVtFz0EtY3AlYMY16bYMMgXgURnD5MqsFo5KFBSApG+VD
                                                 kejb3RIw6zyT+ubNJGrxkoxXJ1052qKFtx1o0Hhufh6tUyrhveuIuWyH+C/mvr1mZcKk
                                                 d/Fu1qw4oXqW0wYyRqEsoSt2V7f03ikLnfmSyxDTwBZVIz/AMNwQ68+3lqL5PCbN+rpy
                                                 y9mQ==
                                        X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                                                d=1e100.net; s=20161025;
                                                h=x-gm-message-state:message-id:date:from:to:subject:mime-version
                                                 :content-transfer-encoding;
                                                bh=0BZEuUGVIISL9vh2ZiCAePOWEZJm2fk4iWTEHYb3Klg=;
                                                b=CaoucRugLcRefZOqgUIdai4QXz6pGPXJc17BaqgLs47RwaIIobYisIRzy2jXOZ/y95
                                                 xqr/DLKJqla1FwDKTqT5J4Rn+bAHO97CVWNuNYE1Bl4Np+pXuMLwI/oWWBh805J2q/+e
                                                 8UQj+ixoeZpSydNbeovsN6alYlpNRumNR28yukb6LuGIdFrOL2f8rz9DwjiH3Zq7m5u0
                                                 IuXhn0HZZzbbZSCqamq4Ki/P10w7Z8ttssD/uYdd/TeH44Q5BdN7U4PZtPBEWYvRsgN3
                                                 JtX7oXsp9JpOr7t3DmviSSiVp/+6GQrvyCR/IPv1B5rbbf5/D6QBCDUInE8gx5EIiBGn
                                                 WZDg==
                                        X-Gm-Message-State: AOAM5336ea21u4HeweqqAnDrAKtdifUHCW0lwdshpt7j9cFUDoXJ7Q0n t0/0cqpmokCIawJXCH1HzRGnWx9G7Fk=
                                        X-Google-Smtp-Source: ABdhPJx4U1C4HLk0WphjdL7Fk16b4PcnBlPBDBVfMInuYYRW06oVvuk7/XEem9l8F01eEWwq85Q+0Q==
                                        X-Received: by 2002:aa7:c799:: with SMTP id n25mr22902eds.16.1623789109691;
                                                Tue, 15 Jun 2021 13:31:49 -0700 (PDT)
                                        Return-Path: <pumpasdmaglie@gmail.com>
                                        Received: from localhost (host-87-0-192-249.retail.telecomitalia.it. [87.0.192.249])
                                                by smtp.gmail.com with ESMTPSA id i26sm37044edq.54.2021.06.15.13.31.48
                                                for <roccogalati@gmail.com>
                                                (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
                                                Tue, 15 Jun 2021 13:31:48 -0700 (PDT)
                                        Message-ID: <60c90e34.1c69fb81.70a57.0267@mx.google.com>
                                        Date: Tue, 15 Jun 2021 13:31:48 -0700 (PDT)
                                        X-Google-Original-Date: 15 Jun 2021 22:31:51 +0200
                                        From: Palestra PUMP <email@gmail.com>
                                        To: "Galati Rocco #1000" <email@gmail.com>
                                        Subject: La tua tabella di allenamento!
                                        MIME-Version: 1.0
                                        Content-Type: multipart/related; boundary=9371d7a2e3ae86a00aab4771e39d255d
                                        Content-Transfer-Encoding: 8bit
                                        X-Antivirus: Avast (VPS 210615-4, 15/06/2021), Outbound message
                                        X-Antivirus-Status: Clean
                                        
                                        --9371d7a2e3ae86a00aab4771e39d255d
                                        Content-Type: text/plain; charset=utf-8
                                        Content-Transfer-Encoding: 8bit
                                        
                                        Ciao Rocco,
                                        
                                        in allegato, trovi la tua tabella di allenamento.
                                        
                                        
                                        
                                        A presto, la tua palestra PUMP!
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        In ottemperanza al D.lgs. 196/03 e al Regolamento UE 2016/679 in materia di protezione dei dati personali, le informazioni ivi contenute hanno natura strettamente personale e sono indirizzate esclusivamente al destinatario indicato. Qualora abbia ricevuto questa e-mail per errore, La invito cortesemente ad avvertire immediatamente il mittente e a distruggere il presente messaggio.
                                        
                                        -- 
                                        This email has been checked for viruses by Avast antivirus software.
                                        https://www.avast.com/antivirus
                                        
                                        --9371d7a2e3ae86a00aab4771e39d255d
                                        Content-Type: application/pdf; name="scheda-2021-06-15-22-31-43.pdf"
                                        Content-Transfer-Encoding: base64
                                        Content-disposition: attachment
                                        
                                        
                                        --9371d7a2e3ae86a00aab4771e39d255d--
                                        

                                        and this is the email sent by the mail client:

                                        Delivered-To: email@gmail.com
                                        Received: by 2002:a05:6838:e2d1:0:0:0:0 with SMTP id h17csp4110240nke;
                                                Tue, 15 Jun 2021 13:35:41 -0700 (PDT)
                                        X-Received: by 2002:a05:6402:885:: with SMTP id e5mr21738edy.248.1623789341141;
                                                Tue, 15 Jun 2021 13:35:41 -0700 (PDT)
                                        ARC-Seal: i=1; a=rsa-sha256; t=1623789341; cv=none;
                                                d=google.com; s=arc-20160816;
                                                b=WPDMLTDvj3pUZz8WTQHgDSA0aSHtNqt6HDwt9YSPaaVo52sQcXHqyaCoXA9k/OZ8M3
                                                 HV4JLvW2idM4SJfQIBKpzeWFp5GmYt0fKUFRlBq0w+u2s4Q538NmOkCU50WKXhYOxG3c
                                                 HE6+QbH63kZ/LdTbBd85YRWCMc3YAMa8qcwzDcO9QDmnbsH79LkgrOPzQ40l3NnMarGq
                                                 kDYtp1zUYWADyW3CzwwjwhfHh3YfHH9TrmbA3iI4XZ2g110OstjpAV+CNFLuO7JKHGZy
                                                 U1sjnoKk7LTG9Vw4Uf81Pk40neQ4Gt8JXLK4xCTlU7l6zF+NPzS9LP48rPJwG1Xm+Q8y
                                                 /qyA==
                                        ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
                                                h=to:subject:message-id:date:from:mime-version:dkim-signature;
                                                bh=uqwG0qx8RbPz4mcP+T2OrqWbpBbaghEYmb/ZCpcY2vk=;
                                                b=BIpf2/QIJTZ4Awlg4lgo7M6KV/UcY43OrD0DDfCQ5WKpZ0VZphy3TKwm6nfgyF2jwz
                                                 2uVob2AIUV5vLyY/zbKAgd6PIi70sjpk3C3zwHGeDcV8HHU6LxxitXDJpCWCU/ry2PmN
                                                 YV5OcPfIImOZ2dkY+cvM9Ou2LWTUkEhW0cQMFJxpR1+XhZUvw8Nu+bYbLwZRk5Q23WFx
                                                 L1nd285U3tNoN9JwERZV3pLS0C5Ba6yd2AEryEKZihyAa+IvTnFJmxxsgcBi9yeqzyV2
                                                 vSxJqgXAUR2gYy4mk1iF5EQi1NL8zWDBOj9Dq6G2pkVHe5I+T/X5mb1w3ClpthkErhJd
                                                 DkaA==
                                        ARC-Authentication-Results: i=1; mx.google.com;
                                               dkim=pass header.i=@gmail.com header.s=20161025 header.b=KoNBYb9O;
                                               spf=pass (google.com: domain of email@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=pumpasdmaglie@gmail.com;
                                               dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
                                        Return-Path: <email@gmail.com>
                                        Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
                                                by mx.google.com with SMTPS id k5sor17978824edo.16.2021.06.15.13.35.41
                                                for <email@gmail.com>
                                                (Google Transport Security);
                                                Tue, 15 Jun 2021 13:35:41 -0700 (PDT)
                                        Received-SPF: pass (google.com: domain of email@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
                                        Authentication-Results: mx.google.com;
                                               dkim=pass header.i=@gmail.com header.s=20161025 header.b=KoNBYb9O;
                                               spf=pass (google.com: domain of email@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=email@gmail.com;
                                               dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
                                        DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                                                d=gmail.com; s=20161025;
                                                h=mime-version:from:date:message-id:subject:to;
                                                bh=uqwG0qx8RbPz4mcP+T2OrqWbpBbaghEYmb/ZCpcY2vk=;
                                                b=KoNBYb9OMgICs8aVqPKjMbNT6kIV9Y8ymAzFoTFNdBu7wj/8ZVm00QAgSL6cmxDyuv
                                                 cLyMV525QYdWbnIQ89o2I6ZfjASZhlC2amuNX9KzFOuoZhi9ZnVcx2sTAxxr1D6w3aBi
                                                 K3OHJSRjQeQOtl76wDkok+knBEEXXg16bM/wQbmO61LVtQHzl/XZf0ZD8oStFL/99Hhm
                                                 kM/U6HE+RcyEsdwzH/eyhdLgFOL6fTUMe2sIFTPVz88JVODx6/xUQu14d+VDQTuvWvGI
                                                 IIkIVVcghId48MPD5Vm8I9bITFIDBy6rJxAZwWd/HSciNmzOluXHwV2F9FcLP7DYaJqC
                                                 ICRw==
                                        X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                                                d=1e100.net; s=20161025;
                                                h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
                                                bh=uqwG0qx8RbPz4mcP+T2OrqWbpBbaghEYmb/ZCpcY2vk=;
                                                b=bDt6NmLZQsLItATHtLI8AJY8P7ogosAcdeFuBQHFE8Ih6wgx7LiEFzmitfTk5RPo62
                                                 9kdvvAsNopwOleR891NRxiHIbQRdgb2XW5vUC5adTGQ58wLSufCBjfM76HGBB/QdKYj2
                                                 lVme8trRJQJGNSqHRGh6W/2gnB4EjLXfhCcF67G2tRaSGFHfPVfAWCjkw0hJVS6boKMI
                                                 LUDqIKQOR3oKglJboq5Cyy3q5fqPoRxhZ1KNMRImf/e/nhNCjWvQf73TlN0RPGPazOok
                                                 8PBq0fzPsuuVSXdqYL2ajoTQGbzooCfBt53eUquPQFEsFBYzYutw4JCduNPQk5xaVnNJ
                                                 zYPw==
                                        X-Gm-Message-State: AOAM532ThjqQDukcTP//RzC6elrP/3mb9JMq5ZO1ed8ZxRapAb5rJpEW +6qdTP1A0zPMS5yMNbBG8a+PmCp8HTJ27zWTR97mlMvh4le/Jw==
                                        X-Google-Smtp-Source: ABdhPJy13k4Xks3LltxmtgA/rFwjgGZVjEZxPu5X13JcMAxOpeYX7GMioaiRuxwobLeXrt0e/IPHZW4SSPccf6VNf9E=
                                        X-Received: by 2002:a05:6402:1a25:: with SMTP id be5mr1657285edb.369.1623789340788; Tue, 15 Jun 2021 13:35:40 -0700 (PDT)
                                        MIME-Version: 1.0
                                        From: Palestra PUMP <email@gmail.com>
                                        Date: Tue, 15 Jun 2021 22:35:32 +0200
                                        Message-ID: <CAPs+xw-RQ34QHM3wH6JcNmWLUX67sbgT3VtyjCEsNShJVA9KuQ@mail.gmail.com>
                                        Subject: La tua tabella di allenamento!
                                        To: Rocco Galati <email@gmail.com>
                                        Content-Type: multipart/mixed; boundary="000000000000d931fb05c4d3ead5"
                                        
                                        --000000000000d931fb05c4d3ead5
                                        Content-Type: multipart/alternative; boundary="000000000000d931fa05c4d3ead3"
                                        
                                        --000000000000d931fa05c4d3ead3
                                        Content-Type: text/plain; charset="UTF-8"
                                        
                                        Ciao MARCO,
                                        
                                        in allegato, trovi la tua tabella di allenamento.
                                        
                                        
                                        
                                        A presto, la tua palestra PUMP!
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        In ottemperanza al D.lgs. 196/03 e al Regolamento UE 2016/679 in materia di
                                        protezione dei dati personali, le informazioni ivi contenute hanno natura
                                        strettamente personale e sono indirizzate esclusivamente al destinatario
                                        indicato. Qualora abbia ricevuto questa e-mail per errore, La invito
                                        cortesemente ad avvertire immediatamente il mittente e a distruggere il
                                        presente messaggio.
                                        
                                        <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
                                        Virus-free.
                                        www.avast.com
                                        <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
                                        <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
                                        
                                        --000000000000d931fa05c4d3ead3
                                        Content-Type: text/html; charset="UTF-8"
                                        Content-Transfer-Encoding: quoted-printable
                                        
                                        <div dir=3D"ltr">Ciao MARCO,<br><br>in allegato, trovi la tua tabella di al=
                                        lenamento.<br><br><br><br><br><br>A presto, la t=
                                        ua palestra PUMP!<br><br><br><br><br><br><br><br><br><br><br>In ottemperanz=
                                        a al D.lgs. 196/03 e al Regolamento UE 2016/679 in materia di protezione de=
                                        i dati personali, le informazioni ivi contenute hanno natura strettamente p=
                                        ersonale e sono indirizzate esclusivamente al destinatario indicato. Qualor=
                                        a abbia ricevuto questa e-mail per errore, La invito cortesemente ad avvert=
                                        ire immediatamente il mittente e a distruggere il presente messaggio.<br></=
                                        div><div id=3D"DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
                                        <table style=3D"border-top:1px solid #d3d4de">
                                        =09<tr>
                                                <td style=3D"width:55px;padding-top:13px"><a href=3D"https://www.av=
                                        ast.com/sig-email?utm_medium=3Demail&amp;utm_source=3Dlink&amp;utm_campaign=
                                        =3Dsig-email&amp;utm_content=3Dwebmail" target=3D"_blank"><img src=3D"https=
                                        ://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-n=
                                        o-repeat-v1.gif" alt=3D"" width=3D"46" height=3D"29" style=3D"width: 46px; =
                                        height: 29px;"></a></td>
                                        =09=09<td style=3D"width:470px;padding-top:12px;color:#41424e;font-size:13p=
                                        x;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a h=
                                        ref=3D"https://www.avast.com/sig-email?utm_medium=3Demail&amp;utm_source=3D=
                                        link&amp;utm_campaign=3Dsig-email&amp;utm_content=3Dwebmail" target=3D"_bla=
                                        nk" style=3D"color:#4453ea">www.avast.com</a>
                                        =09=09</td>
                                        =09</tr>
                                        </table><a href=3D"#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width=3D"1" heigh=
                                        t=3D"1"></a></div>
                                        
                                        --000000000000d931fa05c4d3ead3--
                                        --000000000000d931fb05c4d3ead5
                                        Content-Type: application/pdf; name="scheda-2021-06-15-22-31-43.pdf"
                                        Content-Disposition: attachment; filename="scheda-2021-06-15-22-31-43.pdf"
                                        Content-Transfer-Encoding: base64
                                        Content-ID: <f_kpyi8e5m0>
                                        X-Attachment-Id: f_kpyi8e5m0
                                        
                                        
                                        --000000000000d931fb05c4d3ead5--
                                        
                                        A 1 Reply Last reply 15 Jun 2021, 22:11
                                        0
                                        • M Marcus Barnet
                                          15 Jun 2021, 20:38

                                          Following your suggestion, I tried to compare both mail headers, but they look almost similar to me even if the email client seems to convert the mail text to HTML.

                                          This is the header for the email sent by the QT code:

                                          Delivered-To: email@gmail.com
                                          Received: by 2002:a05:6838:e2d1:0:0:0:0 with SMTP id h17csp4107691nke;
                                                  Tue, 15 Jun 2021 13:31:50 -0700 (PDT)
                                          X-Received: by 2002:a17:906:60d3:: with SMTP id f19mr1464991ejk.413.1623789110147;
                                                  Tue, 15 Jun 2021 13:31:50 -0700 (PDT)
                                          ARC-Seal: i=1; a=rsa-sha256; t=1623789110; cv=none;
                                                  d=google.com; s=arc-20160816;
                                                  b=I/NjJ997YuEPNSd5GreiyadlkrHD6KyDjm8ZkJnuZCQxGo/gNdi87wj76UVwQ4PxOT
                                                   5PDMII0Zd6ilXoCube5INmsMszMhSOyH/rOMVPtovfGLC1OEOSKUIgfDb8Z2rcKPTNSy
                                                   FU5g0Mq6/aeOttXpsuMovZiD5Pm/pwZ11wyI0jb2a5a6kGz2fcpm5HQ70FiuIF/o4tkC
                                                   Oi6s9GkLspvhmmntX2BJDlSV/bhgB7j8qMgAQUuB6bTRjiDI+zRzj8hnO6PLy1756mf8
                                                   xiDIJtJ5z3yi1CMi++EIypHP0VxEBPnyUnLkmphJKVNrBgw4QtLV+OCwjFvFMRuxoMU9
                                                   409Q==
                                          ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
                                                  h=content-transfer-encoding:mime-version:subject:to:from:date
                                                   :message-id:dkim-signature;
                                                  bh=0BZEuUGVIISL9vh2ZiCAePOWEZJm2fk4iWTEHYb3Klg=;
                                                  b=ujrXD41yE3z9gtDpIc1nAkzU2dKdMpJOSDCYDVJnkfz1NN5IAc8/1u19cqBcmotVr1
                                                   w7RIuCQBqdnkd/g9wYgkDcVWO2/X7RH4O1c+P8ByBdpq0cR2YECFw5ivientFVgk65ju
                                                   rgJjhc76x5PKluvQQGlIvh4s/rIw+EgxOcDRZjEWVh6xeurrjiLu9RhIP+8Jn3o3z8mp
                                                   cRBN2zQ/oH3pKzf3s2XOBz+IVSztqcSIOYpkKC6cQMP553rRWU7bdLm8up30EKCmN6QF
                                                   /V4yuOuV5tWAg6s+kpreFEi9V7MRcp3zS5K2GWTKwO3TL3rBTI9YRAplhru6V631u/JL
                                                   iWvw==
                                          ARC-Authentication-Results: i=1; mx.google.com;
                                                 dkim=pass header.i=@gmail.com header.s=20161025 header.b="V/05G+hO";
                                                 spf=pass (google.com: domain of email@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=pumpasdmaglie@gmail.com;
                                                 dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
                                          Return-Path: <pumpasdmaglie@gmail.com>
                                          Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
                                                  by mx.google.com with SMTPS id e22sor17653647edu.23.2021.06.15.13.31.49
                                                  for <email@gmail.com>
                                                  (Google Transport Security);
                                                  Tue, 15 Jun 2021 13:31:50 -0700 (PDT)
                                          Received-SPF: pass (google.com: domain of pumpasdmaglie@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
                                          Authentication-Results: mx.google.com;
                                                 dkim=pass header.i=@gmail.com header.s=20161025 header.b="V/05G+hO";
                                                 spf=pass (google.com: domain of pumpasdmaglie@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=pumpasdmaglie@gmail.com;
                                                 dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
                                          DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                                                  d=gmail.com; s=20161025;
                                                  h=message-id:date:from:to:subject:mime-version
                                                   :content-transfer-encoding;
                                                  bh=0BZEuUGVIISL9vh2ZiCAePOWEZJm2fk4iWTEHYb3Klg=;
                                                  b=V/05G+hOVQajWYay+THCyOZe2XcQSCy1Eqw8ePT6dmHGPYurnxR3dO5cmmhEg/+4du
                                                   L4aptWvFiYKaDVZJvsCFgDphUtxxTQFBfFNWadVkzHAErBfesOehucMnz8vdaPkyI1hA
                                                   ekP2h2QuKy5/gRpOfTVqQg5nVtFz0EtY3AlYMY16bYMMgXgURnD5MqsFo5KFBSApG+VD
                                                   kejb3RIw6zyT+ubNJGrxkoxXJ1052qKFtx1o0Hhufh6tUyrhveuIuWyH+C/mvr1mZcKk
                                                   d/Fu1qw4oXqW0wYyRqEsoSt2V7f03ikLnfmSyxDTwBZVIz/AMNwQ68+3lqL5PCbN+rpy
                                                   y9mQ==
                                          X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                                                  d=1e100.net; s=20161025;
                                                  h=x-gm-message-state:message-id:date:from:to:subject:mime-version
                                                   :content-transfer-encoding;
                                                  bh=0BZEuUGVIISL9vh2ZiCAePOWEZJm2fk4iWTEHYb3Klg=;
                                                  b=CaoucRugLcRefZOqgUIdai4QXz6pGPXJc17BaqgLs47RwaIIobYisIRzy2jXOZ/y95
                                                   xqr/DLKJqla1FwDKTqT5J4Rn+bAHO97CVWNuNYE1Bl4Np+pXuMLwI/oWWBh805J2q/+e
                                                   8UQj+ixoeZpSydNbeovsN6alYlpNRumNR28yukb6LuGIdFrOL2f8rz9DwjiH3Zq7m5u0
                                                   IuXhn0HZZzbbZSCqamq4Ki/P10w7Z8ttssD/uYdd/TeH44Q5BdN7U4PZtPBEWYvRsgN3
                                                   JtX7oXsp9JpOr7t3DmviSSiVp/+6GQrvyCR/IPv1B5rbbf5/D6QBCDUInE8gx5EIiBGn
                                                   WZDg==
                                          X-Gm-Message-State: AOAM5336ea21u4HeweqqAnDrAKtdifUHCW0lwdshpt7j9cFUDoXJ7Q0n t0/0cqpmokCIawJXCH1HzRGnWx9G7Fk=
                                          X-Google-Smtp-Source: ABdhPJx4U1C4HLk0WphjdL7Fk16b4PcnBlPBDBVfMInuYYRW06oVvuk7/XEem9l8F01eEWwq85Q+0Q==
                                          X-Received: by 2002:aa7:c799:: with SMTP id n25mr22902eds.16.1623789109691;
                                                  Tue, 15 Jun 2021 13:31:49 -0700 (PDT)
                                          Return-Path: <pumpasdmaglie@gmail.com>
                                          Received: from localhost (host-87-0-192-249.retail.telecomitalia.it. [87.0.192.249])
                                                  by smtp.gmail.com with ESMTPSA id i26sm37044edq.54.2021.06.15.13.31.48
                                                  for <roccogalati@gmail.com>
                                                  (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
                                                  Tue, 15 Jun 2021 13:31:48 -0700 (PDT)
                                          Message-ID: <60c90e34.1c69fb81.70a57.0267@mx.google.com>
                                          Date: Tue, 15 Jun 2021 13:31:48 -0700 (PDT)
                                          X-Google-Original-Date: 15 Jun 2021 22:31:51 +0200
                                          From: Palestra PUMP <email@gmail.com>
                                          To: "Galati Rocco #1000" <email@gmail.com>
                                          Subject: La tua tabella di allenamento!
                                          MIME-Version: 1.0
                                          Content-Type: multipart/related; boundary=9371d7a2e3ae86a00aab4771e39d255d
                                          Content-Transfer-Encoding: 8bit
                                          X-Antivirus: Avast (VPS 210615-4, 15/06/2021), Outbound message
                                          X-Antivirus-Status: Clean
                                          
                                          --9371d7a2e3ae86a00aab4771e39d255d
                                          Content-Type: text/plain; charset=utf-8
                                          Content-Transfer-Encoding: 8bit
                                          
                                          Ciao Rocco,
                                          
                                          in allegato, trovi la tua tabella di allenamento.
                                          
                                          
                                          
                                          A presto, la tua palestra PUMP!
                                          
                                          
                                          
                                          
                                          
                                          
                                          
                                          
                                          
                                          
                                          In ottemperanza al D.lgs. 196/03 e al Regolamento UE 2016/679 in materia di protezione dei dati personali, le informazioni ivi contenute hanno natura strettamente personale e sono indirizzate esclusivamente al destinatario indicato. Qualora abbia ricevuto questa e-mail per errore, La invito cortesemente ad avvertire immediatamente il mittente e a distruggere il presente messaggio.
                                          
                                          -- 
                                          This email has been checked for viruses by Avast antivirus software.
                                          https://www.avast.com/antivirus
                                          
                                          --9371d7a2e3ae86a00aab4771e39d255d
                                          Content-Type: application/pdf; name="scheda-2021-06-15-22-31-43.pdf"
                                          Content-Transfer-Encoding: base64
                                          Content-disposition: attachment
                                          
                                          
                                          --9371d7a2e3ae86a00aab4771e39d255d--
                                          

                                          and this is the email sent by the mail client:

                                          Delivered-To: email@gmail.com
                                          Received: by 2002:a05:6838:e2d1:0:0:0:0 with SMTP id h17csp4110240nke;
                                                  Tue, 15 Jun 2021 13:35:41 -0700 (PDT)
                                          X-Received: by 2002:a05:6402:885:: with SMTP id e5mr21738edy.248.1623789341141;
                                                  Tue, 15 Jun 2021 13:35:41 -0700 (PDT)
                                          ARC-Seal: i=1; a=rsa-sha256; t=1623789341; cv=none;
                                                  d=google.com; s=arc-20160816;
                                                  b=WPDMLTDvj3pUZz8WTQHgDSA0aSHtNqt6HDwt9YSPaaVo52sQcXHqyaCoXA9k/OZ8M3
                                                   HV4JLvW2idM4SJfQIBKpzeWFp5GmYt0fKUFRlBq0w+u2s4Q538NmOkCU50WKXhYOxG3c
                                                   HE6+QbH63kZ/LdTbBd85YRWCMc3YAMa8qcwzDcO9QDmnbsH79LkgrOPzQ40l3NnMarGq
                                                   kDYtp1zUYWADyW3CzwwjwhfHh3YfHH9TrmbA3iI4XZ2g110OstjpAV+CNFLuO7JKHGZy
                                                   U1sjnoKk7LTG9Vw4Uf81Pk40neQ4Gt8JXLK4xCTlU7l6zF+NPzS9LP48rPJwG1Xm+Q8y
                                                   /qyA==
                                          ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
                                                  h=to:subject:message-id:date:from:mime-version:dkim-signature;
                                                  bh=uqwG0qx8RbPz4mcP+T2OrqWbpBbaghEYmb/ZCpcY2vk=;
                                                  b=BIpf2/QIJTZ4Awlg4lgo7M6KV/UcY43OrD0DDfCQ5WKpZ0VZphy3TKwm6nfgyF2jwz
                                                   2uVob2AIUV5vLyY/zbKAgd6PIi70sjpk3C3zwHGeDcV8HHU6LxxitXDJpCWCU/ry2PmN
                                                   YV5OcPfIImOZ2dkY+cvM9Ou2LWTUkEhW0cQMFJxpR1+XhZUvw8Nu+bYbLwZRk5Q23WFx
                                                   L1nd285U3tNoN9JwERZV3pLS0C5Ba6yd2AEryEKZihyAa+IvTnFJmxxsgcBi9yeqzyV2
                                                   vSxJqgXAUR2gYy4mk1iF5EQi1NL8zWDBOj9Dq6G2pkVHe5I+T/X5mb1w3ClpthkErhJd
                                                   DkaA==
                                          ARC-Authentication-Results: i=1; mx.google.com;
                                                 dkim=pass header.i=@gmail.com header.s=20161025 header.b=KoNBYb9O;
                                                 spf=pass (google.com: domain of email@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=pumpasdmaglie@gmail.com;
                                                 dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
                                          Return-Path: <email@gmail.com>
                                          Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
                                                  by mx.google.com with SMTPS id k5sor17978824edo.16.2021.06.15.13.35.41
                                                  for <email@gmail.com>
                                                  (Google Transport Security);
                                                  Tue, 15 Jun 2021 13:35:41 -0700 (PDT)
                                          Received-SPF: pass (google.com: domain of email@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
                                          Authentication-Results: mx.google.com;
                                                 dkim=pass header.i=@gmail.com header.s=20161025 header.b=KoNBYb9O;
                                                 spf=pass (google.com: domain of email@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=email@gmail.com;
                                                 dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
                                          DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                                                  d=gmail.com; s=20161025;
                                                  h=mime-version:from:date:message-id:subject:to;
                                                  bh=uqwG0qx8RbPz4mcP+T2OrqWbpBbaghEYmb/ZCpcY2vk=;
                                                  b=KoNBYb9OMgICs8aVqPKjMbNT6kIV9Y8ymAzFoTFNdBu7wj/8ZVm00QAgSL6cmxDyuv
                                                   cLyMV525QYdWbnIQ89o2I6ZfjASZhlC2amuNX9KzFOuoZhi9ZnVcx2sTAxxr1D6w3aBi
                                                   K3OHJSRjQeQOtl76wDkok+knBEEXXg16bM/wQbmO61LVtQHzl/XZf0ZD8oStFL/99Hhm
                                                   kM/U6HE+RcyEsdwzH/eyhdLgFOL6fTUMe2sIFTPVz88JVODx6/xUQu14d+VDQTuvWvGI
                                                   IIkIVVcghId48MPD5Vm8I9bITFIDBy6rJxAZwWd/HSciNmzOluXHwV2F9FcLP7DYaJqC
                                                   ICRw==
                                          X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                                                  d=1e100.net; s=20161025;
                                                  h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
                                                  bh=uqwG0qx8RbPz4mcP+T2OrqWbpBbaghEYmb/ZCpcY2vk=;
                                                  b=bDt6NmLZQsLItATHtLI8AJY8P7ogosAcdeFuBQHFE8Ih6wgx7LiEFzmitfTk5RPo62
                                                   9kdvvAsNopwOleR891NRxiHIbQRdgb2XW5vUC5adTGQ58wLSufCBjfM76HGBB/QdKYj2
                                                   lVme8trRJQJGNSqHRGh6W/2gnB4EjLXfhCcF67G2tRaSGFHfPVfAWCjkw0hJVS6boKMI
                                                   LUDqIKQOR3oKglJboq5Cyy3q5fqPoRxhZ1KNMRImf/e/nhNCjWvQf73TlN0RPGPazOok
                                                   8PBq0fzPsuuVSXdqYL2ajoTQGbzooCfBt53eUquPQFEsFBYzYutw4JCduNPQk5xaVnNJ
                                                   zYPw==
                                          X-Gm-Message-State: AOAM532ThjqQDukcTP//RzC6elrP/3mb9JMq5ZO1ed8ZxRapAb5rJpEW +6qdTP1A0zPMS5yMNbBG8a+PmCp8HTJ27zWTR97mlMvh4le/Jw==
                                          X-Google-Smtp-Source: ABdhPJy13k4Xks3LltxmtgA/rFwjgGZVjEZxPu5X13JcMAxOpeYX7GMioaiRuxwobLeXrt0e/IPHZW4SSPccf6VNf9E=
                                          X-Received: by 2002:a05:6402:1a25:: with SMTP id be5mr1657285edb.369.1623789340788; Tue, 15 Jun 2021 13:35:40 -0700 (PDT)
                                          MIME-Version: 1.0
                                          From: Palestra PUMP <email@gmail.com>
                                          Date: Tue, 15 Jun 2021 22:35:32 +0200
                                          Message-ID: <CAPs+xw-RQ34QHM3wH6JcNmWLUX67sbgT3VtyjCEsNShJVA9KuQ@mail.gmail.com>
                                          Subject: La tua tabella di allenamento!
                                          To: Rocco Galati <email@gmail.com>
                                          Content-Type: multipart/mixed; boundary="000000000000d931fb05c4d3ead5"
                                          
                                          --000000000000d931fb05c4d3ead5
                                          Content-Type: multipart/alternative; boundary="000000000000d931fa05c4d3ead3"
                                          
                                          --000000000000d931fa05c4d3ead3
                                          Content-Type: text/plain; charset="UTF-8"
                                          
                                          Ciao MARCO,
                                          
                                          in allegato, trovi la tua tabella di allenamento.
                                          
                                          
                                          
                                          A presto, la tua palestra PUMP!
                                          
                                          
                                          
                                          
                                          
                                          
                                          
                                          
                                          
                                          
                                          In ottemperanza al D.lgs. 196/03 e al Regolamento UE 2016/679 in materia di
                                          protezione dei dati personali, le informazioni ivi contenute hanno natura
                                          strettamente personale e sono indirizzate esclusivamente al destinatario
                                          indicato. Qualora abbia ricevuto questa e-mail per errore, La invito
                                          cortesemente ad avvertire immediatamente il mittente e a distruggere il
                                          presente messaggio.
                                          
                                          <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
                                          Virus-free.
                                          www.avast.com
                                          <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
                                          <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
                                          
                                          --000000000000d931fa05c4d3ead3
                                          Content-Type: text/html; charset="UTF-8"
                                          Content-Transfer-Encoding: quoted-printable
                                          
                                          <div dir=3D"ltr">Ciao MARCO,<br><br>in allegato, trovi la tua tabella di al=
                                          lenamento.<br><br><br><br><br><br>A presto, la t=
                                          ua palestra PUMP!<br><br><br><br><br><br><br><br><br><br><br>In ottemperanz=
                                          a al D.lgs. 196/03 e al Regolamento UE 2016/679 in materia di protezione de=
                                          i dati personali, le informazioni ivi contenute hanno natura strettamente p=
                                          ersonale e sono indirizzate esclusivamente al destinatario indicato. Qualor=
                                          a abbia ricevuto questa e-mail per errore, La invito cortesemente ad avvert=
                                          ire immediatamente il mittente e a distruggere il presente messaggio.<br></=
                                          div><div id=3D"DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
                                          <table style=3D"border-top:1px solid #d3d4de">
                                          =09<tr>
                                                  <td style=3D"width:55px;padding-top:13px"><a href=3D"https://www.av=
                                          ast.com/sig-email?utm_medium=3Demail&amp;utm_source=3Dlink&amp;utm_campaign=
                                          =3Dsig-email&amp;utm_content=3Dwebmail" target=3D"_blank"><img src=3D"https=
                                          ://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-n=
                                          o-repeat-v1.gif" alt=3D"" width=3D"46" height=3D"29" style=3D"width: 46px; =
                                          height: 29px;"></a></td>
                                          =09=09<td style=3D"width:470px;padding-top:12px;color:#41424e;font-size:13p=
                                          x;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a h=
                                          ref=3D"https://www.avast.com/sig-email?utm_medium=3Demail&amp;utm_source=3D=
                                          link&amp;utm_campaign=3Dsig-email&amp;utm_content=3Dwebmail" target=3D"_bla=
                                          nk" style=3D"color:#4453ea">www.avast.com</a>
                                          =09=09</td>
                                          =09</tr>
                                          </table><a href=3D"#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width=3D"1" heigh=
                                          t=3D"1"></a></div>
                                          
                                          --000000000000d931fa05c4d3ead3--
                                          --000000000000d931fb05c4d3ead5
                                          Content-Type: application/pdf; name="scheda-2021-06-15-22-31-43.pdf"
                                          Content-Disposition: attachment; filename="scheda-2021-06-15-22-31-43.pdf"
                                          Content-Transfer-Encoding: base64
                                          Content-ID: <f_kpyi8e5m0>
                                          X-Attachment-Id: f_kpyi8e5m0
                                          
                                          
                                          --000000000000d931fb05c4d3ead5--
                                          
                                          A Offline
                                          A Offline
                                          artwaw
                                          wrote on 15 Jun 2021, 22:11 last edited by
                                          #40

                                          @Marcus-Barnet said in Convert HTML to PDF:
                                          Content-Type: multipart/related; vs Content-Type: multipart/mixed;

                                          There are also differences in Return-Path header but I assume this is due to not full obfuscation on your part?

                                          I'll need to verify with google docs if this makes any difference (Content-Type), I really don't know from the top of my head.

                                          For more information please re-read.

                                          Kind Regards,
                                          Artur

                                          1 Reply Last reply
                                          0

                                          30/48

                                          12 Jun 2021, 12:28

                                          • Login

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