title: QWebEngineView fails to render PDF embedded in HTML
body: <p>I'm writing a Python script for an MDI-based PyQt5 application, where the windows use the new QWebEngineView to render some HTML that embeds a PDF in an iFrame. The HTML is a custom-generated string and the PDF is a local file.</p>
  
  <p>The HTML is a locally stored template that my code loads and then alters to insert a variable:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Title&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;iframe src="$PDF"&gt;
      &lt;/iframe&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>$PDF is subbed in as a string like: file:///local/path/to/document.pdf</p>
  
  <p>Here's my Python script so far:</p>
  
  <pre><code>import os, sys
  from PyQt5.QtCore import QUrl
  from PyQt5.QtWidgets import QApplication, QMainWindow, QMdiArea, QAction, QMdiSubWindow
  from PyQt5 import QtWebEngineWidgets
  
  class MDIWindow(QMainWindow):
  
      def __init__(self):
          super().__init__()
  
          self.mdi = QMdiArea()
          self.setCentralWidget(self.mdi)
          bar = self.menuBar()
          file = bar.addMenu("File")
          file.addAction("New")
          file.addAction("cascade")
          file.addAction("Tiled")
          file.triggered[QAction].connect(self.Window)
          self.setWindowTitle("MDI Application")
  
      def Window(self, p):
          if p.text() == "New":
              sub = QMdiSubWindow()
              view = QtWebEngineWidgets.QWebEngineView()
              settings = view.settings()
              settings.setAttribute(QtWebEngineWidgets.QWebEngineSettings.PluginsEnabled, True)
              CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
              pdf_path = "file://" + os.path.join(CURRENT_DIR, "test.pdf")
              template = os.path.join(CURRENT_DIR, "test.html")
              with open(template, 'rt') as f:
                  text = ''.join(f.readlines())
                  html = text.replace('$PDF', pdf_path)
              view.setHtml(html, QUrl("file://"))
              sub.setWidget(view)
              sub.setWindowTitle("Test")
              self.mdi.addSubWindow(sub)
              sub.show()
  
          if p.text() == "cascade":
              self.mdi.cascadeSubWindows()
  
          if p.text() == "Tiled":
              self.mdi.tileSubWindows()
  
  app = QApplication([])
  mdi = MDIWindow()
  mdi.show()
  app.exec_()
  </code></pre>
  
  <p>Most of this script works fine - it creates the main window, receives a menu bar command to create a document window, creates the document window, and loads the HTML. All good.</p>
  
  <p>The problem is that the embedded PDF won't load. All I get is a gray surface.</p>
  
  <p>Further observations:</p>
  
  <ul>
  <li><p>Any HTML visual elements inserted into the page are correctly rendered.</p></li>
  <li><p>Changing the resource type to an image, such as a PNG, results in the resource being correctly rendered. It's just PDFs that are problematic.</p></li>
  <li><p>If I change the file URL to something else, I get warnings about a dead link. So it's clearly trying to load the PDF.</p></li>
  <li><p>The actual PDF does not matter - I've tried several different ones with the same result.</p></li>
  <li><p>The gray surface provides a context menu with Reload, Save Page, and View Source. Reload apparently does cause the page to refresh (it blinks for a brief moment) but produces the same result. Save Page and View Source do nothing.</p></li>
  </ul>
  
  <p>Any ideas? Thanks in advance.</p>