Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Is there any way to get a qt web browser that can render pdf files?

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

Scheduled Pinned Locked Moved Unsolved QtWebEngine
3 Posts 3 Posters 1.3k 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.
  • TavisT Offline
    TavisT Offline
    Tavis
    wrote on last edited by
    #1

    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.

    Thanks,

    Tavis

    1 Reply Last reply
    0
    • E Offline
      E Offline
      eureka
      wrote on last edited by eureka
      #2

      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..

      <?php

      // credits: http://yogeshchaugule.com/blog/2013/how-display-pdf-browser-php?page=1

      $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');
      @readfile($file);
      ?>

      1 Reply Last reply
      0
      • picaschafP Offline
        picaschafP Offline
        picaschaf
        wrote on last edited by
        #3

        @eureka And if this doesn't work you could use something like pdf.js (https://mozilla.github.io/pdf.js/)

        1 Reply Last reply
        0

        • Login

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