Important: Please read the Qt Code of Conduct -

Is there any way to get a qt web browser that can render pdf files?

  • Hello,

    I am looking for some way to get a basic web browser that can render pdf files. SO far the demos and applications I have found and tried do not render a PDF, some will let you download a pdf to the desktop though.

    I tried to get a pdf viewer plugin to work but no luck.

    Just curious if this is possible or if I should look for other solutions outside of Qt.



  • I would find this useful too. So I searched around and found this code (assuming that you can deploy PHP in server). Of course this code is outside Qt in apache or jetty server..


    // credits:

    $file = 'path/to/PDF/filename.pdf';
    $filename = 'filename.pdf';

    header('Content-type: application/pdf');
    header('Content-Disposition: inline; filename="' . $filename . '"');
    header('Content-Transfer-Encoding: binary');
    header('Accept-Ranges: bytes');

  • @eureka And if this doesn't work you could use something like pdf.js (

Log in to reply