gaoxiaoliangz / epub-parser

A powerful yet easy-to-use epub parser
149 stars 22 forks source link

sectionId are undefined in the structure array #19

Open bensamazingsoft opened 4 years ago

bensamazingsoft commented 4 years ago

I tried with several .epub from www.bibebook.com. The IDs are always undefined

image

the file I'm using for exemple:

http://www.bibebook.com/files/ebook/libre/V2/dumasalexandre-_le_docteur_mysterieux_i.epub

I'm using the library in a Vue component:

      <v-col>
          <v-file-input v-model="file" accept=".epub" label="File input"></v-file-input>
          <v-btn v-if="filePresent" @click="handleRead">Lire</v-btn>
        </v-col>

    ...
    private handleRead() {
    const reader = new FileReader();
    reader.onload = evt => {
      parseEpub(evt.target!.result as Buffer)
        .then((res: Epub) => this.setBook(res))
        .catch((err: Error) => window.alert(err.message));
    };
    reader.readAsArrayBuffer(this.file);
  }
  private setBook(b: Epub) {
    this.book = b;
    console.log(this.book);
  }
mbykov commented 4 years ago

Hi, I have the same problem, but with your own epub files like test/file1, etc.

just in plain npm v2.0.3:

structure: [ { name: '扉页', sectionId: undefined, nodeId: undefined, path: 'text/part0000.html', playOrder: '1', children: undefined },

RoyBkker commented 4 months ago

Same issue