您好我正在寻找使用 PSPDFKit 框架及其全文搜索功能来查找文档。我在 Cordova/Phonegap 应用程序中执行此操作,因此我想将搜索结果数据返回到我的 Javascript 应用程序。
我遇到了返回文档名称/路径而不是文档 UID 的问题。是否可以将 documentUID 转换为 PSPDFDocument
[library documentUIDsMatchingString:searchString options:nil completionHandler:
^(NSString* searchString, NSDictionary<NSString *,NSIndexSet *> * resultSet) {
for (NSString *UID in resultSet) {
NSIndexSet *indexSet = resultSet[UID];
NSLog(@"Found the following matches in document %@: %@", UID, indexSet);
}
}
上面的 UID 看起来像这样:
样本pdf_ffa29462f17ca27908ab82bdd3d575a7
这并不意味着太多,有一个名为 -metadataForUID 的方法,但在使用上述字符串调用时总是返回 null 。