Comments (13)
BTW here is what I have loaded now but not sure what order the scripts should be in. I moved it all to the bottom of the file where I think it should be.
<script src="js/libs/jquery-1.9.0.min.js"></script>
<script src="js/libs/loader_filesystem.min.js"></script>
<script src="js/libs/inflate.min.js"></script>
<script src="js/libs/zip.min.js"></script>
<!-- Render -->
<script src="js/epub.min.js"></script>
<!-- Hooks -->
<script async src="js/hooks.min.js"></script>
<!-- Reader -->
<script src="js/reader.min.js"></script>
<!-- fileStorage -->
<script src="js/libs/fileStorage.min.js"></script>
<script>
"use strict";
document.onreadystatechange = function () {
if (document.readyState == "complete") {
EPUBJS.VERSION = "0.1.6";
EPUBJS.filePath = "js/";
fileStorage.filePath = EPUBJS.filePath + "libs/";
EPUBJSR.app.init("book/backbone_fundamentals.epub");
}
};
</script>
from epub.js.
Sorry for the lack of documentation... working on getting it setup.
The zip library is:
http://gildas-lormeau.github.io/zip.js/
I should warn you that compressed epubs are not yet working in Safari either.
In regards the "Uncaught ReferenceError", Grunt was creating the minified version of the zip.js library out of order, which is now update in the latest commit.
Also, I believe the EPUBJS.filePath should be:
EPUBJS.filePath = "js/libs/";
Finally you shouldn't need to include inflate.min.js, as it is loaded by the zip worker.
from epub.js.
No problem on the docs. I appreciate it. This got me a little farther along but now zip.min.js is trying to load libs/zip/inflate.js resulting in a 404. If I copy inflate.js into libs/zip it gets past that and then gives me a type error
TypeError {} epub.min.js:1
(anonymous function) epub.min.js:1
y epub.min.js:1
(anonymous function) epub.min.js:1
v.trigger epub.min.js:1
(anonymous function) epub.min.js:1
(anonymous function) epub.min.js:1
(anonymous function) epub.min.js:1
I should clarify I just copied the demo directory to myproject hoping to be able to use it and just swap out the mobi-dick for my .epub so not sure if that may be the problem. I should really spend some time with the un-built source to learn more how this works I guess :-)
from epub.js.
I find that epub.js looks for http://localhost/epubjs/inflate.js 404 (Not Found) for the file rather than the location of inflate.js I put in the html.
I also find the example http://fchasen.github.io/epub.js/examples/contained.html is not working.
from epub.js.
It took me a while to figure out that EPUBJS.filePath = "../build/libs/" need to be set for the right location of inflate.js.
from epub.js.
zip.js requires the path to inflate.js and deflate.js to be set like so zip.workerScriptsPath = '/libs/'
. See the zip.js docs
Epub.js does this in src/unarchiver.js which comes from EPUBJS.filePath
.
There are two changes I think we could make to make this less confusing:
- Rename
EPUBJS.filePath
toEPUBJS.libsPath
to make it more clear that this needs to be the libs directory - Find a way to parse the loaded scripts tags to find inflate.js and deflate.js and use this to set zip.workerScriptsPath, eliminating the need to use
EPUBJS.filePath
from epub.js.
Seems EPUBJS.cssPath can't use absolute path. EPUBJS.filePath also needs to be checked.
from epub.js.
Using JSZip mean we no longer need to include EPUBJS.filePath.
Only need to include the following now.
<script src="zip.min.js"></script>
from epub.js.
What's the advantage of JSZip?
from epub.js.
Glad you asked! I tried to update to the latest zip.js and ran into the issue you reported: gildas-lormeau/zip.js#115
JSZip is a little simpler to implement since it doesn't have to find a worker file, is under active development and heavily in use (at least by node libraries.)
from epub.js.
Which isn't to say that I'm opposed to switching back to zip.js at somepoint - it is a great library and has worked well with epubs so far. Moving between the two is a small tweak, but for the moment JSZIP simplifies fixing some of the zip related issues that have been coming up.
from epub.js.
I'm thinking that it may be better to keep epub.js as a simple epub parser lib and leave unzip, file storage, pagination and etc. to the application layer of the readers.
from epub.js.
Hi @fchasen,
I use JSZIP to zip my unzipped epub file. But the output is not valid epub. I have all files in the output epub but when I use epubcheck for validating my epub it gives me the following errors:
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/3904.png' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/backoffice.jpg' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/cvr-cm-berichten.jpg' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/icon-author.png' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/macro-after.jpg' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/macro-before.jpg' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/pdf-output.jpg' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/print-centric-wf.jpg' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/xml-centric-wf.jpg' could not be found.
ERROR(RSC-001): file.epub/file.epub(-1,-1): File 'OEBPS/image/xml-input.jpg' could not be found.
I have all of them in my book. Could you please help me with your thought?
Thanks in advance,
Hajar
from epub.js.
Related Issues (20)
- What happened to the official website? The content is very strange. HOT 2
- Continuous Manager inside an element that is scrolling that is not the viewport?
- Scripted Content SandBoxing issue, And CFI pages position
- Extracting the text per rendered section / block using epub js? HOT 32
- How do I add a paginated swipe animation?
- highlight not working post integrating with hammer.js for swiping HOT 1
- how to call images in css file? HOT 1
- about rendition.next(), rendition.prev()
- about InlineView
- Minified XML causes 'container.xml not found' HOT 4
- renderTo CSS selector instead of ID HOT 1
- [Bug] Blank page when resize happen during loading
- How to add any emoji on page ?
- How to add any emoji on page? HOT 2
- how to turn the page by wheel
- rapidly scroll up and down will cause error in continuous-scrolled example
- How do I get the text on this page when it is truncated
- fix error File not found in the epub and replace file addresses
- Generate total page locations HOT 2
- Highlight
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epub.js.