admin管理员组文章数量:1592429
目录
1、参考
2、实现
3、开发记录
1、参考
使用Qt的WebEngine和javascript的pdf.js模块构建的PDF查看器。
参考链接1:GitHub - Archie3d/qpdf: PDF viewer widget for Qt
参考链接2:GitHub - yshurik/qpdfjs: Desktop PDF Viewer based on Qt and PDF.JS technologies
pdfjs源码下载:Getting Started
2、实现
Print.js主页说明:Print.js - Javascript library for HTML elements, PDF and image files printing.
源码下载链接:Release v1.5.0 · crabbly/Print.js · GitHub
测试发现pdfjs与qtwenengineview结合,并不能调用打印机,这里添加了js+qt打印通信功能,调用qt的打印窗口:
实现效果,对应代码下载 https://download.csdn/download/qq_36939187/87336714
3、开发记录
QWebEngineView 设置无缓存
QWebEngineProfile *pEngineProfile = page()->profile();
if(nullptr == pEngineProfile)
{
return;
}
pEngineProfile->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies); // 会话和持久性cookie都存储在内存中
pEngineProfile->setHttpCacheType(QWebEngineProfile::NoCache); // 禁用内存和磁盘缓存。
版权声明:本文标题:qt5实现pdf阅读器(三)——pdfjs 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1728139909a1147228.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论