TKDocumentParser 是一个 Swift 包,旨在简化从各种文档格式(包括 PDF 和 DOCX)中提取纯文本的过程。 该包提供了一个简单的 API,用于处理不同类型的文档并检索其文本内容。
要查看 TKDocumentParser 的实际应用,请查看 TKDocumentParserDemo 仓库中包含的示例项目。 在 Xcode 中打开 TKDocumentParserDemo.xcodeproj 以运行演示应用程序并查看该包的工作方式。
要将 WingedSwift 添加到您的项目中,请将以下行添加到您的 Package.swift 文件中
dependencies: [
.package(url: "https://github.com/toseefkhilji/TKDocumentParser.git", from: "1.0.0")
]
并将 TKDocumentParser 作为依赖项包含在您的目标中
targets: [
.target(
name: "YourTarget",
dependencies: ["TKDocumentParser"]),
]
TKDocumentParser 允许您从文档中获取纯文本。
import TKDocumentParser
do {
let url = // your local file path
let text = try TKDocumentParser.parseText(from: url)
print("extractedText: \(text)")
} catch {
print(error.localizedDescription)
}
欢迎贡献! 请按照以下步骤进行贡献
git checkout -b feature/new-feature)git commit -am 'Add new feature')git push origin feature/new-feature)该项目根据 MIT 许可证获得许可。 有关更多详细信息,请参阅 LICENSE 文件。