Hi,
I want to use epub format in Qt for symbian. Is epub format supported in S60 devices or Is there any option to read the contents of epub file using Qt?
Regards,
Balaji
Hi,
I want to use epub format in Qt for symbian. Is epub format supported in S60 devices or Is there any option to read the contents of epub file using Qt?
Regards,
Balaji
ePub is a free and open e-book format. In short: a bunch of XML/XHTML and media files packed in a zip archive.
Does Symbian/Qt support epub? Well, they do support zip files and as far as I can tell their content too, at least to the extent of having the APIs you need to process them (browse control, XML parser, image converters ...).
Funny enough a search for "Qt epub reader" returns as first result a Qt based OSS (GPL) project named Azardi. If the license terms are OK with you then I guess you have half of your answer, you just need to port the project to Symbian.
-- Lucian
Hi,
Thanks for your reply.
My doubt is I have a epub file and now I want to open it and read using Qt. I tried opening the file using QFile but it failed. Could you please tell me how I can do that. Or any guidance how I can do?
Regards,
Balaji
A file is a file, you can of course open it with QFile if that helps you in any way and read data from it. You can do it on Windows and Symbian just the same. Whether you can do something with the data you read, that's another question.
So, what's your problem with opening it? Does the API call give you any error? Which error? How does the code look like?
-- Lucian
The file is not opening. Goto the error state when i tried to open the fileSo, what's your problem with opening it? Does the API call give you any error? Which error? How does the code look like?
I want to read the epub format book and display the contents. Have any idea how to do that?Code:if (!file.open(QIODevice::ReadWrite)) { printf("File Not Opened\n"); return; }
Regards,
Balaji
Make sure you have the right path set.
As said above, the ePub file seems to be a zip file with the real content inside. So your first task is to extract the content to a temporary directory and then handle it according to your needs.
As said above as well, this has been done already with Qt for Windows, so if you don't plan to port that implementation you can still have a look to see how they did the basics and how you can do a better job than they did for mobile.
-- Lucian
zip file?
actually i got that file with the format *.epub directly
Here is my code how i did..
file is in the "images" folder inside my project and I added it in *.qrc file.Code:QString fileName = ":/images/SuperFreakonomics.epub"; if (!fileName.isEmpty()) { QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { QMessageBox::information(this, tr("Unable to open file"), file.errorString()); return; } QTextStream out(&file); QString epubFile = out.readAll(); }
My path is correct because error is not coming as "No such file or directory".. It displays "Unknown error"
Regards,
Balaji
Before planing to use any file you should understand its format. If my comments above were not enough to get you started then a Google search for "epub file format" should give you more useful tips.
Take your book file, rename it to SuperFreakonomics.epub.zip and then double click on it to see what happens.
-- Lucian
Fine. Now I understood what exactly the epub format is.. Thanks for your help.