I want to read a pdf file which is coming in URl from server. I am not using UIWebview.
So, i just want to know that is there any way to view that pdf file without downloading in to device. Just it be readable or buffered, not stored.
Any suggestions for that.
The easiest way to show a PDF outside of a UIWebView is using the QuickLook framework:
http://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/UsingtheQuickLookFramework.html
However, as isn't unreasonable, Quicklook requires URLs of a "file" type.
So without using a UIWebView, you'll need to add your own code to download/cache/display, which isn't hard. If you need sample code, let me know.
Related
I am working on file previewing in iOS. I have tried using UIWebview to load the data and UIDocumentInteractionViewController. However, these methods won't work well with large files.
I was thinking of using FileStreams InputStream/OutputStream to preview files.
How can I use UIWebview to preview file from an InputStream.
Would love to know a good approach to this problem?.
TL;DR - I want to download a .csv and other files from a link, and present a UIActivityViewController.
I'm working in an app with lots of WKWebViews. In one of the delegate methods, decidePolicyForNavigationAction:, the available URL is a URL compatible with URLRequests, and I can download just fine from it. (navigationAction.request.url)
In another delegate method decidePolicyForNavigationResponse: the response's url (navigationResponse.response.url) identifies as part of Apple's QuickLook framework scheme, and contains this: x-apple-ql-magic. I was trying to use a QLPreviewController, but couldn't populate the dataSource with a remote file I wanted to download.
My goal is: When a link points to a downloadable file, like a .csv or PDF, give a user the option to share this file via UIActivityViewController.
How can I download remote files from this scheme: x-apple-ql-magic?
You can’t. When WKWebView previews a file such as CSV, it is internally converted to HTML by Quick Look to be rendered by WebKit. The x-apple URL is the URL of the converted content. It should not be exposed to you, you should be seeing the original URL instead, please file a bug.
Why do you want to use the response delegate in the first place instead of the delegate at link tap time?
We want to share PDF or other documents using JSQMessanger. Because we have used JSQMessanger for chating in our App.
You should expand JSQ functionalities for the PDF source
Look at how the example app does media items i.e. Video or images. It will be similar to this and then you just need to adapt it so that it can handle the PDF payload. Definitely a great thing to add to the library.
Hi i'm wanting to create a webpage in which i can pass a url to a document and it previews it. the idea behind this is so i can create a responsive web view for android so i can preview documents from with an app i have basic knowledge of php and html but if some one could point me in the right direction? i have had a look around but can't find anything that basic i don't need to edit the documents just view them. Does anyone know how to do this?
ps: the docs i want to preview are .xl .xls .doc .docx .pdf .ppt etc
Here is what looks to be a decent open source option.
http://flexpaper.devaldi.com/
One option would be to convert the documents to .pdf first using OpenOffice and then preview them using pdf.js
Are there any good SDKs available on iOS that will not only display a PDF, but will show it as it is downloading from a web source? It is perfectly fine to use a paid for library as long as it is commercial-friendly.
To clarify, the SDK must be able to show partial files as they are downloading, whether I provide the stream or otherwise. I would like to avoid CGPDFScannerRef due to how low level it is -- I have tried FastPdfKit as well but it will only show the whole PDF after it has been fully downloaded. Any ideas?
PDF is a structured format that consists of different types of data blocks such as TOC, text, fonts, colors, annotations and information about these blocks is saved at the end of the file. So this makes it impossible for CGPDFDocumentRef to open the pdf without all the data available.
However you can get around this limitation by linearizing the PDF file so that the metadata information will be put at the beginning of the file. I'm not sure but I think you can then use CGDataProviderCreateSequential in combination with CGPDFDocumentRef to parse a partially downloaded PDF file.