KurtCode/PDFKitten
关于
用于在 iOS 上从 PDF 提取数据的框架。
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Kurt the PDFKitten
A Proof-of-Concept framework for searching PDF documents on iOS.
PLEASE NOTE THAT THIS SOFTWARE IS EXPERIMENTAL AND WILL MOST LIKELY NEVER BE FINISHED.
It was created to show how PDF search and highlighting could be done in third-party apps. Alas, it will likely never reach completeness or cover all usecases.
Why?
iOS, up to and including the current fifth version, does not provide any public APIs for searching PDF documents, or determining where on a page a given word is drawn. Any developer aiming to provide these features in an app must use low-level Core Graphics APIs, and keep track of the stateful process of laying out the content of the page.
This project is meant to facilitate this by implementing a complete workflow, taking as input a PDF document, a keyword string, and returning a set of selections that can be drawn on top of the PDF document.
How?
First, create a new instance of the scanner.
CGPDFPageRef page = CGPDFDocumentGetPage(document, 1);
Scanner *scanner = [Scanner scannerWithPage:page];
Set a keyword (case-insensitive) and scan a page.
NSArray *selections = [scanner select:@"happiness"];
Finally, scan the page and draw the selections.
for (Selection *selection in selections)
{
// draw selection
}
Limitations
The PDF specification is huge, allowing for different fonts, text encodings et cetera. This means strict design is a must, and thorough testing is needed. At this point, this project is not fully compatible with all font types, and especially support for non-latin characters will require further development.
Offering a complete solution for processing any PDF document would apparently require the inclusion of a complete library of font files. We currently do not intend to include more than the bare essentials for a proof-of-concept application.
Only latin character sets are currently supported.
License and Warranty
This software is provided under the MIT license, see License.txt.
探索相关项目
加载中…