We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was using epub package just to see how it works. I read an epub book with EpubBook epubBook = await EpubReader.readBook(bytes);
EpubBook epubBook = await EpubReader.readBook(bytes);
then i saved it without any changes then I read it again
var written = EpubWriter.writeBook(epubBook); var newBook = await EpubReader.readBook(written);
I got "EPUB parsing error: root file not found in archive." exception. I investigated for a while and I found:
I think the following quick patch of EpubWriter can help and, perhaps, it's possible to apply an even better one.
static Archive _createArchive(EpubBook book) { var arch = Archive(); final StringBuffer buffer = StringBuffer('<?xml version="1.0"?><container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"><rootfiles><rootfile full-path=') ..write('"') ..write(book.Schema.ContentDirectoryPath) ..write(book.Schema.ContentDirectoryPath.isEmpty ? 'content.opf' : '/content.opf' ) ..write('"') ..write(' media-type="application/oebps-package+xml"/></rootfiles></container>'); final String _container_file = buffer.toString(); // Add simple metadata arch.addFile(ArchiveFile.noCompress( "metadata", 20, convert.utf8.encode("application/epub+zip"))); // Add Container file arch.addFile(ArchiveFile("META-INF/container.xml", _container_file.length, convert.utf8.encode(_container_file))); ...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I was using epub package just to see how it works. I read an epub book with
EpubBook epubBook = await EpubReader.readBook(bytes);
then i saved it without any changes then I read it again
var written = EpubWriter.writeBook(epubBook); var newBook = await EpubReader.readBook(written);
I got "EPUB parsing error: root file not found in archive." exception.
I investigated for a while and I found:
I think the following quick patch of EpubWriter can help and, perhaps, it's possible to apply an even better one.
The text was updated successfully, but these errors were encountered: