×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    130

    epub format support using Qt for Symbian

    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

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: epub format support using Qt for Symbian

    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

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    130

    Re: epub format support using Qt for Symbian

    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

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: epub format support using Qt for Symbian

    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

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  5. #5
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    130

    Re: epub format support using Qt for Symbian

    So, what's your problem with opening it? Does the API call give you any error? Which error? How does the code look like?
    The file is not opening. Goto the error state when i tried to open the file

    Code:
    if (!file.open(QIODevice::ReadWrite))
    {
    printf("File Not Opened\n");
    return;
    }
    I want to read the epub format book and display the contents. Have any idea how to do that?

    Regards,
    Balaji

  6. #6
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: epub format support using Qt for Symbian

    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

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  7. #7
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    130

    Re: epub format support using Qt for Symbian

    zip file?

    actually i got that file with the format *.epub directly

    Here is my code how i did..
    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();
    }
    file is in the "images" folder inside my project and I added it in *.qrc file.

    My path is correct because error is not coming as "No such file or directory".. It displays "Unknown error"

    Regards,
    Balaji

  8. #8
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: epub format support using Qt for Symbian

    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

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  9. #9
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    130

    Re: epub format support using Qt for Symbian

    Fine. Now I understood what exactly the epub format is.. Thanks for your help.

Similar Threads

  1. Nokia 7650 support Bluetooth audo?
    By ovjo12 in forum Bluetooth Technology
    Replies: 5
    Last Post: 2003-07-17, 18:50
  2. what format support Nokia_Series_60_MIDP_SDK_Be ta_0_1
    By JElliot in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2002-11-21, 15:28
  3. What 2D vector format does MMS support?
    By dugla in forum General Messaging
    Replies: 1
    Last Post: 2002-07-08, 09:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×