quicklook

Swift 3 Cocoa: use QuickLook to preview file in OS X

一个人想着一个人 提交于 2019-12-07 12:42:00
问题 Xcode 8.3.2 I don't find QLPreviewPanel in the command list and I don't know how to do (which command must be used) to display a file preview in a ViewController. 回答1: First of all you will need to add the import Quartz statement to your NSViewCOntroller . Second step is to add QLPreviewPanelDataSource, QLPreviewPanelDelegate to its declaration. Next you just need to get a reference of the shared QLPreviewPanel, make the view controller its dataSource and delegate and make its window key and

Intercepting PDF Link Clicks using Quicklook Framework (QLPreviewController)

喜你入骨 提交于 2019-12-07 08:43:10
问题 Is PDF Link handling available in Quicklook? I created a prototype, and the QLPreviewControllerDelegate method -(BOOL)previewController:(QLPreviewController *)controller shouldOpenURL:(NSURL *)url forPreviewItem:(id)item never gets called. When I use a .docx file with links in it, the delegate method does get fired. Also, when I open up the PDF using safari, or a UIWebView, link handling works fine. I tested with a few different PDFs, and link interception never worked. I made sure that My

How to use QLPreviewPanel?

…衆ロ難τιáo~ 提交于 2019-12-07 04:44:35
问题 How do I use QLPreviewPanel ? I know it wasn't a public API before, but it is in 10.6. How can I use it to show a preview of a file in a standard QuickLook panel? 回答1: Check out the QuickLookDownloader code. It walks you through a couple of things you need to do to incorporate QLPreviewPanel into your code. Some of these include: Making your objects conform to the QLPreviewItem protocol - this tells Quick Look where to find the file you want to preview (and you are previewing files - you can

iOS 6.0 Quicklook QLPreviewController errors with: “Cannot find preview item for loaded proxy”

大憨熊 提交于 2019-12-07 02:09:18
问题 My application has been using the QLPreviewController to display files of all types and in iOS 5.x , it seemed to do so just fine. Now, in iOS 6.0, I get an error and it shows the controller but with a constant loading indicator and never actually loads anything. The error in the log is: Cannot find preview item for loaded proxy: <QLPreviewItemProxy: 0x8dbf480> - file://localhost/Users/me/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/E6A58F8D-71F3-4C7A-B16E-4BA017E318E5

How to use QLPreviewPanel?

让人想犯罪 __ 提交于 2019-12-05 10:46:55
How do I use QLPreviewPanel ? I know it wasn't a public API before, but it is in 10.6. How can I use it to show a preview of a file in a standard QuickLook panel? Check out the QuickLookDownloader code. It walks you through a couple of things you need to do to incorporate QLPreviewPanel into your code. Some of these include: Making your objects conform to the QLPreviewItem protocol - this tells Quick Look where to find the file you want to preview (and you are previewing files - you can't pass in custom data). Defining a data source and delegate for the QLPreviewPanel (if you're worked with

How to add a custom button to the Quick Look toolbar in iOS?

≡放荡痞女 提交于 2019-12-04 17:16:54
I'm currently displaying a PDF file using the Quick Look framework on an iPad via the Modal View Controller. Works great. My problem is that since I'm displaying a PDF file the Quick Look preview is automatically adding a "Print" button. What I would like to do is replace the "Print" button with a custom "Email" button. Is this something that can be done? At first pass I thought this was going to be a somewhat trivial thing to do but at this point I'm really struggling with it. Any help would be greatly appreciated. Thanks, Brett Since QLPreviewController is a subclass of UIViewController, you

How to develop/create a GUI for a QuickLook plugin?

谁说我不能喝 提交于 2019-12-04 13:19:59
问题 I saw lots of QuickLook plugins (like BetterZip Quick Look Generator) coming together with their nice and tidy interfaces...I tried to design the GUI of my own one using HTML and JQuery, but I don't think that it's a good solution (plus, on top of that, Xcode 5.1 doesn't allow you anymore to include or open files from other directories with the <src> attribute). I'll never thank enough Jelle Vandebeeck for opening my mind with his beautiful and helpful post, but unfortunately there's nothing

Display encrypted file using QuickLook framework or UiDocumentInteractionController

陌路散爱 提交于 2019-12-04 11:59:09
问题 I have an encrypted word/excel/pdf file locally stored which I need to preview in my iPad app. I understand that QLPreviewController or UiDocumentInteractionController could be used to preview these files. I can very well use this - (id <QLPreviewItem>) previewController: (QLPreviewController *) controller previewItemAtIndex: (NSInteger) index { return [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:[documents objectAtIndex:index] ofType:nil]]; } But the file is encrypted and

Mime Type (or something) So iOS Mail Does Not Open in Quicklook?

坚强是说给别人听的谎言 提交于 2019-12-04 07:34:35
I've been following the brilliant instructions in this answer , which work perfectly. However, my file type is mime "application/notforquicklook" and quicklook still tries to open it. This causes general gear spinning and nothing happening. How can I get around this problem? My files are compressed plists. Before I was using full XML plists, which worked fine, but they are too big (with no advantage). Is this a question of choosing the right MIME type, or something else? in fact, you should assign "public.data" to your "Conforms to UTIs" (UTTypeConformsTo) in "Exported Type UTIs"

Set windows size of QuickLook Plugin

跟風遠走 提交于 2019-12-03 15:13:22
I'm building a QuickLook plugin. I want to change the width of the windows that pops up when user hits the spacebar. I've read there are two keys in the info.plist file of the project where height and width are customisable. Even if I change those values I can't get the size of the preview windows to my desired one. I don't know what else to try. Any idea? Thanks! Thought I'd dig a little on this. I have not tried any of the following suggestions, so nobody get their hopes up. I'll assume you're using the generator callback: OSStatus (*GeneratePreviewForURL)( void *thisInterface,