ios - 从 WKWebView 中显示的 PDF 中获取页码以进行书签
问题描述
我已经实现了 WKWebView 并在其中显示了一个 PDF 文件,现在我想为页面添加书签。为此我需要知道
1) How to get current Page Number of PDF displayed
2) How to scroll WKWebView to that page number later on.
到目前为止,我已经这样做了:
let pathOfPDF = URL(fileURLWithPath: Bundle.main.path(forResource: "pdfFile", ofType: "pdf")!)
let request = URLRequest(url: pathOfPDF)
pdfView.frame = CGRect(x: view.frame.width/26, y: view.frame.height/12.5, width: view.frame.width-view.frame.width/13, height: view.frame.height - view.frame.height/12.5)
pdfView.uiDelegate = self
activityIndicatorIcon.hidesWhenStopped = true
pdfView.allowsBackForwardNavigationGestures = true
pdfView.load(request)
pdfView.navigationDelegate = self
解决方案
推荐阅读
- ios - 如何在关闭时调用点击手势(iOS)
- powershell - 如何使用 PowerShell GUI 在用户 jpegPhoto 和 thumbnailPhoto 的属性中插入图片?
- django - Dhango 1.11 如何过滤一个过滤器的内容?
- javascript - 无法在打字稿中调用 svgdotjs rect 方法
- ios - 在 WhatsApp 上快速共享图像和文本
- php - 有时谷歌分析增强电子商务交易没有更新
- c# - 无法使用 C# Interop.Outlook 访问不同的收件人帐户文件夹
- excel - 如何使用重新格式化用户粘贴的文本块的长 For Next 循环来加速我的 VBA 代码?
- angular - 将 ngfor 与另一个 ngfor 中的动态可观察对象一起使用
- r - 如何在 R 中将 lib-paths 设置为具有单个目录,即“C:\Users\Username\Documents\...”