Git Product home page Git Product logo

epubx.dart's People

Contributors

alexmeuer avatar devbrandonlong avatar hobleyd avatar hongyu-hg avatar jarontai avatar mostafaayesh avatar muhleder avatar orthros avatar paulswith avatar renggli avatar sergeshkurko avatar shadowjonathan avatar timekone avatar vadimbrik-dev avatar vblago avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

epubx.dart's Issues

make epub from scratch

Can you provide an example of creating epub from scratch?
I would like to generate epub from String content (web scraping or RSS).
But the only example seems to be an epub reader.

Problems reading certain epub files

Hi, first of all, nice work. However, I have been working with the package and I load an epub file (there are more with the same problem, this one is to view the problem), and the HtmlContent of some or all chapters get me a body with an empty div.

However, the content of each file is well parsed by the package with all the content, so there are a problem with the chapters, the list is no complete or is missing some notes or the whole content except the title.

I also used the epub_view package to verify the issue and the same happend, some chapters are missing by bad parsing of those.

Exception thrown reading certain epub files

This is different from #3. I have tested the file they linked and it does not throw an exception.

Describe the bug
The method ChapterReader.getChaptersImpl is throwing an exception because it can't find the key in the html map

I have identified the cause in ChapterReader.getChaptersImpl (line 34)

if (!bookRef.Content!.Html!.containsKey(contentFileName))

Where:
contentFileName is "../Text/Section00001.xhtml"
but the actual key in bookRef.Content!.Html! is "Text/Section00001.xhtml"

So it throws the exception

To Reproduce
Steps to reproduce the behavior:

  1. Open this epub
  2. See error thrown when trying to get chapters with the chapter reader (specifically with epub_view's EpubView widget)

Screenshots

Some pages may be missing in `epubBook.chapters`

In version 4.0.0 (and I think earlier as the same), some pages are missing.

Try with Sway.epub. I am comparing the view of epubx (with epub_view) and "book" (pre-installed on macosx). In epubx, Sway_copyright.html, Sway_toc.html, Sway_body_split_000.html and Sway_body_split_000.html are not showing up.

This seems to be because the .chapters are made from NCX, so items that are in Spine and not in NCX are missing.

In Spine, all xhtml files are defined.

  <spine toc="ncx">
    <itemref idref="ut8KdiaIv9Ka6BnbBwmGtD5"/> <!-- OEBPS/cover.xml -->
    <itemref idref="copyright"/> <!-- OEBPS/Sway_copyright.html -->
    <itemref idref="toc"/> <!-- OEBPS/Sway_toc.html -->
    <itemref idref="book5"/> <!-- OEBPS/Sway_body_split_000.html -->
    <itemref idref="book4"/> <!-- OEBPS/Sway_body_split_001.html -->
    <itemref idref="book3"/> <!-- OEBPS/Sway_body_split_002.html -->
    <itemref idref="book2"/> <!-- OEBPS/Sway_body_split_003.html -->
    <itemref idref="book1"/> <!-- OEBPS/Sway_body_split_004.html -->
  </spine>

However, in toc.ncx, only 3 navPoints are defined.

  <navMap>
    <navPoint class="titlepage" id="level1-titlepage" playOrder="1">
      <navLabel>
        <text>AUTHOR'S NOTE</text>
      </navLabel>
      <content src="OEBPS/Sway_body_split_002.html"/>
    </navPoint>
    <navPoint class="book" id="level1-book1" playOrder="2">
      <navLabel>
        <text>PART ONE</text>
      </navLabel>
      <content src="OEBPS/Sway_body_split_003.html"/>
      <navPoint class="chapter" id="level2-book1chap01" playOrder="3">
        <navLabel>
          <text>THE HOUSES, 1969</text>
        </navLabel>
        <content src="OEBPS/Sway_body_split_004.html"/>
      </navPoint>
    </navPoint>
  </navMap>

Currently, I believe that getting contents from chapters is dangerous due to the possibility of missing pages. Is there any solution to this problem?

epubx : .CoverImage doesn't seem to work

Describe the bug
As reported in the original pre-fork version, After EpubReader.readBook loads an epub, most epubs fail to return anything from (loadedBook).CoverImage

To Reproduce
loadedBook = (await rootBundle.load(bookPath)).buffer.asUint8List();
works fine
currentBook = EpubReader.readBook(loadedBook);
works fine
bookCoverImage= currentBook.CoverImage;
Always seems to return null

Expected behaviour
A returned image object containing data

Additional context
See Issues section of original package that this is a fork of.

https://github.com/PresKhaled/epubx

This version has been added some simple features to it, as follows: -

  • Added [EpubLanguageRelatedAttributes] to certain classes (EpubMetadataDescription, EpubMetadataPublisher, EpubMetadataRight) and will be filled during the processing of some meta items to support the xml:lang, and dir attributes.
    [PackageReader].readMetadata > result.MetaItems are now filled in before iterating over the children of [metadataNode].
  • Added support for the specification of ePub 3.0 for the element's creator and contributor.
  • Types of titles were collected instead of one title, to be processed in the application that uses the package.
    • To provide processing: Main, subtitle, short, collection, edition and expanded.
      Example of the process:
final epubx.EpubMetadataTitle primaryTitle = (titles.firstWhereOrNull(
      (epubx.EpubMetadataTitle? titleElement) {
        final epubx.EpubMetadataMeta? associatedMeta = _getMetaAssociatedWithTitle(
          metaItems: epubMetadata.MetaItems,
          titleElement: titleElement,
        );

        if (associatedMeta != null && associatedMeta.Scheme == null) {
          return (associatedMeta.Content == 'main');
        }

        return false;
      },
    ) ??
    titles.first);

final epubx.EpubMetadataTitle? subtitle = titles.firstWhereOrNull(
      (epubx.EpubMetadataTitle? titleElement) {
        final epubx.EpubMetadataMeta? associatedMeta = _getMetaAssociatedWithTitle(
          metaItems: epubMetadata.MetaItems,
          titleElement: titleElement,
        );

        if (associatedMeta != null && associatedMeta.Scheme == null) {
          return (associatedMeta.Content == 'subtitle');
        }

        return false;
      },
    );

static epubx.EpubMetadataMeta? _getMetaAssociatedWithTitle({
    required List<epubx.EpubMetadataMeta>? metaItems,
    required epubx.EpubMetadataTitle? titleElement,
  }) {
    return metaItems?.firstWhereOrNull(
      (meta) => (meta.Refines == '#${titleElement?.Id}' && (meta.Property == 'title-type')),
    );
  }

The data coming from the package can be transferred to classes and stored as it is in a database that accepts this matter.
I do not like to use Pull Requests permanently.

Export all files for use in code

Could you expose all the opf schema's? Currently, only a limited amount is exported and thus can be referenced in code.

For example: you export epub_metadata_creator.dart but not epub_metadata_identifier.dart

Is this on purpose? Looking forward to your reply.

Update Required!!!

The Plugin needs update because it depends on an old version of flutter that conflicts with another packages, thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.