Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save iosdevie/d97d178b259f9a95de61ed9188103d9f to your computer and use it in GitHub Desktop.
UIImage to PDFPage to PDFDocument
let pdfDocument = PDFDocument()
for i in 0 ..< scan.pageCount {
if let image = scan.imageOfPage(at: i).resize(toWidth: 250){
let pdfPage = PDFPage(image: image)
pdfDocument.insert(pdfPage!, at: i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment