How to Load .ePub content in UIWebview with pagination - iphone

I want to show all the contents from .ePub file to UIWebview with pagination(horizontal scrolling). For that i need to find out total content size that,each chapter contains, page size..
I'm not at all clear about how/where should i start. I don't know how to use stringByEvaluatingJavaScriptFromString to call the methods. Where should i write the function definition which is called using stringByEvaluatingJavaScriptFromString. Please anyone give me a step by step procedure for UIWebview pagination. There may be same question but i didn't get any clear explanation.
Explain me Step by step JQuery procedure
Thanks in Advance.

You can find good example of parsing and displaying ePub here. It does not use JQuery, only javascript.

Related

Parsing pdf to populate tableview

I am working on an app.The requirement is I need to populate the tableViewCells based on a pdf file.Like for example the headers of the table view will be a topic name from pdf and the contents will be the data inside the header.
I tried googling out but didn't find anything useful.Earlier I thought of parsing the pdf but this approach doesnot seems to be useful because i didn't find any pdf parser useful.
The last approach I thought is adding the contents in a plist file and parsing that plist,but i know this is not best way to do it.
So guys please suugest some better approach.
Thank you

How can I make a PDF document containing a table of data on iPhone?

I need a way of creating a table of data in landscape mode. This table should be in PDF form, is this possible on iPhone? If so please can someone advise on how to do it? If not, what are my other options?
I believe following link would definitely help you to create table using drawLine method in a loop. You can simply modify the drawLine method and implement to draw table for you. Also the code is very Handy to use with a very customizable methods for PDF creation.
http://www.ioslearner.com/generate-pdf-programmatically-iphoneipad/
For more help you can refer previous post.
create your table in UIWebView and then follow this link to make pdf from UIWebView
http://coderchrismills.wordpress.com/2011/06/25/making-a-pdf-from-a-uiwebview/
Easiest is using HTML. You can do all the text processing in objective-C and display the table in a simple UIWebView. This also gives you great control over how it is going to look.

The best way to create an "instruction view" for my app?

Im planning on adding a instructions view to my app. Whats the best way to do it? Load a PDF into a webview or..?
Please suggest anything I might find helpful.
I also want it to look good for the user, not to plain.
You might want to consider using a UIWebView to load content that resides on your web server. The downside is that the user needs network connectivity to see the instructions and you need to know your way around at least some web development. However, you'll be able to use HTML+CSS+Javascript to create interesting content and you'll be able to change/update/correct that content without going through the hassle of releasing the app again.
I've seen a few apps put screenshots into a scrollview with a paging control. I really like that design, and there are plenty of tutorials online that explain how to do this.
You can implement instruction view different ways:
1) Just put textview and make scroll. (very simple)
2) Design the HTML instruction, and load it to the webview. (medium in look vise)
3) Create attractive design for instruction pages and implement scroll view with pages. (very attractive)
Please review above point and let me know in case of query.
Thanks.
I would use a info button (the lowercase "i" button, can be accessed by inserting "Round Rect Button" and changing type to one of the "Info" buttons or in code you could init a button with type: "UIButtonTypeInfoDark" or "UIButtonTypeInfoLight") on your main or first view controller. Inside that view you could put an UITextView with editing OFF and that would contain all your instructions that the user could scroll through and get to quickly, easily, and intuitively

Link from an HTML file to a view

I have an HTML file that's loaded from a UIWebView. I'm looking to do the opposite - link from the HTML file to a different view controller. How would one go about doing this?
the html file is a local file within the app.
thanks for any help.
You can do this by adopting UIWebViewDelegate protocol and implement the webView:shouldStartLoadWithRequest:navigationType: method. Here you can capture all requests and selectively use them for your purpose.
Define links such as yourapp://yourviewcontroller/argument within the HTML page and parse them in the above mentioned delegate method and load the appropriate view controller.
try using three20 library
https://github.com/facebook/three20
there is a helpful class for this named TTStyledText which render html as well as custom links. just need to map the links with ur controller. Go through the samples in three20!
Sorry for the short answer, but there are a lot of parts to this. Check out this link.
http://forums.macrumors.com/showthread.php?t=463491
It looks like you might have to register the url with Apple. I know that for the maps application its able to do urls like map://... and I've seen other apps do it too, I just don't know the exact process.
Update: looks like this exampe from Apple should help.

iPhone Book Wrapper app, HTML pagination

i'm developing an app that will be just a wrapper for a certain book
the book is in HTML so, i want to make something like stanza,
i want to determine no. of pages given the Whole book HTML and to paginate that dynamically into views.
is there any built-in methods that can help me with that?
or
does anyone know any idea of how that can be done ?
If you only need to do this once: insert some javascript into the HTML to tell you the height of the document once it's done loading, e.g.:
alert(document.height);
and divide that by the height of your web view to get the number of pages.
You can use UIWebView to load the data, and leave the navigation/link code to paginate in the HTML.