https://github.com/d-integral/nefertiti
A searchable PDF maker.
https://github.com/d-integral/nefertiti
pdf pdf-generation
Last synced: 4 months ago
JSON representation
A searchable PDF maker.
- Host: GitHub
- URL: https://github.com/d-integral/nefertiti
- Owner: D-Integral
- License: mit
- Created: 2024-07-13T16:26:39.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-14T01:55:10.000Z (over 1 year ago)
- Last Synced: 2026-01-29T14:55:37.832Z (5 months ago)
- Topics: pdf, pdf-generation
- Language: Swift
- Homepage:
- Size: 213 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nefertiti
Nefertiti by Dmytro Skorokhod is an open source iOS library for making searchable PDF documents from photos. It takes an array of UIImage objects and returns a file confirming to NefertitiFileProtocol.
Nefertiti is available as a Swift package. To start using the library add package dependancy, then import Nefertiti and NefertitiFile into your source code file.
Here is an example of usage Nefertiti with VisionKit:
```Swift
import Nefertiti
import NefertitiFile
import VisionKit
let nefertiti: NefertitiPDFMakerProtocol = NefertitiSearchablePDFMaker()
var pdfDocumentSavingOperation: ((any NefertitiFileProtocol) -> ())?
extension VisionDocumentCameraManager: VNDocumentCameraViewControllerDelegate {
func documentCameraViewController(_ controller: VNDocumentCameraViewController,
didFinishWith scan: VNDocumentCameraScan) {
var pageImages = [UIImage]()
for pageIndex in 0 ..< scan.pageCount {
pageImages.append(scan.imageOfPage(at: pageIndex))
}
nefertiti.generatePdfDocumentFile(from: images) { file, error in
if let error = error {
debugPrint(error)
return
}
guard let file = file,
let pdfDocumentSavingOperation = pdfDocumentSavingOperation else { return }
pdfDocumentSavingOperation(file)
}
}
}
```
Read the NefertitiFile library documentation for the examples of NefertitiFileProtocol usage.