{"action":"created","issue":{"url":"https://api.github.com/repos/QupZilla/qupzilla/issues/2068","repository_url":"https://api.github.com/repos/QupZilla/qupzilla","labels_url":"https://api.github.com/repos/QupZilla/qupzilla/issues/2068/labels{/name}","comments_url":"https://api.github.com/repos/QupZilla/qupzilla/issues/2068/comments","events_url":"https://api.github.com/repos/QupZilla/qupzilla/issues/2068/events","html_url":"https://github.com/QupZilla/qupzilla/pull/2068","id":173570752,"number":2068,"title":"Add initial printing support with QtWebEngine >= 5.7.0","user":{"login":"kkofler","id":5055817,"avatar_url":"https://avatars.githubusercontent.com/u/5055817?v=3","gravatar_id":"","url":"https://api.github.com/users/kkofler","html_url":"https://github.com/kkofler","followers_url":"https://api.github.com/users/kkofler/followers","following_url":"https://api.github.com/users/kkofler/following{/other_user}","gists_url":"https://api.github.com/users/kkofler/gists{/gist_id}","starred_url":"https://api.github.com/users/kkofler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkofler/subscriptions","organizations_url":"https://api.github.com/users/kkofler/orgs","repos_url":"https://api.github.com/users/kkofler/repos","events_url":"https://api.github.com/users/kkofler/events{/privacy}","received_events_url":"https://api.github.com/users/kkofler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-27T01:28:23Z","updated_at":"2016-08-28T23:59:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/QupZilla/qupzilla/pulls/2068","html_url":"https://github.com/QupZilla/qupzilla/pull/2068","diff_url":"https://github.com/QupZilla/qupzilla/pull/2068.diff","patch_url":"https://github.com/QupZilla/qupzilla/pull/2068.patch"},"body":"This works by printing to PDF first, then sending the PDF to a printer if printing to a physical printer was requested.\r\n\r\nOn *nix (including Mac OS X), we use the lpr command, which is typically provided by CUPS nowadays. Currently, no options beyond the printer name are passed, there is room for improvement there. (Okular has a FilePrinter class that handles this in a more sophisticated way.)\r\n\r\nOn Windows, we use ShellExecuteW with the \"printto\" verb. In that case, the printer name is unfortunately the only thing that can be passed. The user experience may also be suboptimal depending on the PDF viewer installed on the system. (E.g., Adobe Reader is reported to ignore SW_HIDE.) And if there is no PDF viewer installed at all, it will of course not work at all. But it is the best we can do without bundling something like GhostScript (or requiring the user to install it).\r\n\r\nI successfully tested the revision I am now submitting on Fedora Rawhide (actually, I backported the patches to QupZilla 2.0.1 and tested that, but that should not make any difference in practice): it can definitely bring something to paper (and printing to PDF also works), honoring more options is TODO as explained above. I cannot test the Windows code."},"comment":{"url":"https://api.github.com/repos/QupZilla/qupzilla/issues/comments/243007889","html_url":"https://github.com/QupZilla/qupzilla/pull/2068#issuecomment-243007889","issue_url":"https://api.github.com/repos/QupZilla/qupzilla/issues/2068","id":243007889,"user":{"login":"kkofler","id":5055817,"avatar_url":"https://avatars.githubusercontent.com/u/5055817?v=3","gravatar_id":"","url":"https://api.github.com/users/kkofler","html_url":"https://github.com/kkofler","followers_url":"https://api.github.com/users/kkofler/followers","following_url":"https://api.github.com/users/kkofler/following{/other_user}","gists_url":"https://api.github.com/users/kkofler/gists{/gist_id}","starred_url":"https://api.github.com/users/kkofler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkofler/subscriptions","organizations_url":"https://api.github.com/users/kkofler/orgs","repos_url":"https://api.github.com/users/kkofler/repos","events_url":"https://api.github.com/users/kkofler/events{/privacy}","received_events_url":"https://api.github.com/users/kkofler/received_events","type":"User","site_admin":false},"created_at":"2016-08-28T23:59:55Z","updated_at":"2016-08-28T23:59:55Z","body":"That said, I can convert it to an actual QProcess object and the finished signal, the only drawback is that the code will be more complicated. (I don't want to use the fire&forget QProcess::startDetached because I want to delete the temporary file if `lpr` cannot be run for some reason.)"}}
{"actor":{"display_login":"kkofler"}}