16,225
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>在线浏览PDF</title>
</head>
<body>
<script type="text/javascript" src="js/pdfobject.min.js"></script>
<script>
PDFObject.embed("D:/visual3D/WorkstationMultiuser/Builder/Debug/report/Data/1.2.840.113704.1.111.5488.1521071043.1/2019-10-11_15-45.pdf");
</script>
</body>
</html>
ui->webEngineView->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
QString path = "D:/visual3D/WorkstationMultiuser/Builder/Debug/report/Data/view.html";
//ui->webEngineView->load(QUrl(path));
//return;
QFile file(path);
bool isok = file.open(QIODevice::Text | QIODevice::ReadOnly);
QByteArray htmldata = file.readAll();
file.close();
QString ans = QString(htmldata).toUtf8();
ui->webEngineView->setHtml(ans);