Unable to add EPUB in Zotero 7.0.5

There are some EPUBs in my library that I am unable to add to Zotero. I have tried all manner of things including:

- Dragging and dropping the EPUB onto the Zotero menu bar icon (nothing happens)
- Using "attach" to add the file to the entry in Zotero (the file is grayed out and cannot be attached)
- Dragging and dropping the EPUB onto the parent item in Zotero (nothing happens)

Some EPUBs seem to work fine, others do not. I was having this same issue in Zotero 6. The update didn't fix it.

Thanks for your tips!
  • Can you send an example file to support@zotero.org with a link to this thread?
  • edited September 23, 2024
    Are these EPUBs from Apple Books? See this thread. We're working on making Apple Books EPUBs usable in Zotero.
  • Thanks for both of your replies! Indeed, I was trying to attach an EPUB that had been modified by the Apple Books program. After re-downloading it from the publisher's website where I had purchased the book, I was able to add it to Zotero and read it within the app.

    What a shame about Apple Books though... I have many books in there that I would like to transfer over to Zotero (and never use Apple Books again!)
  • edited September 30, 2024
    For now, copy the Apple Books EPUBs you want to import into a folder (e.g. on your desktop), then paste and run this in Zotero's Tools -> Run JavaScript window:

    var { Subprocess } = ChromeUtils.import('resource://gre/modules/Subprocess.jsm');
    var { FilePicker } = ChromeUtils.importESModule('chrome://zotero/content/modules/filePicker.mjs');

    var fp = new FilePicker();
    fp.init(window, 'Select Directory Containing EPUBs', fp.modeGetFolder);
    fp.appendFilters(fp.filterAll);
    if (await fp.show() === fp.returnOK) {
    let dir = fp.file;
    await Subprocess.call({
    command: '/bin/bash',
    arguments: ['-c', `
    mkdir -p "Converted"
    find . -name '*.epub' -type d -maxdepth 1 |
    while read epub_package; do
    epub_file="$PWD/Converted/$epub_package"
    cd "$epub_package"
    [ -f "$epub_file" ] && continue
    zip -0 -X "$epub_file" mimetype
    zip -9 -X -r -u "$epub_file" *
    cd ..
    done
    `],
    workdir: dir
    });
    return "Success";
    }
    else {
    return "Cancelled";
    }


    When the Open dialog shows, select the folder you put the Apple Books EPUBs in. Fixed copies will appear in a new subfolder called Converted. You should be able to add them to your Zotero library.

    We'll support adding Apple Books EPUBs directly in the future.
Sign In or Register to comment.