PDF preview in a table view cell
Help me making a PDF preview, in a UITableViewCell. As I have read the documentation of QLPreviewCont开发者_StackOverflow社区roller 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?
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.
CGPDFDocumentRef is what you want to look into. The iPhone demo "ZoomingPDFViewer" shows you how to create a PDF viewer, using CGPDFDocumentRef.
If you want to create a thumbnail, then you can create a image of the pdf first page and scale it to your need. This forum talks about how to do that.
Happy coding.
精彩评论