Is it possible to use QLPreviewController to generate a document preview thumbnail? - objective-c

I do some research on QLPreviewController, it requires me to use the QLPreviewController to present a document or something like that. Is this possible for me to get the live document content as icon but within loading the QLPreviewController? Thanks.

No, this is not possible on iOS (yet).

Related

Titanium, Can you print a WebView webpage

In Titanium, is it possible to print a webpage, similar to printing a webpage from Safari? I'm using WebView.
It only needs to work with iOS, not Android.
If so, how? I haven't been able to find anything about this. One person told me it was impossible, but I thought I'd ask Stackoverflow - people here often surprise me :)
If you use the toImage() function on the WebView it takes a print to the visible area:
$.webview.toImage();
You want all the html content right?
If not, an possible workaround (I've didn't try this), but in order to do this, you need to know the html document height.
Create another WebView on an lower zIndex of your content app or place it out of the visible area like:
$.webview2.left = Ti.Platform.displayCaps.platformWidth;
Take a print of that copied WebView with:
$.webview2.toImage();
Than remove that view, obviously this wont work for all situations.

how to use pdf.js or viewerJS to display pdf in browser

i need a tuto about using pdf.js or viewejs to view pdf via browser. I found viewerjs.org but it doesn't help.
Any help thx in advance.
Try out pdf.js as it is very simple. Download the latest version here.
To show the pdf files traverse to web/viewer.html and it should load its default pdf.
As to the question about how to show your pdf's use: viewer.html?file=relative/path/to/your/pdf.
Say for example inside the web folder(the one in which viewer.html is there) of your pdf.js you create a directory say named pdfFiles and in it you add a pdf named say mypdf.pdf in it then to display it use: viewer.html?file=pdfFiles/mypdf.pdf and it will display it.
Almost all browsers are supported. Look here to know more about which all browsers are currently being supported.

How to convert html data to PDF in objective c

I want to convert html to pdf dynamically in objective c.
what is the best way to convert it, so that it maintains its look same as html.
Thanks in advance.
Prasad.
UIGraphicsBeginPDFContextToFile will help you to create a PDF file which shows your web content. Read through the documentation and create your own solution or just follow the tutorials I found:
Convert Html or UIWebView to pdf in iPhone or iPad
Making a PDF from a UIWebView
I have used this Haru open source library, it is quite simple and useful for creating pdfs http://libharu.org/wiki/Main_Page
Objective-C is a programming language, it doesn’t know anything about HTML or PDF per se. How to do this depends on the framework you’re using. I’m assuming here you’re using Cocoa on OS X.
There you can load your HTML into a WebView provided by WebKit and then use the NSView method dataWithPDFInsideRect: to render it as PDF. I haven’t tested this, but maybe you’ll have to add the web view to a window before you can query the PDF data.

QuickLook plugin displaying an image and some infos

I'm currently writing a QuickLook plugin, and I wondering how I can display an image and some information about that image at the same time, similar to http://www.code-line.com/software/sneakpeekphoto/ .
There is only one way to do so: Convert your content to an already supported one. This means either PDF or HTML. There are two options you have:
For static information you create a simple PDF preview by rendering a view into a PDF. (Use -dataWithPDFInsideRect: method of NSView)
For dynamic information create a HTML page with links and so on. QuickLook will then show it. (I think this is also the way your example does it.)
We have not found a way to create complex previews on ur own and had to stick to one of the methods, too. Keynote and Pages do the same -- they convert their presentations to multi-page PDF previews...

Adobe AIR can't show Flash embedded in HTML?

of all three choices (AIR+AJAX, +Flash, and +FLEX) I went on the AJAX route. But it seems that it can't show Flash embedded in HTML (using the traditional OBJECT tag).
Is it by design? or my fault?
i think it's your fault. there are a number of air "web browsers" and they all can display flash just fine.
google for some. i found one here and it gives the source code as well
I've found the culprit: my window is transparent.
According to adobe, SWF and PDF won't be displayed if transparency is used.
I don't know much about Ajax but i do know the preferred method to embed flash into html is to use swfobject. have you tried that yet?