I have read the Apple PDF documentation with Quartz.
But I do not know how to generate the thumbnails from a PDF document...
Any idea/sample code ?
I have read the Apple PDF documentation with Quartz.
But I do not know how to generate the thumbnails from a PDF document...
Any idea/sample code ?
From iOS 11 you can use
PDFKit
.Call it:
In the meantime I have created a library which does support PDF, Images and Videos for creating thumbnails. Maybe someone else can use it:
https://github.com/prine/ROThumbnailGenerator
Solution in Swift. Just pass the NSURL to the PDF and the page number you want to retrieve as UIImage:
Here is my sample code.
Starting with iOS 11 where PDFKit framework became available, you can get a thumbnail as simply as:
Thumbnails can also be generated with following code (Swift 4) which is working for images, PDF files etc.
Swift 4 Version of Prine's Answer