quicklook

WebGL in QuickLook

江枫思渺然 提交于 2019-12-14 04:20:14
问题 Is it possible to use WebGL in a quicklook plugin? I followed this tutorial replacing the relevant code in GeneratePreviewForURL.m with OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options) { NSString *_content = [NSString stringWithContentsOfURL:(__bridge NSURL *)url encoding:NSUTF8StringEncoding error:nil]; NSString* path = @"/Users/myusername/Downloads/TodoQL/demo.html"; NSError *error = nil;

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

℡╲_俬逩灬. 提交于 2019-12-13 12:14:47
问题 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

Can't Open Any HTTPS Resource Swift

隐身守侯 提交于 2019-12-11 15:39:29
问题 So I'm developing an app that will need to present both PDF and PPTX files served via the HTTPS protocol. However, try as I might I can't get it to work. At first I used PDFKit, and I did the following: URLSession.shared.dataTask(with: url!) { (data, resp, err) in // viewer is a PDFView instance bound to the VC self.viewer.document = PDFDocument(data: data!) }.resume() Nothing came up in the view. I looked down at the console and saw the following error message: failed to find PDF header: `

How to preview a ppt document coming from the url in iOS11 swift 4

人盡茶涼 提交于 2019-12-11 09:53:17
问题 I am trying to preview the pdf and ppt documents coming from the remote urls and I am using QuickLookPreviewController to preview documents. So far I am able to preview pdfs and videos but when I open the ppt it opens the quickLookController and instead of the ppt preview I am seeing nothing I don't know if this is the problem with QLPreviewController or there is some extra things I need to do for it to open. I am posting my code below so that you can understand whats wrong. import UIKit

Cocoa QuickLook initiated by NSTableView Cell

徘徊边缘 提交于 2019-12-11 07:30:11
问题 I have an NSTableView that contains 2 different Columns - one is an NSImageCell that shows a file icon, and the second is a custom subclass of NSTextFieldCell that contains a quick look button on the right of the text. When I click the Quick Look button, the following code is invoked: [[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil]; This does it's job and shows the blank Quick Look panel saying "No Items Selected." After I did a bit of research on the internet, I implemented a

Can't get QuickLook to work when trying to preview files

ε祈祈猫儿з 提交于 2019-12-11 06:53:09
问题 I am writing a macOS application with Swift using story boards. I have a NSTableView which contains files that I want the user to be able to preview via QuickLook. I seemingly have everything in place and my code looks very similar to what has been described here: QuickLook consumer as a delegate from an NSViewController, but I keep getting the error -[QLPreviewPanel setDataSource:] called while the panel has no controller - Fix this or this will raise soon. See comments in QLPreviewPanel.h

iOS - Opening a PDF via Quicklook without using UIScrollView

我是研究僧i 提交于 2019-12-10 11:48:05
问题 I am trying to open a PDF via the QuickLook framework without using UIScrollView... I believe I'm missing something... Where I believe I'm going wrong is that I need to use a QLPreviewController and on the QLPreviewController is a dataSource that has to conform to QLPreviewItem. The documentation states that NSURL does conform to QLPriewItem so I'm setting the preview.dataSource to an NSURL which is throwing an error: [NSURL numberOfPreviewItemsInPreviewController:]: unrecognized selector

How to put the QLPreviewPanel show as a popover in cocoa?

给你一囗甜甜゛ 提交于 2019-12-10 11:18:47
问题 I would like to make a Popover that can show as a popover like the spotlight search implementation? I can only use traditional way to show a Quicklook window on the centre, but I would like to make something like this: How can I do so? Thanks. 回答1: This can be achieved by creating a QLPreviewView instance embedded within a NSPopover. Then, create a NSObject subclass that conforms to the QLPreviewItem protocol and set the previewItem property on your QLPreviewView like when working with the

Set windows size of QuickLook Plugin

蹲街弑〆低调 提交于 2019-12-09 11:01:36
问题 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! 回答1: 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

Adding QLPreviewController as subview doesn't load PDF

柔情痞子 提交于 2019-12-09 03:43:45
问题 I'm trying to add a QLPreviewController's view as a subview (no--I cannot use a nav controller or modal). It only shows the fabric background of the QLPreviewController. I create one and add it as a subview: QLPreviewController* preview = [[[QLPreviewController alloc] init] autorelease]; preview.dataSource = self; preview.delegate = self; preview.view.frame = CGRectMake(0, 0, self.pdfPreviewView.frame.size.width, self.pdfPreviewView.frame.size.height); self.pdfPreviewView.previewController =