Search code examples
iphonepdfpreviewqlpreviewcontrolleruidocumentinteraction

PDF preview in a table view cell


Help me making a PDF preview, in a UITableViewCell. As I have read the documentation of QLPreviewController and UIDocumentInteractionController, these 2 only allow a full screen preview but I need to make a tiny preview in a table view cell. How could I do it?


Solution

  • Here I posted some code to get an image (thumbnail) out of a PDF page. If you just want to preview and UIImage should be good enough. Once you have the image you can just add it as an UIImageVIew to the UITableViewCell. Just be careful to the the rendering both lazy and async, otherwise your table will lag badly.