Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot parse the generated epub #130

Open
zjamshidi opened this issue Mar 11, 2020 · 2 comments
Open

Cannot parse the generated epub #130

zjamshidi opened this issue Mar 11, 2020 · 2 comments

Comments

@zjamshidi
Copy link

I'm trying to generate an epub in my Android app and then show it using the FolioReader. Today I succeed to integrate the epublib library and generate my first epub. However, it could not be parsed by the reader!

FolioReader utilizes r2-streamer-kotlin to parse the epub file and it expects the opf file to have a package tag but in the genearted epub the contenet.opf tags has opf prefix. How can I remove the prefix?

@zjamshidi
Copy link
Author

Here is my code

            Book book = new Book();
            Metadata metadata = book.getMetadata();

            // Set the title
            metadata.addTitle("Epublib test book 1");

            // Add an Author
            metadata.addAuthor(new Author("Joe", "Tester"));

            // Set cover image
            book.setCoverImage(new Resource(context.getAssets().open("book1/cover.jpg"), "cover.jpg" ));

            // Add Chapter 1
            book.addSection("Introduction",
                    new Resource( context.getAssets().open("book1/chapter1.html"), "chapter1.html" ));

            // Add css file
            book.getResources().add(
                    new Resource( context.getAssets().open("book1/styles.css"), "styles.css" ));

// Create EpubWriter
            EpubWriter epubWriter = new EpubWriter();

@westernbuptboy
Copy link

Hi. I encountered the same issue, did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants