epub3 0.2.2 copy "epub3: ^0.2.2" to clipboard
epub3: ^0.2.2 copied to clipboard

Epub3 file Read and Write.

epub3(epub-rs 3.0) #

epub3 is an implement of epub-rs.

Support epub: 2.0, 2.0.1, 3.0, 3.0.1, 3.2, 3.3.

Reader and Writer with content are fully tested.

Example with dart:io #

import 'package:epub3/epub3_io.dart' as epub;

final book = epub.readFile('test/res/alice.epub')!;
print(book.version);  // Version.epub3
print(book.title);    // Alice's Adventures...
print(book.author);   // Lewis Carroll
print(book.chapters); // first level chapters

Example without dart:io #

import 'package:epub3/epub3.dart' as epub;
import 'package:archive/archive.dart';

final book = epub.Reader.
  open(ZipDecoder().
  decodeBytes(bytes_or_file_content)).
  read();

Example write a new epub file #

The new.epub file generated by this example passed epubcheck

import 'package:epub3/epub3_io.dart' as epub;

final book = epub.Book.create(
  title: 'dream world',
  author: 'joe doe',
);

book.add(
  epub.Chapter(title: 'Part 1', children: [
    epub.Chapter.content('Chapter 1', 'Content of Chapter 1'),
    epub.Chapter.content('Chapter 2', 'Content of Chapter 2'),
  ]),
);

epub.writeFile(book, 'new.epub');
3
likes
110
points
44
downloads

Publisher

unverified uploader

Weekly Downloads

Epub3 file Read and Write.

Repository (GitHub)

Topics

#epub #book

Documentation

API reference

License

MIT (license)

Dependencies

archive, collection, fpdart, image, path, quiver, uuid, xml

More

Packages that depend on epub3