Read Epub3 in ios app - iphone

I am learning on epub reader app. I have tried and parsed the epub 2. I found that it has a opf file which refer to toc.ncx file which is actually a xml file and I can parse it to get the content and html files. Than I can display it in UIWebView.
I tried with same approach to parse the epub 3 file. I got the .opf file and parse it but the problem is there is no .ncx file. It has toc.xhtml file. It is the index file what I needed but in xhtml format. I am not sure if all files have same format or not. If all epub3 has same format than I can created a custom HTML parser according to my requirement.
Is there any efficient epub3 reader sample available for ios? I found one here but it contains errors and there is nothing mentioned for configuring it.
Any help please.

I know of two iOS EPUB3 readers these are iBooks and Gitden reader.
EPUB3 must contain a navigation file based on HTML5
See: http://www.heliconbooks.com/article/epub3navdoc
You can simply display this file as standard HTML file, however notice that this file must contain semantic tags like
There may be more then one section in each TOC file.
This file is pointed to by the OPF file, in the manifest section there should be one and only one item with property="nav"

Related

Viewing .gfx file in iOS

Resonantly I had to work with .gfx file, but i haven't got much information about gfx file.
My question is:
What is a .gfx file formated file contains?
is that any kind of image file or video file.
Where can i get a .gfx sample file to test?
is there any framework that support .gfx in iOS SDK?
1)
According to Google, GFX is used as an extension for at least five different kinds of files. My first guess is that you're thinking of a 3D model/scene format, which might be used in some kinds of games.
2)
That last web page I referred to lists a sample .gfx file.
3)
And this answer depends on exactly which kind of file, out of the five different types of files listed on the eHow page, is the kind of file you want to work with.

How to read PDF file from right to left on iOS

I am working on a basic project that reads pdf files from a server and show them on the screen.
The issue is that i want to read that files from right to left as a page.
Like Massimo Cafaro say :
If you want to extract some content from a pdf file, then you may want to read the following:
Parsing PDF Content
from the Quartz 2D programming guide.
Basically, you will use a CGPDFScanner object to parse the contents, which works as follows. You register a few callbacks that will be automatically invoked by Quartz 2D upon encountering some pdf operators in the pdf stream. After this initial step, you then actually start parsing the pdf stream.
Taking a brief look at your code, it appears that you are not following the steps required to parse the pdf content of the page you get through CGPDFDocumentGetPage(). You need first to setup the callbacks using CGPDFOperatorTableCreate() and CGPDFOperatorTableSetCallback(), then you get the page, you need to create a content stream using that page (using CGPDFContentStreamCreateWithPage()) and then instantiate a CGPDFScanner through CGPDFScannerCreate() and actually start scanning through CGPDFScannerScan().
The "Parsing PDF Content" section of the document pointed out by the above URL gives you all of the information required to implement pdf parsing.
if you don't try anything you can start with this project link

How to read pdf table content data?

I have a requirement to read a pdf file having tabular format data only like in excel file. I need to extract the cell value of given pdf file.
Is it be anyhow possible using itext API. If you have something to share then please share it or any other solutions?
The PDF format is just a canvas where text and graphics are placed without any structure information. As such there aren't any iText-objects in a PDF file. In each page there will probably be a number of Strings, but you can't reconstruct a phrase or a paragraph using these strings. There are probably a number of lines drawn, but you can't retrieve a Table-object based on these lines.
In short: parsing the content of a PDF-file is NOT POSSIBLE with iText.
You can try this! This lets you read PDF pages.
I recently ran into this problem. I wasn't able to make it work with itext.
An alternate solution I found was to open a PDF document in Adobe and export it to xml. At least with my PDF's it preserved the table information and then I was able to programmatically work with the XML to generate tabular files like excel etc.
The other issue I ran into was that Adobe only lets you export one file at a time and I had lots of files. Luckily Adobe also has a merge function. I ended up merging all the files together and then exporting them as one big XML file and working with that file to generate what I needed.

How to parse epub file content after unzipping it

I am developing an Ebook for iPhone that loads ePUB file. I have unzipped the epub file. Now I want to view the content in the unzipped epub file. how would I proceed from here?
Have a read of the ePUB file format (from wikipedia - http://en.wikipedia.org/wiki/EPUB)
This points out the files that are the starting points of the book i.e. the container.xml file will tell you where the main opf files are etc.
ePub files include HTML files, have you tried viewing them in UIWebView, or creating a parser?
Please look at this thread Reading ePub format which describes detail steps(From Euan) and sample project (From Sreelal).

Generate PDF from html file on iPhone

In my iPhone application I'm generating an HTML file. I would like to convert that HTML file to a PDF file programatically. The PDF will then be attached to an email.
Does anyone know (have an example) how to convert the HTML file to a PDF?
maybe you should start from here: http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
I don't know if this is what your looking for it helped me because it's much easier to generate a prepared html doc then PDF for me. I found a library that does that here http://maniacdev.com/2013/09/ios-library-for-easy-pdf-creation-from-an-html-string-or-URL