Epub Reader dla Windows Phone

Od dłuższego czasu pracuję nad czytnikiem książek w formacie EPub dla Windows Phone. Niestety .NET to nie Java i ilość dostępnych komponentów nie jest taka duża jak u starszego brata.

Ponieważ nie znalazłem żadnego projektu open source czytnika postanowiłem sam go napisać co wynikało z zamówienia klienta. A sam open source ma pomóc w testowaniu komponentu i developerce.

Komponent dostępny jest na stronie projektu epubreaderwp.codeplex.com.

Cechy:

  • ustawienia: FontSize, FontFamily, LineHeight, Brightness
  • tryb nocny i dzienny
  • stan normalny (odczyt), widok spisu treści oraz okładki
  • dostęp do metadanych książki

Zrzuty ekranu:


25 thoughts on “Epub Reader dla Windows Phone”

  1. hamza says:

    can you detail more how i can implement your Library to display my epubbook from the isolated storage

  2. admin says:

    hamza: can you detail more how i can implement your Library to display my epubbook from the isolated storage

    Read stream from IsolatedStorageFile:

    IsolatedStorageFileStream isfs;
    using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
    {
    try
    {
    isfs = isf.OpenFile([Path to file], FileMode.Open);
    }
    catch
    {
    return;
    }
    }

    EPubViewer.Source = isfs;

  3. hamza says:

    hi another question please i try to read an epub book with your Library if it’is from Gutenberg which is a site of free ebooks it crashed and if it is from another site i can display it although there are build with same epub 2.0 it is illogical?

  4. Flaw says:

    Hej używam twojego czytnika od niedawna i odwaliłeś kawał porządnej roboty 🙂 ale jest jeden problem, jeśli wchodzę w zrobione przeze mnie opcje lub w jakś inną stronę i cofnę się to wszystko jest renderowane zupełnie inaczej niektóre elementy strony, tekst są ucinane :/, coś musi być nie tak z metodą Render, używam sourca z codplexa. Może znalazłeś już jakiś sposób żeby temu przeciwdziałać, byłbym wdzięczny za pomoc 🙂

  5. admin says:

    hamza: hi anotherquestion please i try to read an epub book with your Library if it?is from Gutenbergwhich is a site of free ebooks it crashed and if it is from another site i can display it although there are build withsame epub 2.0 it is illogical?

    Send me sample book to jakub.florczyk (at) gmail.com on which error occurs.

  6. Shehzad says:

    I don’t think this application supports Windows Phone 8 at the moment.
    How can we get to support this for Windows Phone 8?
    Or it already does support Windows Phone 8?

  7. admin says:

    Shehzad: I don?t think this application supports Windows Phone 8 at the moment.
    How can we get to support this for Windows Phone 8?
    Or it already does support Windows Phone 8?

    It should work on WP8, but I dont have phone and proper computer with vitrual machine to test it 🙁

  8. Kau Buon Vi Ai says:

    Hi all,
    Please help me to import library to my project ????
    i import EpubReader.dll –> program did not work
    What can i do ? Import all dll of library to my project ?

  9. Kau Buon Vi Ai says:

    Kau Buon Vi Ai: Hi admin,
    in example of admin, i did not find two properties CurrentPageNumber and PagesCount of epub reader. The beta version of epub on codeplex is latest version ???
    Please help to check this problem.

  10. admin says:

    Kau Buon Vi Ai: Hi all,
    Please help me to import library to my project ????
    i import EpubReader.dll ?> program did not work
    What can i do ? Import all dll of library to my project ?

    Add reference to EpubReader.dll; reset of required dll’s should add automaticly. On page in definitions add:
    xmlns:epubreader=”clr-namespace:EPubReader;assembly=EPubReader”
    and add control
    <epubreader:EPubViewer x:Name=”ePubViewer”/>
    from code add loading book
    ePubViewer.Source = [some code to load book from resource or stroage]

  11. admin says:

    Kau Buon Vi Ai: CurrentPageNumber

    Source on CodePlex is the latest. In last version CurrentPage and PagesCount is replaced by: CurrentLocation and FurthestLocation. Anyway control navigates by themself.

  12. Kau Buon Vi Ai says:

    Hi admin,
    I can add your library to my project. Thanks so much.
    But in example of u, i did not find two properties CurrentPageNumber and PagesCount of epub reader. The beta version of epub on codeplex is latest version ???
    i found example as below :
    // Simple navigation
    private void EPubViewer_Tap(object sender, GestureEventArgs e)
    {
    if (EPubViewer.State != EPubReader.State.Normal)
    return;

    if (e.GetPosition(EPubViewer).X 1)
    EPubViewer.CurrentPageNumber–;
    else if (e.GetPosition(EPubViewer).X >= 320 && EPubViewer.CurrentPageNumber < EPubViewer.PagesCount – 1)
    EPubViewer.CurrentPageNumber++;
    }

  13. Kau Buon Vi Ai says:

    Hi admin,
    Thanks so much, i found CurrentLocation and FurthestLocation.

  14. Kau Buon Vi Ai says:

    Hi admin,
    I can use CurrentLocation and FurthestLocation to navigate page on book.
    But i recognize that the problem : the speed of loading page follow table of content or tab to navigate page is too slow.
    I use LUMIA 520 (dual core 1ghz, ram 512) and build project on WP8.
    I use this code of u to navigate page.
    So what can i do to improve this speed ?

  15. Kau Buon Vi Ai says:

    I recognize more problem : the speed of loading page on my phone is slower than virtual machine 🙂 !

  16. Kau Buon Vi Ai says:

    admin:
    Source on CodePlex is the latest. In last version CurrentPage and PagesCount is replaced by: CurrentLocation and FurthestLocation. Anyway control navigates by themself.

    I want to navigate by myself, what can i do?
    And help me to explain problem when load page ?
    Thanks.

  17. xiaofan says:

    Hi,I saw your artical on codeplex and I have loaded your dll.
    But a exception occured .That is there is some chapter can’t show when go to that page, the perogram shut down.I don’t know why,can you give me some suggestion??Thank you so much.

  18. xiaofan says:

    It is on WP8 platform

  19. GDEVENDRAK says:

    Hello everyone,

    I integrated this reader to my project. It is working fine. & I want to load the file from SDCard instead of Isolated storage of device

    To open file from Isolated storage we have “`IsolatedStorageFileStream“`

    Right know I tried like this

    “`
    ExternalStorageDevice sdCard = (await ExternalStorage.GetExternalStorageDevicesAsync()).FirstOrDefault();

    // If the SD card is present, get the route from the SD card.
    if (sdCard != null)
    {
    ExternalStorageFile file = await sdCard.GetFileAsync(_sdFilePath);
    // _sdFilePath is string that having file path of file in SDCard

    // Create a stream for the route.
    Stream file = await file.OpenForReadAsync();

    // Read the route data.
    ePubView.Source = file;
    }
    “`

    Please give a suggestion regarding this..
    Thanks

  20. EngDev says:

    How to navigate through the book go to next and previous pages?

  21. EngDev says:

    EngDev: How to navigate through the book go to next and previous pages?

  22. Aishwarya Kumar says:

    Hi Jakub Florczyk,
    Great work !
    A few questions :
    1. This project does not compile for a windows phone 8 using wp8 sdk as it uses libraries like wintellect.sterling and ICSharpCode.SharpZLib.Phone. Have you written a version of this project which works for Windows phone 8 sdk?
    2. I briefly looked at the code and it looks like you are rendering the HTML in a TextBlock. Are you rendering it Run() inside TextBlock or something similar?

  23. admin says:

    1. Yeah, because almost all referenced libraries doesn’t support WP8.
    2. I’m converting HTML to TextBlock elements with proper formatting. So for example BR is new line, paragraph is double new line, ect.

  24. GDEVENDRAK says:

    Hi kubaf,

    I am using this EPub Reader & I am looking for displaying page numbers means current page number & total page number of Book.

    I described my post here [ https://epubreaderwp.codeplex.com/discussions/558216 ] in codeplex with code. Have a look & suggest me the possible way yo achieve this.

    Waiting for your reply.

Leave a Reply

Your email address will not be published. Required fields are marked *

five × five =

Partnerzy