Is it possible to open a pdf whilst it is being downloaded? - iphone

Does anyone know if you can start displaying a pdf document in iOS before it has finished downloading? I know PDF supports this but can it be done in iOS?
I am wondering if something can be done with CGPDFDocumentCreateWithProvider and a custom provider, but I can't find much useful information on CGDataProviders.
Any ideas?

Related

Page-Based app load epub

I am new to iphone app developing and need to display an epub file in an app that I am working on. I would like to use UIPageViewController as that allows paging ect. As of yet I have not been able to figure out how to load the content into a uiwebview and still get the paging function. If someone could point me to any sample code that would help me I would greatly appreciate it.
You really can not use that, since you need ot use UIWebView. I do not think that any other view offers enough of a head start to make it worth it not to use a UIWebView.
There was a lot of discussion about this found here:
Reading ePub format
also see this:
Best approch for creating ePub reader similar to iBook or Stanza application

creating iphone app for existing site. need advice about the data I'm downloading

I'm building an iPhone app for existing site (a local news site)
Main page with articles headers, when click on them you move to the article page. Simple.
This is the first time I'm building such type of app.
I have 3 general questions, just to make sure :
For the iphone, Do we need to
re-create the website article's
pictures for the iphone ? or there
is some programming tool that on the
fly make the files looks better on
the iphone ? or maybe, there is some
technique that creates one artice
picture that looks right both for
the server and the iphone ?
Usually, Do you need to create
special data channels from the
iPhone webservice ? or programmers
just use the existing rss channels
of the webserver ?
If someone know nice artice about
this stuff, It will help a lot. just
see what other are doing.
thanks.
You can see the intent Media apps, these apps are working like what you want your app to.
1) You're better off creating mobile versions of the images. You can do image processing on the iPhone, but you'll have to have the original and that makes the whole thing pointless (ie. you have to download the whole thing.) Generate a mobile thumbnail when those are uploaded on the server.
2) RSS will do. There's a very good tutorial at cocoadevblog.com about approaching such a task (I guess this covers 75% of the work you have to do)
3) Check 2) ;-)
if your download image is bigger the the thumbnail you are trying to display,
then the problem is in your code that change the image size. check carefully what are you doing to the image after downloading it.
I would recommend to create square thumbnails of your pictures at the server level. This will allow you to easily position in the iPhone screen, plus you will not need to download the whole image from the server.
nnahum

getting data from server and store in the iPhone

i want to develop an iPhone app where the app downloads data (say audio clips) from a specified server and stores it locally on the device.
then the app should use the data stored in the device rather than stream it from the server.
could anybody give me the guidelines as to how this can be done? tutorials and samples also appreciated. Thanks :)
The easiest way to play files from the internet is to use -[AVAudioPlayer initWithContentsOfURL:error:]. If you want to make sure that the whole file is downloaded, I think your best bet would be to download the file using NSURLConnection (see the URL Loading Guide) and then using -[AVAudioPlayer initWithData:error:].
Look into ASIHTTPRequest, you will find it much easier to fetch large chunks of binary over the web asynchronously than if you try to code everything yourself.

Parsing WML on the iPhone

I have a WML based source of data which I need to parse in an iPhone app.
What would be the easiest way to achieve this?
I'm currently looking into the various XML libraries available on the iPhone but would appreciate a nudge in the right direction.
Currently playing around with ElementParser, it seems that WML isn't close enough to XML as I'd hoped..
What is the data going to be used for? If you want to be able to display a web page on the iPhone you might want to try running an XSLT over the WML to produce standard HTML that can be displayed easily (assuming your WML is valid XML).
The best library for doing this would probably be libxslt as the native iPhone libraries seem to be lacking in this area.

.epub on iPhone

Seeking your help to get off .epub(s) sea in iPhone world...
I am trying to make an iPhone application which can read .epub(s). So, I'm in search of a good method, API, Webservices, etc. which help me to render .epub(s) on iPhone's screen. Please let me know once you got any information about .epub(s) on iPhone.
=> My application would be like, Stanza/Calibri, which can read .epub(s).
Thanking You...
Paresh Thakor
EPUB is just XHTML stored in a zipfile with an XML manifest. Get a zip library and you can use a WebView to display the actual content.