html2pdf fails to load web URL
-
Hello,
I have built Qt 5.15 and 6.2.2 on Windows and Linux. Trying html2pdf. It works on Windows in both versions.
On Linux, Redhat, it is not working. Fails to load the web page.
In Qt5, there is no error coming out, it just fails.
In Qt6, I see js: crbug/1173575, non-JS module files deprecated.I have proxy set and it is working fine. When doing a wget to download the web page or write a Qt example which uses QNetworkAccessManager to download the same web page on Linux works.
But html2pdf examples just fails to download the page. There is no information coming out which tell's exactly what is missing.There is one post in the forum with the same error but that solution did not work.
[https://forum.qt.io/topic/146993/js-crbug-1173575-qwebengineview/3](link url)Any help will be appreciated.
Thanks,
NS -
Hello,
I have built Qt 5.15 and 6.2.2 on Windows and Linux. Trying html2pdf. It works on Windows in both versions.
On Linux, Redhat, it is not working. Fails to load the web page.
In Qt5, there is no error coming out, it just fails.
In Qt6, I see js: crbug/1173575, non-JS module files deprecated.I have proxy set and it is working fine. When doing a wget to download the web page or write a Qt example which uses QNetworkAccessManager to download the same web page on Linux works.
But html2pdf examples just fails to download the page. There is no information coming out which tell's exactly what is missing.There is one post in the forum with the same error but that solution did not work.
[https://forum.qt.io/topic/146993/js-crbug-1173575-qwebengineview/3](link url)Any help will be appreciated.
Thanks,
NS -
@__ns You could build debug version of html2pdf and run through debugger to see what happens.
@jsulm I tried that and the code was overwhelming, especially async which make's it hard to debug when you do not have any background of Qt internal's. I will see if someone has a clue otherwise that might be one approach, not sure how much successful I will be. Thanks for looking.
-
@jsulm I tried that and the code was overwhelming, especially async which make's it hard to debug when you do not have any background of Qt internal's. I will see if someone has a clue otherwise that might be one approach, not sure how much successful I will be. Thanks for looking.
@__ns
There are so many possibilities it's difficult to know where tot start. One question: do you need/want to use html2pdf? There are various ways to convert to PDF within Qt itself. For example, even from 11 years ago there is https://stackoverflow.com/questions/10697228/converting-html-to-pdf-with-qt. Do you want to test that works? First against local file like it does, then alter to fetch from URL? First against a tiny HTML file, then against your particular HTML content? -
@JonB Thanks for looking. Yes, I need to convert HTML to PDF. Agree, possibilities are many and this is not a clear question with a straight answer. I just posted in case someone had hit something like this before or someone in the know how of Qt WebEngine might have some pointers for me. I had tried printing the HTML to PDF using QPrinter and it was not satisfactory even with a basic html.
I was reading QtWebEngine and internally Chromium does not use QNetworkAccessManager (like Qt WebKit). It has its own implementation of network and this is what I feel is failing somewhere on Linux. So eventually if I have to figure out, I probably will have to debug inside Chromium to see what is happening.
PS: For now there is a solution with Qt WebKit and so not super urgent but eventually I might have to figure out the Qt WebEngine solution.