Mac Vision OCR PDF cli is a Swift command-line tool that extracts text from images and generates a searchable PDF.
- Extracts text using Apple's Vision framework.
- Outputs text as a selectable/searchable PDF.
- Debug mode to visualize recognized text bounding boxes.
- Ensures PDF/A compliance with metadata.
- macOS 12+ (Monterey or later)
- Xcode with Swift support
- Command-line tools for macOS
- Compile the project:
swiftc macocrpdf.swift -o macocrpdf
./macocrpdf <input_image_path> <output_pdf_path> [--debug]- Process a single image:
./macocrpdf image.png output.pdf
- Enable debug mode (shows bounding boxes in terminal and PDF):
./macocrpdf image.png output.pdf --debug
This project is licensed under the MIT License.
Pull requests are welcome! Please open an issue for any major changes first.
This project uses Apple's Vision framework for OCR and PDFKit for PDF generation.