PDFTextExtractor is a command-line tool written in Swift that extracts text from PDF files.
- macOS 10.13 or later
- Xcode 13 or later
- Swift 5.7 or later
- Clone this repository:
git clone https://github.com/jempe/PDFTextExtractor.git
- Change to the project directory:
cd PDFTextExtractor
- Build the project:
swift build
Run the PDFTextExtractor tool with the path to a PDF file:
./.build/debug/PDFTextExtractor /path/to/your/pdf/file.pdf
This will extract and print the text from the specified PDF file.
Note: PDFKit might not extract text from certain types of PDF files accurately, especially those containing complex layouts or non-standard fonts.
To build the PDFTextExtractor tool for release, follow these steps:
- Build the project with optimizations enabled:
swift build --configuration release
- Run the release build of the tool:
./.build/release/PDFTextExtractor /path/to/your/pdf/file.pdf