Answer the question
In order to leave comments, you need to log in
What is this pdf upload error?
import sys
from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets
PDF = 'file:///blank-f-119.pdf'
class Window(QtWebEngineWidgets.QWebEngineView):
def __init__(self):
super(Window, self).__init__()
self.settings().setAttribute(
QtWebEngineWidgets.QWebEngineSettings.PluginsEnabled, True)
self.settings().setAttribute(
QtWebEngineWidgets.QWebEngineSettings.PdfViewerEnabled, True)
self.load(QtCore.QUrl.fromUserInput(PDF))
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
window = Window()
window.setGeometry(600, 50, 800, 600)
window.show()
sys.exit(app.exec_())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question