Ereader-Style Pagination - objective-c

I am grabbing text data from XML files, and want it to display in book page-like format inside a UIWebView on iPad. The XML files are coming out of a .epub, and each one contains a single chapter of a book, divided up only by p tags.
I want to dynamically paginate these files into book-like pages based on the size of the UIWebView, which is a full iPad screen, as well as by user-selected font size. I am currently loading a blank html page with related css into a UIWebView, grabbing paragraphs based on number of characters as Strings from the XML, and printing these into the html using StringByEvaluatingJavaScriptFromString and the innerHTML property.
Obviously, doing this by number of characters creates improperly spaced, oddly formatted pages, but I'm not sure how else to "paginate" the text.
What I am looking to do is something akin to the app "eReader" on iPad:http://www.ereader.com/. They seem to be breaking a single file up into pages dynamically, and loading it into UIWebViews. How is this done?

Most EPUB readers that are based on UIWebView simply use CSS3 Columns to paginate the document.
You can see this in action at http://www.quirksmode.org/css/multicolumn.html
The basic idea is that you 'columnize' the document and then scroll horizontally through it to show a specific page.
Having done this for one popular (Canadian) eReader application on the iPhone and iPad, I can tell you that the technique works but that it is far from ideal.

The code is already made. It is called epubjs. It is Javascript only epub reader.

Use UITextView with PageviewController . (specify your doubts in it , if any )

Related

How to use html tables within tumblr posts

For a public blog we are currently using the default rich text editor.
This as content editors are no html writers.
Now on a certain post / custom page we want to add tabular data using a html table.
The rich text editor in tumblr has no support for creating tables so we switched to the html editor. There we created the table tag and some rows. Everything looks fine until saving the post. On saving the table element seems to be gone...
The Tumblr dashboard strips out many different HTML tags. They're visible in your theme, but on the dash they're either removed without a trace or replaced with a small clickthrough "embedded content" symbol.
If you NEED the table on the dash, you may need to use an image. Personally I'd include the Read More break to direct people into viewing the whole thing on your blog, but that won't work inside the app or slide-in bar, etc.

Embedd scrollable document faster than PDF possible?

I have a page of about 10 embedded PDF docs. My question is there another option that would use smaller file sizes or something so they don't bogg down the page when visited? Even convert PDF to something else if possible. Right now they are all in an accordion jquery and run with Scribd. Maybe something similar to this would work.:
scrolling text box
If you want the jqueryui to download different data for each tab you need to put an empty div inside each section and then set an on open (I am not familiar with jqueryui but maybe the activate event?) and create an ajax call to get the relevant pdf and save it to the empty div.
There are lots of questions about ajax in jqui accordion here here and here for example.

Adding Multiple web pages to UIWebview in a Page-Based app

I am working on making a paged app that will load a separate HTML page on each page. I am using the already given example that Apple has provided and rigged it to make the label dissapear and a few other things. Most tutorials I have seen do not cover this idea at all.
I need to be able to make an array of webpages and using one UIWebview display those pages, obviously one HTML file per page. What will be the most efficient way to do this that is up to date with iOS5 or is there a recent tutorial I can follow? Thanks.
Depending on how much data you have you could serialize the HTML data in a single file (such as a plist) or have them as separate files in a directory.
Based on the template you are using, you would
change the view in DataViewController to a UIWebView;
then override the viewControllerAtIndex method in your ModelController and pass the path to your HTML page as the data object;
and finally load the HTML in the viewWillAppear method of your DataViewController.
VoilĂ , here is your tutorial!

Link a Blog into scrolling text of SWF file

I'm working on an entirely flash-based site for a client who has already been using Blogspot for his News/Homepage updates. He wants to continue updating through Blogspot, but wants the blog to automatically fill in the text box on the flash site Homepage. I'm not sure if this is possible, or how I would go about doing it.
Here is the blogspot page:
http://atmarsamps.blogspot.com/
Here is an example of what the scrolling SWF text box will be like:
http://eloquentcreative.com/
Is this possible? Any help would be absolutely amazing!
You can use URLLoader to load the page as text. I'm not sure of the best way to parse it though.
Maybe you can try looking for the CSS tag that is being used for the text in question and then grabbing the text in between those tags? There might be better ways to do this though.
Note, you can update values to the htmlText property of a text box, which will allow Flex to maintain some of the styles specified from the loaded page.

How to tell image search which image matters?

Google image search seems to do a poor job on a site I run in identifying which image on a page should be indexed. In addition it doesn't seem to link that image with lots of the associated data.
Are there any ways of focusing attention for spiders on particular images and associated data, do they need to be within the same tags, or adjacent on the page?
A few tips:
Use a descriptive name, i.e. "tabby-cat.jpg" instead of "img02396.jpg".
Use alt tags on images.
Use descriptive text on the page and around the image.
Make sure the images are in the generated source, i.e. if you click "View source" in your browser, you see <img> tags.
It's also useful to validate your site at http://validator.w3.org in case there are major errors like missing brackets etc that could prevent a spider from parsing the page. (Note: I wouldn't worry about making everything 100% valid since Google is fine with invalid code)
Images in CSS (i.e. backgrounds) are not indexed AFAIK. However I'd suggest using CSS backgrounds for "design" images (a subtle way of getting Google to ignore site headers, custom borders, shadows, etc).
Nor are any images generated from Javascript.
Make sure you're not blocking images through robots.txt. I know that Joomla does this by default.
Sign up at Google Webmaster Tools, add your site, then allow it to be used in Google's "Image Labeller" game which should help tag images.
All images on a page should be indexed. If they aren't then improve your alt tags and possibly rename the image file. There really isn't anything more you can do since search-engines do not read any other context for the image itself except size. If google thinks the image is a duplicate it won't index it either.
Of course if images really do inherit context from the surrounding page then you could just use less images or move them into CSS.
I think Search robot can not read images as we do, so the simple and must thing you should do to your images is using descriptive names, so that spider could know what this image all about. Second one is using ALT tags on images, put in keywords relating to the images.
Those thing are what I do.