/djvu-swift

Library to easy handle Djvu files in swift iOS

Primary LanguageC++Creative Commons Zero v1.0 UniversalCC0-1.0

Djvu in swift

An library to simple decode and display djvu files in iOS, iPadOS, and MacOS

let djvuBook = Bundle.main.url(forResource: "book1", withExtension: "djvu")!
let djvu = try! Djvu(url: djvuBook)
debugPrint("pages in djvu: \(djvu.numberOfPages)")
let image: UIImage = try! djvu.getImage(page: 12, dpi: 320)
// or display djvu page in thumbnail
let image: UIImage = try! djvu.getImage(page: 12, dpi: 320, maxSideSize: 640)

Library is not thread safe, so all access must be isolated