PDF view in table view cell

Help me do a PDF preview in a UITableViewCell. Since I read the QLPreviewController and UIDocumentInteractionController documentation, these 2 only allow full-screen previews, but I need to do a little preview in the table cell. How can i do this?

+3
source share
2 answers

Here I posted some code to get the image (thumbnail) on the PDF page. If you just want to browse, and UIImage should be good enough. Once you get the image, you can simply add it to UIImageVIew in a UITableViewCell. Just be careful with rendering both lazy and asynchronous, otherwise your table will lag a lot.

+3
source

CGPDFDocumentRef is what you want to learn. The iPhone demo "ZoomingPDFViewer" shows how to create a PDF viewer using CGPDFDocumentRef.

If you want to create a thumbnail, you can create an image of the first pdf page and scale it as you wish. This forum talks about how to do this.

Happy coding.

+2

Source: https://habr.com/ru/post/1788216/


All Articles