I want to display Book Cover Image of epub file in my Reading table. In my iOS application I have added "Open In" support for epub files. So when i navigate to my book reading app I want to show book's cover image in shelf first and then want to load that book. Please help me to fetch Cover Image from epub book in ios app.
fetch Cover Image from epub in ios
You will have to unzip the ePub and parse the metadata.
- Parse
META-INF/container.xml
and find the .OPF file path. The .OPF file contains all that you need, a tag
meta
with namecover
that refers to a tagitem
, this is the image cover.You can copy this image to somewhere and delete the unzipped files.
PS: I am the creator of FolioReaderKit an ePub Reader and Parser written in Swift 2, this is where I get the book cover FREpubParser.swift. If you don't want to deal XML you can read the ePubs using it, it will also parse the metadata and exposes for you.
Thanks you ... I have followed your steps and it worked for me... Have you worked on epub3 reader? –
Liegeman
I'm starting the implementation of epub3 on FolioReaderKit. –
Pilau
@Kavya FYI I have implemented ePub 3 support. –
Pilau
Yeah, free and Open Source :) –
Pilau
Have you created any SDK for audio epub books? –
Liegeman
is this a rule that all epubs must follow? I see the following in an example
<meta name="cover" content="cover-image" />
will there always be this format?... i.e. there will always be an attribute content which will refer to the id
in the manifest? –
Cutup © 2022 - 2024 — McMap. All rights reserved.