Skip to content

m8rge/macOCRmyPDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mac Vision OCR PDF

Mac Vision OCR PDF cli is a Swift command-line tool that extracts text from images and generates a searchable PDF.

Features

  • 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.

Requirements

  • macOS 12+ (Monterey or later)
  • Xcode with Swift support
  • Command-line tools for macOS

Installation

Build from Source

  1. Compile the project:
    swiftc macocrpdf.swift -o macocrpdf 

Usage

./macocrpdf <input_image_path> <output_pdf_path> [--debug]

Examples

  • 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

License

This project is licensed under the MIT License.

Contributing

Pull requests are welcome! Please open an issue for any major changes first.

Acknowledgments

This project uses Apple's Vision framework for OCR and PDFKit for PDF generation.

About

OCR images to PDF using Mac Vision

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages