ios - 如何检测使用 PDF KIT iOS 加载的 pdf 的变化
问题描述
我在 iOS 中加载了一个可编辑的 pdf。但无法弄清楚用户是否对该pdf进行了任何更改。
NSData *fileData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"PdfFormExample" ofType:@"pdf"]];
PDFDocument *pdfDocument = [[PDFDocument alloc] initWithData:fileData];
PDFView *pdfView = [[PDFView alloc] initWithFrame:self.view.frame];
pdfView.document = pdfDocument
[self.view addSubView:pdfView];
提前致谢。
解决方案
您可以使用 PDFKit 来控制和加载 pdf 到 iOS 应用程序。它由苹果提供。因为您必须首先为 PDF 设置委托
PDFDocumentDelegate
- PDFKit 可以发送不同操作的通知,例如开始写入、结束写入等。因此您可以使用这些方法获取本地通知来确定用户是否开始编写或修改 PDF。为此,您可以使用,
PDFDocumentDidBeginPageWriteNotification
PDFDocumentDidEndPageWriteNotification
根据您想要进行更改的时间,上述任何一项。
如果您想要更多参考这里是链接:
推荐阅读
- c# - 用于在 C# 中获取字符串中的数值的正则表达式
- arrays - 如何从另一个工作簿复制相应的单元格值?
- javascript - res.status 不是函数 Puppeteer
- azure-synapse - azure synapse - 无服务器 sql 池数据库在数据选项卡中不可见
- c - 从字符串到字符串的简单 strcpy 会使整个程序崩溃
- r - 无法将字符串变量转换为 R 中的因子
- python - 增强计算斜率符号变化 (SSC) 的代码
- sms - 短信发送报告
- php - 在 stderr 中发送的 FastCGI:从上游 nginx 错误读取响应标头时出现“主脚本未知”
- uwp - UWP:对于启动画面中的标志尺寸有什么建议?