epub.js | Enhanced eBooks in the browser | Media library
kandi X-RAY | epub.js Summary
kandi X-RAY | epub.js Summary
Epub.js is a JavaScript library for rendering ePub documents in the browser, across many devices. Epub.js provides an interface for common ebook functions (such as rendering, persistence and pagination) without the need to develop a dedicated application or plugin. Importantly, it has an incredibly permissive Free BSD license.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Start the experiment
- Make XML request
- Handle the response
- Replaces links with links .
- Define a new promise
- Index of an item in the sorted array .
- Returns the location of an item in an array .
- Creates a folder element .
- replace the page s base url
- queries an HTML element
epub.js Key Features
epub.js Examples and Code Snippets
Community Discussions
Trending Discussions on epub.js
QUESTION
I am building a web app where I try to display a epub reader in the page using Epub.js from futurepress. However, I could not get the reader show up even with the example book link. Could anyone tell me where I did wrong?
HTML:
...ANSWER
Answered 2020-Aug-10 at 11:21You need to add an additional option to ePub function
QUESTION
I'm using epub.js to render .epub books, but I cant set fonSize in some ebooks, it wont override existing classes with the font-size already set on the ebook;
I read the documentation and the issues.
Here is the source
...ANSWER
Answered 2020-Feb-29 at 15:56Solved with:
QUESTION
I'm using EPUB.js and Vue to render an Epub. I want to display the cover images of several epub books so users can click one to then see the whole book.
There's no documentation on how to do this, but there are several methods that indicate that this should be possible.
First off, there's Book.coverUrl() method.
Note that I'm setting an img
src
property equal to bookCoverSrc
in the Vue template. Setting this.bookCoverSrc
will automatically update the src
of the img
tag and cause an image to display (if the src
is valid / resolves).
ANSWER
Answered 2020-Jan-14 at 01:13The reason this was happening to me was because the functioning line of code in the coverUrl
function was commented out in the source library epub.js, and a non-functioning line of code was written instead.
So, I had to copy down the entire library, uncomment the good code and delete the bad. Now the function works as it should.
To do so, clone down the entire epub.js project. Copy over the dependencies in that project's package.json
to your own. Then, take the src
, lib
, and libs
folders and copy them somewhere into your project. Find a way to disable eslint
for the location you put these folders into because the project uses TAB
characters for spacing which caused my terminal to hang due to ESLINT exploding.
npm install
so you have your and epub.js
dependencies in your node_modules
.
Open book.js
. Uncomment line 661 which looks like
QUESTION
I want to register a right click listener on the page in epub.js
but don't know how to do it. There is also passEvents
method of rendition object but couldn't find any help on that either. This is my last try:
ANSWER
Answered 2018-Nov-18 at 10:09Based on what you asked and I hope I got it right, you want a contextmenu
event at the book itself, right?
If that's the case I used the following JS:
QUESTION
I want to create a responsive, mobile optimized reading experience similar to an epub/ebook reader, like the Kindle app, or iBooks, using dynamic html as the source.
Imagine a long article or blog post that requires a lot of vertical scrolling to read, especially on a small mobile device. What I would like to do is break the long page into multiple full-screen sections, allowing the user to use left/right navigation arrows and/or the swipe gesture to "page" through the article.
There are many JS libraries available that can create a "slide show" or "carrousel" of pre-defined slides (using divs or other container elements). But I want the text and html content to dynamically re-flow to fit any device viewport and still be readable... just like an epub/ebook user interface, like the Kindle app or iBooks. So, for the same article, there would be many more "pages" on a phone than there would be on a tablet or desktop viewport, and those "pages" would need to be dynamically created/adjusted if/when the viewport size changes (like switching from portrait to landscape on a mobile device).
Here is an example of a javascript .epub reader: epub.js
... notice the responsive behavior. When you resize your viewport, all the text re-flows to fit the available space, increasing or decreasing the total number of "pages". The problem is that epub.js requires an .epub file as its source.
What I want is the same user interface and functionality for an html page.
I have searched and searched for some kind of library that can do this out of the box, but haven't been able to find anything.
I realize that I could use a conversion script to convert my html page into an .epub file, and then use epub.js to render that file within the browser, but that seems very round-about and clunky. It would be so much better to mimic or simulate the .epub reader user experience with html as the direct source, rendering/mimicking a client side responsive ebook user experience.
Does anyone know if something like this already exists, or how I could go about building it myself?
The crucial functionality is the dynamic/responsive text-reflow. When the viewport dimensions are reduced, the text/content needs to reflow to the next "page" to avoid any need for vertical scrolling. I don't know how to do this efficiently. If I were to code it myself, I might use something like the jQuery Columnize plugin, setting all columns to width: 100vw; height: 100vh
, so that each column is like a "page", and then figuring out how to create a swipe UI between those "pages".
Any help is much appreciated!
...ANSWER
Answered 2018-Sep-05 at 19:12Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install epub.js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page