CutyCapt icon indicating copy to clipboard operation
CutyCapt copied to clipboard

Cutycapt QtWebengine

Open RvdHout opened this issue 6 years ago • 10 comments

Any plans or has anyone actually tried to convert CutyCapt to use (the new) QtWebengine instead of QtWebKit?

RvdHout avatar Jun 29 '18 13:06 RvdHout

See Crystalix007/CutyCapt for a version using the new QtWebEngine. Enough features needed to be removed / changed that I don't feel comfortable submitting a pull request, however, it does function for what I've tested it with.

Crystalix007 avatar Jun 22 '20 13:06 Crystalix007

I have build your version with QTCReator using msvc2017 (64), most options seem to work, only thing i noticed i can't output a PDF, can you confirm --out-format=pdf doesn't work?

RvdHout avatar Jun 22 '20 18:06 RvdHout

Please see the latest commit. I was quitting too early (before the PDF ever had a chance to render), because I wasn't aware that the PDF rendering was asynchronous.

Crystalix007 avatar Jun 22 '20 20:06 Crystalix007

Yes that seems to work....i noticed you switched to printToPdf....the old method could not be used anymore? Asking for (optional/additional) papersize, orientation, quality & margin params

FYI, --user-agent param seems to be ignored

RvdHout avatar Jun 23 '20 15:06 RvdHout

It would definitely work with the previous print method, but printToPdf also has a lot of configurability (see Qt docs) as well. I just haven't added CLI options for them. Probably, because I don't personally need it, I'm not likely to implement it.

I don't see why useragent is being ignored. The processing is still there. Potentially I mucked something up when configuring the WebEngine object however.

Crystalix007 avatar Jun 23 '20 15:06 Crystalix007

I think --useragent needs QWebEngineProfile, not? https://doc.qt.io/qt-5/qwebengineprofile.html#httpUserAgent

RvdHout avatar Jun 23 '20 15:06 RvdHout

Yep. Just fixed it so that a user agent is set in more than just the member variable of CutyPage.

Crystalix007 avatar Jun 23 '20 16:06 Crystalix007

Hi @Crystalix007, me again....i noticed some issues with the way you made pdf rendering work again, it seems you use --max-wait parameter for this, right? Now lets say i set the --max-wait parameter like: --max-wait=10000

Every PDF generated takes 10 seconds to complete... even if it is created much faster (very simple PDF made from a webpage with small table) Now i can simply lower the --max-wait parameter, but that might interfere with other timeouts within cutycapt... is't there a better way to check PDF generation is complete?

RvdHout avatar Jul 29 '20 10:07 RvdHout

--max-wait=<ms> Don't wait more than (default: 90000, inf: 0)

Btw, this also interferes with --max-wait=0 (infinite)

RvdHout avatar Jul 29 '20 13:07 RvdHout

Moved to my project's issues to avoid unnecessary notification noise for hoehrmann.

Crystalix007 avatar Jul 29 '20 16:07 Crystalix007