TKDocumentParser is a Swift package designed to simplify the process of extracting plain text from various document formats, including PDF and DOCX. This package provides a straightforward API for handling different types of documents and retrieving their textual content.
To see TKDocumentParser in action, check out the example project included in the TKDocumentParserDemo repo. Open TKDocumentParserDemo.xcodeproj in Xcode to run the demo app and see how the package works.
To add WingedSwift to your project, add the following line to your Package.swift file:
dependencies: [
.package(url: "https://github.com/toseefkhilji/TKDocumentParser.git", from: "1.0.0")
]And include TKDocumentParser as a dependency in your target:
targets: [
.target(
name: "YourTarget",
dependencies: ["TKDocumentParser"]),
]TKDocumentParser allows you to get plain text from documents.
import TKDocumentParser
do {
let url = // your local file path
let text = try TKDocumentParser.parseText(from: url)
print("extractedText: \(text)")
} catch {
print(error.localizedDescription)
}Contributions are welcome! Please follow the steps below to contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for more details.
