GithubHelp home page GithubHelp logo

readium / readium-sdk Goto Github PK

View Code? Open in Web Editor NEW
382.0 80.0 164.0 134.48 MB

A C++ ePub renderer SDK

License: BSD 3-Clause "New" or "Revised" License

Go 0.05% JavaScript 0.14% Shell 0.02% Makefile 0.20% C++ 36.78% C 59.25% Java 0.65% Objective-C 2.31% Objective-C++ 0.32% C# 0.01% HTML 0.02% CSS 0.14% Python 0.04% Assembly 0.05% DTrace 0.01%
epub c-plus-plus

readium-sdk's Introduction

Readium SDK

Copyright (c) 2012–2014 The Readium Foundation and contributors.

Release Notes

Version 0.14 includes support for building a shared or static library for Android devices using the Android NDK r8e. See the Platform Support section for more information.

About

The Readium SDK is an ePub reader SDK of similar scope and capability to Adobe's Reader Mobile SDK (RMSDK). As such, it is designed to implement an ePub3- compliant Reading System, although its initial form will concentrate solely on the core ePub3 specification and fixed-layout metadata, expanding later to cover associated standards such as Page Templates.

The project's aim is to develop a productized, high-performance, cross-platform rendering engine for EPUB 3 content, optimized for use in native applications (mobile/tablet and secondarily desktop systems). Simplistic test applications for Android, iOS, OS X and Windows are part of the SDK, along with unit tests. The SDK is designed to be extensible in various areas, including in support for pluggable encryption and digital signature modules which might be used to implement a form of DRM.

Licensing info

Licensing information can be found in the file license.txt in the root of the repo, as well as in the source code itself.

Platform Support

At present, the project compiles for OS X and iOS using the version of Clang in Xcode 4.6 and the LLVM C++ standard library, libc++.

On Android, the project is build using GCC 4.7 and release 8e of the Android NDK. See Platform/Android/README.markdown for more information.

Build support for Windows using Visual Studio 2012 is due in release 0.5.

Headers And Libraries

The SDK is built into a single library on all platforms. Headers are placed into an include folder by the build process for each platform, located within the appropriate Platform subfolder. For instance, OS X and iOS headers are within Platform/Apple/include, Windows headers are within Platform/Windows/include.

This folder is designed to be passed directly to the compiler using the -I argument or similar.

Architecture

The SDK consists of three major components, corresponding roughly to Model, View, and Controller. The majority of the ePub3 data handling takes place inside the Model component, which provides parsing and generation of ePub-related data structures. The View component is a browser engine; this engine may be a customized form of WebKit developed as part of this project, but any CSS3-compliant browser engine may be used. The Controller component is a small interface between the data and renderer components; this part is ultimately what Reading System vendors will extend to create their own reading system.

The project is written in cross-platform C++ and JavaScript code, and is designed to be combined with platform-specific glue code and a modern browser rendering engine to instantiate an ePub3-compliant rendering engine within a platform-native Reading System application. The SDK constitutes a capable, high-performance ePub engine, not an overall application (other than per platform test applications).

The general architecture is that the browser engine (headlessly) handles content rendering with some features like pagination being implemented in Readium SDK JavaScript code that has been “injected” into the browser context. The C++ code handles tasks/features that can’t be efficiently performed in JS, such as incrementally fetching (and, as necessary, decrypting/de-obfuscating) resources from an .epub ZIP package. Certain UX affordances are supported within the browser context (e.g. text highlighting) but application-level UX affordances would generally be done in the reading system application via platform-specific code (e.g. Java on Android, Obj-C on iOS). Integration glue is provided in the Readium SDK to facilitate this, and usage illustrated by the test applications (which however are not product-level reading systems). Handling of XML Encryption and Digital Signature files is provided to simplify implementation of DRM or content protection/validation that is compatible with the ePub3 specification.

The Readium SDK is designed to potentially work with multiple browser engines but the #1 priority for initial development is WebKit, including platform-bundled instantiations (e.g. via UIWebView on iOS). #2 priority browser engine will be Trident/IE10 (needed for apps to be able to support screen readers on Windows).

Build status

Android

  • master - Build Status
  • develop - Build Status

iOS

  • master - Build Status
  • develop - Build Status

Mac OS X

  • master - Build Status
  • develop - Build Status

Windows 32

  • master - Build Status
  • develop - Build Status

Windows 64

  • master - Build Status
  • develop - Build Status

WinRT 32

  • master - Build Status
  • develop - Build Status

WinRT 64

  • master - Build Status
  • develop - Build Status

WinRT ARM

  • master - Build Status
  • develop - Build Status

readium-sdk's People

Contributors

aiqon avatar alanquatermain avatar anfengde avatar bluefirepatrick avatar bormind avatar clebeaupin avatar cosch-txtr avatar danielweck avatar datalogics-bhaugen avatar eikemeier avatar hsleedrminside avatar jccr avatar jmgeffroy avatar llemeurfr avatar marcuswu avatar matwood avatar mickael-menu-mantano avatar nleme avatar ofladda avatar olivierkorner avatar ph0b avatar prcolaco avatar rkwright avatar yteitel avatar yuch1001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

readium-sdk's Issues

Media Overlays, some MP3 encoding settings seem to corrupt playback

(Transferred from Bugzilla, #13. Have not re-confirmed this but transferring it as it appears not to have been closed.)
I have found an edge-case whereby HTML5 audio on Mac OS X (QuickTime backend) plays the wrong MP3 clip range (i.e. what is audible is "in the future"), and reports incorrect position updates (i.e. audio.currentPosition values are in the past).

I am not sure if it is due to the MP3 encoding (VBR, Lame settings?), but it seems to happen pass a certain point in the MP3, like if there was some kind of misaligned "keyframe". It seems related to seeking, because this behaviour only occurs when forcing the playback to start at a given point: like when mouse-clicking on an arbitrary HTML element, rather than letting the audio play from the start.

I am able to consistently reproduce the exact same erroneous audio playback offset, regardless of the asset delivery mechanism in LauncherOSX ("hidden" temporary filesystem storage vs. local HTTP streaming server).

If you want to try yourselves, AChristmasCarolAudioBook.epub is linked from our list of sample/test books:
https://docs.google.com/document/d/1_4tsFq_4Xr-jVbqY3brkVXAL3_UJLQiZWl47SH-I0bM

Obviously, I cross-checked the SMIL synchronisation, and made sure to eliminate other potential factors.

Here is a typical log of clip Begin / End values:

SHOULD PLAY:
FROM
25.312

TO
28.681

AUDIO POSITIONS (sampled every 20ms):

25.312 (reported about 25x in row)

25.248
25.268
25.288
25.309
...

As you can see, the timestamp series above seems to "jump back in the past", and then continues progressing as normal.

See:

https://groups.google.com/forum/#!topic/readium-sdk-contrib/IVoHA4jmByM

Additional Comment by Daniel:
I am able to reproduce this behaviour consistently with SDKLauncher-Android as well.

ePub cover

Hi !

How I can get the cover file from my ePub ?
In my opf file, I have a meta with name "cover".

But in Package.java I don't see where I can get this meta and write a thumbnail for display the epub cover for choose in a list.

Thanks

Android - Compilation error

Hello,

I am having some problems compiling the Readium SDK for Android on Debian Wheezy.

First, I had errors about missing dependencies, caused by Linux case sensitivity (ePub3 is not epub3), but I managed to solve them easily with symlinks.

But now, I am still stuck with a new serie of errors:

./../../ePub3/utilities/CPUCacheUtils_arm.s:16: Error: junk at end of line, first unrecognized character is `\'
./../../ePub3/utilities/CPUCacheUtils_arm.s:27: Error: bad instruction `label(C_FN_NAME(epub_sys_cache_invalidate))'
./../../ePub3/utilities/CPUCacheUtils_arm.s:34: Error: bad instruction `label(C_FN_NAME(epub_sys_cache_flush))'

The stangest thing is that the last commit for this file states "Now builds on Android. Requires ARMv7.". But I use ARMv7, and it does not build.

Could you help me?

Thanks,
Éric

SDKLauncher-iOS not loading the ePUB pages

Hi,

I'm trying to test out Readium-SDK on iOS, however, SDKLauncher-iOS fails to load any of the samples' pages. No errors, no nothing.

I sort of traced the problem down to EPubViewController line 554. There's a condition there [url hasPrefix:s] which is never satisfied. The URL prefix is never epubobjc. I don't know if this is normal, but the web view is still hidden in -(void) webViewDidFinishLoad:(UIWebView *)webView (and the HTTPBody nil) so I suppose is not.

Compile failed for iOS

I try to compile develop branch on mac but this error returned:
MakeHeaders.sh : Platform/Apple/MakeHeaders.sh: /bin/zsh: bad interpreter: Operation not permitted. command bin/sh failed with exit code 126

readium-sdk (0.7 or 0.14 or any version) build warning

Hi, I'm Android Developer from korea.
i'm using this library, to make my "EPUB Reader".
so see guide doc, follow that.
(refer: https://docs.google.com/a/drminside.com/document/d/1DphaTO2fu7mQoBKalzyfphIlOB2Ncp7yHbIbbti92CE/edit#)

and i have a question.

In Android ver,
when i build sdk in mac(mavericks ver.10.9.4), then Boom! i have a warnings.
next is part of text when building:


[armeabi-v7a] Compile++ thumb: epub3 <= base.cpp
/Library/developer/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./jni/obj/local/armeabi-v7a/objs-debug/epub3/ePub3/xml/utilities/base.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -O0 -UNDEBUG -marm -fno-omit-frame-pointer -Iinclude -I./../../ePub3 -I./../../ePub3/utilities -I./../../ePub3/xml -I./../../ePub3/xml/tree -I./../../ePub3/xml/utilities -I./../../ePub3/xml/validation -I./../../ePub3/ePub -I./../../Platform/Android/jni -I./../../Platform/Android/jni/android -I./../../ePub3/ThirdParty/openssl-android/include -I./../../ePub3/ThirdParty/boost/include -I/Library/developer/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include -I/Library/developer/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I/Library/developer/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include/backward -I./../../ePub3/ThirdParty/icu4c/include -I./../../ePub3/ThirdParty/icu4c/include -I./../../ePub3/ThirdParty/icu4c/include -I./../../ePub3/ThirdParty/icu4c/include -I./../.. -DANDROID -std=gnu11 -include prefix.h -DBUILDING_EPUB3 -Wa,--noexecstack -Wformat -Werror=format-security -std=gnu++11 -include prefix.h -fpermissive -DBUILDING_EPUB3 -frtti -fexceptions -std=gnu++11 -include prefix.h -fpermissive -DBUILDING_EPUB3 -I/Library/developer/android-ndk-r9d/platforms/android-9/arch-arm/usr/include -c ./../../ePub3/xml/utilities/base.cpp -o ./jni/obj/local/armeabi-v7a/objs-debug/epub3/ePub3/xml/utilities/base.o
cc1plus: warning: command line option '-std=gnu11' is valid for C/ObjC but not for C++ [enabled by default]
In file included from include/ePub3/xml/document.h:24:0,
from ./../../ePub3/xml/utilities/base.cpp:22:
include/ePub3/xml/node.h:97:41: warning: declaration of 'std::shared_ptrePub3::xml::Namespace ePub3::xml::Node::Namespace() const' [-fpermissive]
std::shared_ptr Namespace() const;
^(on const)
In file included from include/ePub3/xml/node.h:25:0,
from include/ePub3/xml/document.h:24,
from ./../../ePub3/xml/utilities/base.cpp:22:
include/ePub3/xml/ns.h:47:7: warning: changes meaning of 'Namespace' from 'class ePub3::xml::Namespace' [-fpermissive]
class Namespace : public WrapperBase
^(on Namespace)
In file included from include/ePub3/xml/document.h:24:0,
from ./../../ePub3/xml/utilities/base.cpp:22:
include/ePub3/xml/node.h:149:40: warning: declaration of 'std::shared_ptrePub3::xml::Document ePub3::xml::Node::Document()' [-fpermissive]
std::shared_ptr Document();
^(on ')' )
In file included from include/ePub3/xml/node.h:25:0,
from include/ePub3/xml/document.h:24,
from ./../../ePub3/xml/utilities/base.cpp:22:
include/ePub3/xml/ns.h:34:7: warning: changes meaning of 'Document' from 'class ePub3::xml::Document' [-fpermissive]
class Document;
^(on Document)


not only this.
this is first of many warnings.

Almost about "const" word or class's name's meaning declaration

and about command line option "-std=gnu11"


[armeabi-v7a] Compile++ thumb: epub3 <= error_handler.cpp
/Library/developer/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./jni/obj/local/armeabi-v7a/objs-debug/epub3/ePub3/utilities/error_handler.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -O0 -UNDEBUG -marm -fno-omit-frame-pointer -Iinclude -I./../../ePub3 -I./../../ePub3/utilities -I./../../ePub3/xml -I./../../ePub3/xml/tree -I./../../ePub3/xml/utilities -I./../../ePub3/xml/validation -I./../../ePub3/ePub -I./../../Platform/Android/jni -I./../../Platform/Android/jni/android -I./../../ePub3/ThirdParty/openssl-android/include -I./../../ePub3/ThirdParty/boost/include -I/Library/developer/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include -I/Library/developer/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I/Library/developer/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include/backward -I./../../ePub3/ThirdParty/icu4c/include -I./../../ePub3/ThirdParty/icu4c/include -I./../../ePub3/ThirdParty/icu4c/include -I./../../ePub3/ThirdParty/icu4c/include -I./../.. -DANDROID -std=gnu11 -include prefix.h -DBUILDING_EPUB3 -Wa,--noexecstack -Wformat -Werror=format-security -std=gnu++11 -include prefix.h -fpermissive -DBUILDING_EPUB3 -frtti -fexceptions -std=gnu++11 -include prefix.h -fpermissive -DBUILDING_EPUB3 -I/Library/developer/android-ndk-r9d/platforms/android-9/arch-arm/usr/include -c ./../../ePub3/utilities/error_handler.cpp -o ./jni/obj/local/armeabi-v7a/objs-debug/epub3/ePub3/utilities/error_handler.o

cc1plus: warning: command line option '-std=gnu11' is valid for C/ObjC but not for C++ [enabled by default]


and unknown


(^ is all on end of text)
In file included from ./../../ePub3/utilities/error_handler.cpp:21:0:
./../../ePub3/utilities/error_handler.h:517:52: warning: 'visibility' attribute ignored [-Wattributes]
void DispatchError(const std::system_error& __err)
^
./../../ePub3/utilities/error_handler.h:523:50: warning: '__visibility
' attribute ignored [-Wattributes]
void DispatchError(const epub_spec_error& __err)
^
./../../ePub3/utilities/error_handler.h:530:62: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(int code, const std::error_category& __cat)
^
./../../ePub3/utilities/error_handler.h:536:88: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(int code, const std::error_category& __cat, const std::string& __msg)
^
./../../ePub3/utilities/error_handler.h:542:81: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(int code, const std::error_category& __cat, const char* __msg)
^
./../../ePub3/utilities/error_handler.h:548:34: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(std::errc code)
^
./../../ePub3/utilities/error_handler.h:554:60: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(std::errc code, const std::string& __msg)
^
./../../ePub3/utilities/error_handler.h:560:53: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(std::errc code, const char* __msg)
^
./../../ePub3/utilities/error_handler.h:566:34: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(EPUBError code)
^
./../../ePub3/utilities/error_handler.h:572:60: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(EPUBError code, const std::string& __msg)
^
./../../ePub3/utilities/error_handler.h:578:53: warning: '__visibility
' attribute ignored [-Wattributes]
void HandleError(EPUBError __code, const char* __msg)
^


next is maybe occur in file that using spine.h


In file included from ./../../ePub3/ePub/package.h:32:0,
from ./../../ePub3/ePub/container.cpp:21:
include/ePub3/spine.h:132:53: warning: declaration of 'std::shared_ptrePub3::ManifestItem ePub3::SpineItem::ManifestItem() const' [-fpermissive]
shared_ptr ManifestItem() const;
^(on const)
In file included from include/ePub3/epub3.h:33:0,
from ./../../ePub3/ePub/package.h:24,
from ./../../ePub3/ePub/container.cpp:21:
include/ePub3/Forward.h:38:21: warning: changes meaning of 'ManifestItem' from 'class ePub3::ManifestItem' [-fpermissive]
_EPUB_DECLARE_CLASS(ManifestItem);
^(on ManifestItem)
include/ePub3/Forward.h:30:7: note: in definition of macro '_EPUB_DECLARE_CLASS'
class name;
^(on name)
In file included from ./../../ePub3/ePub/container.cpp:21:0:
./../../ePub3/ePub/package.h:222:80: warning: declaration of 'std::shared_ptrePub3::NavigationTable ePub3::PackageBase::NavigationTable(const ePub3::string&) const' [-fpermissive]
shared_ptr NavigationTable(const string& type) const;
^(on const)
./../../ePub3/ePub/package.h:51:7: warning: changes meaning of 'NavigationTable' from 'class ePub3::NavigationTable' [-fpermissive]
class NavigationTable;
^(on NavigationTable)
In file included from ./../../ePub3/ePub/container.cpp:21:0:
./../../ePub3/ePub/package.h:315:115: warning: declaration of 'std::shared_ptrePub3::MediaOverlaysSmilModel ePub3::PackageBase::MediaOverlaysSmilModel() const' [-fpermissive]
std::shared_ptr MediaOverlaysSmilModel() const { return _mediaOverlays; }
^(on const)
In file included from ./../../ePub3/ePub/container.cpp:21:0:
./../../ePub3/ePub/package.h:56:7: warning: changes meaning of 'MediaOverlaysSmilModel' from 'class ePub3::MediaOverlaysSmilModel' [-fpermissive]
class MediaOverlaysSmilModel;
^(on MediaOverlaysSmilModel)
In file included from ./../../ePub3/ePub/container.cpp:21:0:
./../../ePub3/ePub/package.h:317:60: warning: declaration of 'std::shared_ptrePub3::Archive ePub3::PackageBase::Archive() const' [-fpermissive]
shared_ptr Archive() const { return _archive; }
^(on end of text)
In file included from include/ePub3/archive_xml.h:26:0,
from ./../../ePub3/ePub/package.h:36,
from ./../../ePub3/ePub/container.cpp:21:
include/ePub3/archive.h:52:7: warning: changes meaning of 'Archive' from 'class ePub3::Archive' [-fpermissive]
class Archive
^(on Archive)
In file included from include/ePub3/content_module.h:25:0,
from ./../../ePub3/ePub/container.h:29,
from ./../../ePub3/ePub/container.cpp:22:
include/ePub3/user_action.h:63:79: warning: declaration of 'virtual const ePub3::IRI& ePub3::UserAction::IRI() const' [-fpermissive]
const IRI& IRI() const _NOEXCEPT FINAL { return m_iri; }
^(on end of text)
In file included from include/ePub3/property.h:27:0,
from include/ePub3/property_holder.h:26,
from include/ePub3/spine.h:27,
from ./../../ePub3/ePub/package.h:32,
from ./../../ePub3/ePub/container.cpp:21:
include/ePub3/utilities/iri.h:43:7: warning: changes meaning of 'IRI' from 'class ePub3::IRI' [-fpermissive]
class IRI
^(on IRI)
In file included from include/ePub3/content_module.h:26:0,
from ./../../ePub3/ePub/container.h:29,
from ./../../ePub3/ePub/container.cpp:22:
include/ePub3/utilities/future.h:3529:1: warning: always_inline function might not be inlinable [-Wattributes]
____make_future_deferred_shared_state(_Fp&& __f)
^(on start of text)
include/ePub3/utilities/future.h:3537:1: warning: always_inline function might not be inlinable [-Wattributes]
____make_future_async_shared_state(_Fp&& __f)
^(on start of text)


and meaning change problem occur also Forward.h about "ManifestItem"


warnings

  1. changes meaning of [class Name] from [class full name (ex) ePub3::Archive))] [-fpermissive]
  2. 'visibility' attribute ignored [-Wattributes]
  3. declaration of [ex) std::shared_ptrePub3::xml::Namespace ePub3::xml::Node::Namespace() const] [-fpermissive]]

in result, be made libepub3.so file.
but i use that file in windows, eclipse.(also mac)
and then run in smart phone.
Reader read metadata but i can't see any texts or pics.
i have no idea what is problem.
warning occuring is normal? or am i change settings about something?

i wanna answer for this problem!
PLEASE ANSWER TO ME, PLEASE.

and when use sdk, shared-js, launcher, have to use same version? in this time, i use same version...

and what is this text?

Android NDK: WARNING:Android.mk:xml2: LOCAL_LDLIBS is always ignored for static libraries

is it ok?


and android debugging in logcat.

org.readium.sdk.android.launcher s3dReadConfigFile:75: Can't open file for reading

SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

Package.nativeReadStreamForRelativePath() : no archive found for path

'EPUB/lib/jquery-1.11.0.js'
'EPUB/lib/jquery,sizes.js'
'EPUB/lib/underscore.min.js'
'EPUB/lib/backbone.min.js'

etc...

Web Console

Uncaught ReferenceError: ReadiumSDK is not defined:22
Uncaught ReferenceError: $ is not defined:45
Uncaught ReferenceError: $ is not defined:1

and i can't see anything in app.

Compil readium SDK branch feature mo smil model

Hi,

I try compil this branch of readium SDK, but a get this error:

./../../Platform/Android/jni/epub3.cpp:261: error: undefined reference to 'onLoad_cacheJavaElements_ResourceInputStream'
./../../Platform/Android/jni/package.cpp:478: error: undefined reference to 'javaResourceInputStream_createResourceInputStream'
/home/tien/Src/Android/ndk/sources/cxx-stl/gnu-libstdc++/4.7/include/ext/new_allocator.h:110: error: undefined reference to 'ePub3::MediaOverlaysSmilModel::MediaOverlaysSmilModel(std::shared_ptrePub3::Package)'
./../../ePub3/ePub/package.cpp:750: error: undefined reference to 'ePub3::MediaOverlaysSmilModel::Initialize()'
collect2: error: ld returned 1 exit status

thanks for your reply,

Xcode compilation Error

Hi,

I'm trying to use readium for one my project.

I cloned the git repo using git clone --recursive https://github.com/readium/SDKLauncher-iOS.git as mentioned in the documentation.

I Choose SDKLauncher-iOS and iPhone or iPad emulator but build failed.

10 Errors

Shell script invocation error, mkdir error and missing files. I Check every files mentioned in the differents errors and every seems to be ok, files are in the project.

In link with binaries, LibEpub3-iOS.a is red.

I'm using XCode 5.1

Thanks for your help

Best regards.

Stephane

Errors when build readium sdk on Visual Studio 2012

Hi,

I'm facing an issue that cannot compile Readium SDK in VS 2012, it shows a lot of error like:
error C2143: syntax error : missing ',' before '...' (........\ePub3\ePub\archive.cpp) in integer_sequence.h

Is there anyone can make build SDK successfully?
How to config the environment?

Thanks so much.

Media Overlays, User Interface controls + user preferences

See:
https://groups.google.com/forum/#!msg/readium-sdk-contrib/qe3l3Cmb5DQ/jk8bF2-VPiwJ

  1. MO optionsUI (via the existing upper-right callout, or a supplementary one?)

1.1) Toggle button "touch-to-play" (on by default)
1.2) Volume slider 0-100% (full by default)
1.3) Rate slider 0-4x (1x by default)
1.4) Toggle button "skippability" (on by default)
1.5) Toggle button "escapability" (on by default)

All of the above must be wired to the existing preferences mechanism, but "doNotRefreshView" must be set to avoid resetting ongoing MO playback due to PAGE_LOAD events in the WebView. See this example:

{
"fontSize" : UINT,
"columnGap" : UINT,
"isSyntheticSpread" : BOOL,

"doNotUpdateView" : BOOL,

"mediaOverlaysEnableClick" : BOOL,

"mediaOverlaysVolume" : DOUBLE_0-100,
"mediaOverlaysRate" : DOUBLE_0-4

"mediaOverlaysSkipSkippables" : BOOL,
"mediaOverlaysSkippables" : STRING-COMMA-SEPARATED,

"mediaOverlaysEscapeEscapables" : BOOL,
"mediaOverlaysEscapables" : STRING-COMMA-SEPARATED,
}

  1. Navigation user interface (inside existing bottom navigation bar ?)

2.1) Play/Pause button (single button, two states)
JS ==> ReadiumSDK.reader.toggleMediaOverlay()

2.2) Previous / Next buttons (phrase-level navigation)
JS ==> ReadiumSDK.reader.nextMediaOverlay() ReadiumSDK.reader.previousMediaOverlay()

2.3) Escape button
JS ==> ReadiumSDK.reader.previousMediaOverlay()

I suggest we put a higher priority on #2, which mostly consists in executing single-line Javascript commands (shown above). Launcher-iOS also has to listen to the "is-MO-playing" WebView-emitted event, to refresh the play/pause button state. This event's payload consists in a small data set, and in Launcher-iOS we only care about the "isPlaying" field (unlike the OSX app which has a more sophisticated playback timeline scrubbing bar).

(Note: Transferred from Bugzilla, #10, 24 July 2014).

missing line in package.cpp

There is a missing line "env->DeleteLocalRef(media_overlay_id);" in a package.cpp file (Java_org_readium_sdk_android_Package_nativeGetSpineItems method).

31 errors during compilation on Visual Studio Express 2012 (11.0.60610.01 Update 3) for Windows Desktop

Hello,

Please find list of errors and warnings below:

Error 1 error C2039: 'function' : is not a member of 'std' (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 36 1 ePub3
Error 2 error C2143: syntax error : missing ';' before '<' (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 36 1 ePub3
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 36 1 ePub3
Error 4 error C2146: syntax error : missing ';' before identifier 'ErrorHandler' (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 46 1 ePub3
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 46 1 ePub3
Error 6 error C2146: syntax error : missing ')' before identifier 'fn' (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 51 1 ePub3
Error 7 error C2182: 'SetErrorHandler' : illegal use of type 'void' (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 51 1 ePub3
Error 8 error C2059: syntax error : ')' (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 51 1 ePub3
Error 9 error C2064: term does not evaluate to a function taking 1 arguments (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 402 1 ePub3
Error 10 error C2064: term does not evaluate to a function taking 1 arguments (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 408 1 ePub3
Error 11 error C2882: 'errc' : illegal use of namespace identifier in expression (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 431 1 ePub3
Error 12 error C1903: unable to recover from previous error(s); stopping compilation (........\ePub3\ePub\cfi.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 431 1 ePub3
Error 13 error C2039: 'function' : is not a member of 'std' (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 36 1 ePub3
Error 14 error C2143: syntax error : missing ';' before '<' (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 36 1 ePub3
Error 15 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 36 1 ePub3
Error 16 error C2146: syntax error : missing ';' before identifier 'ErrorHandler' (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 46 1 ePub3
Error 17 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 46 1 ePub3
Error 18 error C2146: syntax error : missing ')' before identifier 'fn' (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 51 1 ePub3
Error 19 error C2182: 'SetErrorHandler' : illegal use of type 'void' (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 51 1 ePub3
Error 20 error C2059: syntax error : ')' (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 51 1 ePub3
Error 21 error C2064: term does not evaluate to a function taking 1 arguments (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 402 1 ePub3
Error 22 error C2064: term does not evaluate to a function taking 1 arguments (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 408 1 ePub3
Error 23 error C2882: 'errc' : illegal use of namespace identifier in expression (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 431 1 ePub3
Error 24 error C1903: unable to recover from previous error(s); stopping compilation (........\ePub3\ePub\glossary.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 431 1 ePub3
Error 25 error C2882: 'errc' : illegal use of namespace identifier in expression (........\ePub3\ePub\archive_xml.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 431 1 ePub3
Error 26 error C1903: unable to recover from previous error(s); stopping compilation (........\ePub3\ePub\archive_xml.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 431 1 ePub3
Error 27 error C3861: 'THROW_LAST_ERROR': identifier not found desktop\readium-sdk-master\readium-sdk-master\epub3\epub\font_obfuscation.cpp 78 1 ePub3
Error 28 error C3861: 'THROW_LAST_ERROR': identifier not found desktop\readium-sdk-master\readium-sdk-master\epub3\epub\font_obfuscation.cpp 85 1 ePub3
Error 29 error C3861: 'THROW_WIN_ERROR': identifier not found desktop\readium-sdk-master\readium-sdk-master\epub3\epub\font_obfuscation.cpp 104 1 ePub3
Error 30 error C2882: 'errc' : illegal use of namespace identifier in expression (........\ePub3\ePub\package.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 431 1 ePub3
Error 31 error C1903: unable to recover from previous error(s); stopping compilation (........\ePub3\ePub\package.cpp) desktop\readium-sdk-master\readium-sdk-master\platform\windows\include\epub3\utilities\error_handler.h 431 1 ePub3
Warning 32 warning C4244: '=' : conversion from 'std::streamsize' to 'int', possible loss of data desktop\readium-sdk-master\readium-sdk-master\epub3\thirdparty\google-url\base\logging.cc 409 1 ePub3
Warning 33 warning C4244: 'argument' : conversion from 'std::streamsize' to 'unsigned int', possible loss of data desktop\readium-sdk-master\readium-sdk-master\epub3\thirdparty\google-url\base\logging.cc 495 1 ePub3
Warning 34 warning C4244: 'argument' : conversion from 'std::streamsize' to 'unsigned int', possible loss of data desktop\readium-sdk-master\readium-sdk-master\epub3\thirdparty\google-url\base\logging.cc 499 1 ePub3
Warning 35 warning C4101: 'mask' : unreferenced local variable desktop\readium-sdk-master\readium-sdk-master\epub3\thirdparty\libzip\zip_close.c 93 1 ePub3
Warning 36 warning C4018: '>' : signed/unsigned mismatch desktop\readium-sdk-master\readium-sdk-master\epub3\thirdparty\libzip\zip_source_filep.c 150 1 ePub3
Warning 37 warning C4018: '>' : signed/unsigned mismatch desktop\readium-sdk-master\readium-sdk-master\epub3\thirdparty\libzip\zip_source_zip.c 142 1 ePub3

Launcher-Android Can't view epub content

Hi,

I'm trying to test out Readium-SDK on Android, however, SDKLauncher-Android fails to load any of ePub.

I can see metadata, spin items list but when a choose one item the page is blank

a found this error:
Uncaught TypeError: undefined is not a function at file:///android_asset/readium-shared-js/js/views/reader_view.js:37

I'm under linux debian and use:
Launcher-Android branche Develop
Readium-SDK Develop
Readim-shared-js Develop

thanks for your work,

Tien Haï

Build error on Visual Studio 2013 for Windows

Hello,

I'm trying to use readium sdk for Windows(readium-sdk-master.zip),
but any build errors on VC2013 output below.
Could you tell me what kind of problem can be considered?

And,i would like to know zip version is supported now.
if it is not supported, which version we used?


-Error 1
c:\program files\microsoft visual studio 12.0\vc\include\xrefwrap(58): error C2064: term does not evaluate to a function taking 2 arguments (........\ePub3\ePub\container.cpp)
-Error 2
readium-sdk-master\epub3\epub\font_obfuscation.cpp(93): error C3861: 'THROW_LAST_ERROR': identifier not found
-Error 3
readium-sdk-master\epub3\thirdparty\google-url\base\logging.cc(337): error C2084: function 'logging::LogMessage::LogMessage(const char *,int,logging::LogSeverity,int)' already has a body
-Error 4
readium-sdk-master\epub3\thirdparty\google-url\base\logging.cc(452): error C2228: left of '.stream' must have class/struct/union

...

Best Regards,

epub3 with ".." in the toc item url crashes

try to open the following epub in launcher-windows
https://code.google.com/p/epub-samples/downloads/detail?name=page-blanche-20130322.epub&can=2&q=

it causes crash. The issue is in readium-sdk/ePub3/utilities/path_help.cpp in CleanupPath() function.
Here is a patch which fixes the issue. Please review and submit the change.

==== readium-sdk/ePub3/utilities/path_help.cpp
35c35
<   for (auto pos = begin; pos < end; ++pos)

---
>   for (auto pos = begin; pos < end;)
52c52
<           components.erase(parent, dotDot);

---
>           pos = components.erase(parent, ++dotDot);
54a55,56
>       else
>           ++pos;

Method for get cover from ePub for android

Hi,

I post last day one issue for ask how I can get the cover of ePub.
#66

I want use readium for read ePub, but for more user friendly I want display cover of ePub in a list.

I see in sdk, in package.cpp file the method "ManifestItemsWithProperties", but can't call from java side. I wrote the jni part for call this method.
In fact I don't call the native method in package.cpp, because I don't know instanciate some object need. I rewrite one.

Please, can you add this method or another better for get cover ?

In my project, In my file java, I open a ePub and get the cover

// Open ePub
Container container = EPub3.openBook(path);
// Get package
Package pckg = container.getDefaultPackage();

            // Get the cover
            String filename = "cover";
            String cache_dir = "Covers";
            File dir = new File(context.getExternalCacheDir(), cache_dir);
            if ( !dir.exists() )
                dir.mkdir();

            List<ManifestItem> items = pckg.GetManifestItemsWithProperties("cover-image");
            if ( !items.isEmpty() )
            {
                ManifestItem coverItm = items.get(0);

                String extension = "";
                if ( coverItm.getMediaType().equals("image/jpeg") )
                    extension = ".jpg";
                else if (coverItm.getMediaType().equals("image/png"))
                    extension = ".png";

                byte[] data = pckg.getContent(coverItm.getHref());

                FileOutputStream out;
                try {
                    out = new FileOutputStream(context.getExternalCacheDir()+"/"+cache_dir+"/"+filename+extension);
                    out.write(data);
                    out.close();

                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }      
            }

File readium-sdk/Platform/Android/src/org/readium/sdk/android/Package.java

public List<ManifestItem> GetManifestItemsWithProperties(String properties) {
    List<ManifestItem> lst = nativeGetManifestItemsWithProperties(__nativePtr, properties);
    return lst;
}

private native List<ManifestItem> nativeGetManifestItemsWithProperties(long nativePtr, String properties);

File readium-sdk/Platform/Android/jni/package.cpp I had this method

JNIEXPORT jobject JNICALL Java_org_readium_sdk_android_Package_nativeGetManifestItemsWithProperties
(JNIEnv* env, jobject thiz, jlong pckgPtr, jstring jProperties)
{
ePub3::ManifestTable manifest = PCKG(pckgPtr)->Manifest();
jobject manifestItemList = env->CallStaticObjectMethod(javaJavaObjectsFactoryClass,
createManifestItemList_ID);

char *properties = (char *) env->GetStringUTFChars(jProperties, NULL);
///LOGD("ManifestItem: property : %s", property);

for (auto i = manifest.begin(); i != manifest.end(); i++) {
    std::shared_ptr<ePub3::ManifestItem> item = i->second;

    if ( item->HasProperty(properties) ) {
        jni::StringUTF hr(env, (std::string&) item->Href().stl_str());
        jstring href = (jstring) hr; 
        jni::StringUTF mt(env, (std::string&) item->MediaType().stl_str());
        jstring mediaType = (jstring) mt;

        jobject manifestItem = env->CallStaticObjectMethod(javaJavaObjectsFactoryClass, createManifestItem_ID,
                href, mediaType);    

        env->CallStaticVoidMethod(javaJavaObjectsFactoryClass, addManifestItemToList_ID,
                manifestItemList, manifestItem);
        env->DeleteLocalRef(href);
        env->DeleteLocalRef(mediaType);
        env->DeleteLocalRef(manifestItem);
    }
}

return manifestItemList;

}

File readium-sdk/Platform/Android/jni/package.h I had this

JNIEXPORT jobject JNICALL Java_org_readium_sdk_android_Package_nativeGetManifestItemsWithProperties
(JNIEnv* env, jobject thiz, jlong pckgPtr, jstring jProperties);

Thanks, and hope help someone.

SDK Launcher- iOS: Web Audio Error

It seems web audio API is supported based on tone played by this epub after speaking text:
https://dl.dropboxusercontent.com/u/39156804/synthesis.epub

However, on the below epub, which works on iBooks on IO7, when you click "sonify" on the SVG graphic on page 5 does not generate a tone via Readium:

https://dl.dropboxusercontent.com/u/39156804/graph.epub

Reported by Gerardo Capiel of Benetech

(This bug migrated from Bugzilla. Confirmed still not working on iOS, 24 July 2014).

Messed up paths (folder structure) causing compilation problem

Apart from Issue #31 (where the compilation terminates in Linux due to case insensitive naming) with the latest folder structure can also cause problems in other OS's.

For e.g. archive.h includes epub3.h with the path "ePub3/epub3.h" where as the file is actually at "ePub3/ePub/epub3.h". The same is true with many other files like content_module.h, Forward.h and many more.

Kindly suggest the last successfully compiled library for Android that have proper paths.

Epub with Smil on Readium Android

Hello,

I was pleased to see this week mo_smil_model branch merge in the Develop branch.

I wanted to test this function, I have a test EPUB3 with Smil that runs on the web version of readium. But that does not work on Android Readium.

Maybe my epub is not very good, do you have an ePub3 with Smil for testing ?
or this function is not yet fully implemented ?

Thank you for your answer and your work.

EPub books can not open

Whenever we tried to open old epub books from ios platform, book did not open, yes sample is working. We checked on Sigil. We did not find any problem. If we send book, can you check it?

PackageResourceServer error?

When i want to play a music(mp3) inside epub3 file, it does not play. and got a error like below.

The socket disconnected with an error! ErrorDomain=NSPOSIXErrorDomain Code=32 "The operation couldn't be completed. Broken pipe"

I think it is AsyncSocket Problem.
Because Try to download mp3 file then the problem occur.
at AsyncSocket@doSendBytes method... line 2770

But i can't sure this is the reason of that why the mp3 file can't play.

Any idea..

Generate platform headers

Hi,

In the latest version of readium i noticed the headers are no longer included, for example this directory no longer exists :

readium-sdk/Platform/Apple/include

I tried to run the MakeHeaders.sh script but it fails :

./MakeHeaders.sh Apple
./MakeHeaders.sh:27: no matches found: ePub3/ThirdParty/utf8-cpp/include/*
./MakeHeaders.sh:28: no matches found: ePub3/ThirdParty/google-url/base/*.h
./MakeHeaders.sh:29: no matches found: ePub3/ThirdParty/libzip/*.h
./MakeHeaders.sh:30: no matches found: ePub3/xml/**/*.h
./MakeHeaders.sh:31: no matches found: ePub3/utilities/*.h
./MakeHeaders.sh:32: no matches found: ePub3/*.h

Can you help ?

Thanks,
Vincent

Crash on EPUB with OTF obfuscated fonts

Hi,

The SDK crashes when opening epub with OTF obfuscated fonts such as this one :

https://code.google.com/p/epub-samples/downloads/detail?name=wasteland-otf-obf-20120118.epub

I tracked down the crash to EncryptionInfo.cpp:32

It throws an invalid_argument error "Node does not contain enc:EncryptionMethod with an Algorithm attribute".

The META-INF/encryption.xml seems valid and contains the algrotihm :

<enc:EncryptedData>
    <enc:EncryptionMethod Algorithm="http://ns.adobe.com/pdf/enc#RC"/>
    <enc:CipherData>
        <enc:CipherReference URI="OEBPS/fonts/jGaramond.ttf"/>
    </enc:CipherData>
</enc:EncryptedData>

Vincent

I just can't understand IRI, any expainations?

Hi guys,

I've studied Readium SDK's code for a while, and I still don't quite understand what IRI used for. I know that IRI is something like URN + URL.

It seems IRI is used in many places across the src. For example, in metadata.h(https://github.com/readium/readium-sdk/blob/master/ePub3/ePub/metadata.h), line 231 is as following:

@param owner The Package to which the metadata belongs; used for property IRI
resolution.
/
void AddExtension(xmlNodePtr node, const Package
owner);

why should metadata contain its package's reference? what does it mean here by "used for property IRI resoluation"?

Thx in advance :)

ePub3 nav.html

Hi,

On iOS,
When I'm trying to open a fixed layout ePub 3, I got a freeze.
Then this message appear in console :

text/nav.html:2: I/O warning : failed to load HTTP resource
UBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"

It seems that readium is trying to load the html DTD from the nav.html.
I can't intercept it in NSURLProtocol so I guess it's in C++.

Does readium support ePub 3 nav.html ?

Thanks.

Core is not handling file encodings other than UTF-8 correctly

(Transferred from Bugzilla, #17, 24 July 2014)

Daniel Weck 2014-07-13 15:42:41 CDT

Probably a related issue reported at Adobe's Digital Editions v4 beta, with Japanese HTML content (the WebView on OSX just displays the source code, it does not render the markup as expected)(works okay in ReadiumJS).

[reply] [-] Description Ric Wright 2013-11-22 10:54:11 CST

Reported by Takeshi Kanai of Sony

The files I used contain TOC files which are encoded in UTF-8 with BOM.
It was solved when I have changed the code to have the XML parser detect the encoding, but I'm not quite sure how the change effects to performance. Could you please look into it?

[target]ManifestItem::ReferencedDocument() in /epub3/epub/Components/manifest.cpp

Before)
if ( _mediaType == "text/html" )
result = reader->htmlReadDocument(path.c_str(), "utf-8", flags);
else
result = reader->xmlReadDocument(path.c_str(), "utf-8", flags);

After)
if ( _mediaType == "text/html" )
result = reader->htmlReadDocument(path.c_str(), nullptr, flags);
else
result = reader->xmlReadDocument(path.c_str(), nullptr, flags);

After that, just for my curiosity, I made some test files to verify how the SDK handles UTF-8, UTF-8 with bom and UTF-16 encoded files.
This URL is the repository of the test files.
https://github.com/tkanai/epub-testfiles/tree/master/encoding-check/epubfiles

Each file name consists of three identifiers.
test-fileencoding-[A]-[B]-[C]
[A] expresses container.xml file encoding
[B] expresses .opf file encoding
[C] expresses a navigation document encoding.

"8" is UTF-8, "8b" is UTF-8 with BOM and "16" is UTF-16.
Each epub contains 3 normal pages and TOC. The normal pages are encoded in above encodings.

It seems that the SDK can handle container.xml encoding correctly, but it can not render UTF-16 pages at all.
And when .opf contains BOM, I mean UTF-8 with BOM or UTF-16, it always fails.

Any instructions how to use SDK on Visual Studio?

Hi,

I'm working in a Project using Readium to read Epub3 e-books, I can make it work on Android & iOS but failed on Windows using Visual Studio 2012.

Please help to guide me through.

Thanks in advance.

Highlight does not work

Hi
I cloned develop branch and used highlight api in iOS SDK launcher,but nothing happens.
getCurrentSelectionCfi function returns null,addSelectionHighlight do nothing after select a text.
I used this code in a button click event:

    NSString *result = [m_webView stringByEvaluatingJavaScriptFromString:@"ReadiumSDK.reader.getCurrentSelectionCfi()"];
    NSLog(@"cfi=%@",result);
    [m_webView stringByEvaluatingJavaScriptFromString:@"ReadiumSDK.reader.addSelectionHighlight(124, \"highlight\")"];

Question about enforcement of dcterms:modified metadata element

Hi,

I'm taking a look at the code for Readium SDK, and I noticed the following piece of code in the file package.cpp, lines 539-540:

    if ( !foundModDate )
        HandleError(EPUBError::OPFMissingModificationDateMetadata);

Basically, what that does is to make mandatory that the OPF for a given ePub must have the "dcterms:modified" metadata element. Because of that, if a given ePub does not have that metadata element, the Readium SDK will not be able to open that ePub.

I'm not aware of the discussions around that definition on the spec, however, is that metadata element that critical? I think that maybe the standard could be more forgiving around this specific piece of data.

Error compil sdk for Android

Hi,

I try to compil readium-sdk branch develop but I have get this error:

In file included from ./../../ePub3/xml/utilities/io.cpp:22:0:
./../../ePub3/xml/utilities/io.h:35:7: warning: changes meaning of 'Document' from 'class ePub3::xml::Document' [-fpermissive]
./../../ePub3/xml/utilities/io.cpp: In member function 'virtual size_t ePub3::xml::StreamInputBuffer::size() const':
./../../ePub3/xml/utilities/io.cpp:110:37: error: 'end' is not a member of 'std::ios_base::seekdir {aka std::_Ios_Seekdir}'
./../../ePub3/xml/utilities/io.cpp: In member function 'virtual size_t ePub3::xml::StreamOutputBuffer::size() const':
./../../ePub3/xml/utilities/io.cpp:130:38: error: 'end' is not a member of 'std::ios_base::seekdir {aka std::_Ios_Seekdir}'
make: *** [/home/Devel/ReadiumDev/SDKLauncher-Android/readium-sdk/Platform/Android/obj/local/armeabi/objs/epub3/ePub3/xml/utilities/io.o] Error 1
make: Leaving directory `/home/Devel/ReadiumDev/SDKLauncher-Android/readium-sdk/Platform/Android'

Plateform : debian wheezy
cmd : ndk-compile.sh build ~/Android/ndk

Tien Haï

wondering?

  1. does anyone or any company use Readium SDK to develop ePub3 Reader system now?
  2. Is there any existing built lib under any platform?
  3. Readium SDK is MVC, I know M is under ePub3/ePub/ directory, and where is C and V?

help me

/Users/feetan/readium-sdk/ePub3/ThirdParty/google-url/base/logging.cc:43:12: 'crt_externs.h' file not found why?

how to build your library project ?

OK .
First ,i have clone you project and then i just run "ndk-build":
liupengs-MacBook-Pro:Android liupeng$ ndk-build
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk
/Users/liupeng/workLibrary/android-ndk/build/core/add-application.mk:133: *** Android NDK: Aborting... . Stop.
So i copy your Android.mk to Jni Folder ,and then change here path :LOCAL_PATH := $(call my-dir)/../..

and run "ndk-build " again.
But fail agin.:
liupengs-MacBook-Pro:Android liupeng$ ndk-build
Android NDK: WARNING: Unsupported source file extensions in jni/Android.mk for module epub3
Android NDK: ePub3/ThirdParty/google-url/base/string16.cc ePub3/ThirdParty/google-url/src/gurl.cc ePub3/ThirdParty/google-url/src/url_canon_etc.cc ePub3/ThirdParty/google-url/src/url_canon_filesystemurl.cc ePub3/ThirdParty/google-url/src/url_canon_fileurl.cc ePub3/ThirdParty/google-url/src/url_canon_host.cc ePub3/ThirdParty/google-url/src/url_canon_internal.cc ePub3/ThirdParty/google-url/src/url_canon_ip.cc ePub3/ThirdParty/google-url/src/url_canon_mailtourl.cc ePub3/ThirdParty/google-url/src/url_canon_path.cc ePub3/ThirdParty/google-url/src/url_canon_pathurl.cc ePub3/ThirdParty/google-url/src/url_canon_query.cc ePub3/ThirdParty/google-url/src/url_canon_relative.cc ePub3/ThirdParty/google-url/src/url_canon_stdurl.cc ePub3/ThirdParty/google-url/src/url_parse.cc ePub3/ThirdParty/google-url/src/url_parse_file.cc ePub3/ThirdParty/google-url/src/url_util.cc ePub3/ThirdParty/google-url/src/url_canon_cpp11.cc
Compile thumb : epub3 <= mkstemp.c
cc1: error: unrecognized command line option "-std=gnu11"
make: *** [obj/local/armeabi-v7a/objs/epub3/ePub3/ThirdParty/libzip/mkstemp.o] Error 1

So how to run it ?
Thanks.
(My ndk path:/Users/liupeng/workLibrary/android-ndk/ )

Memory Leaks ePub3::xml::Node

I'm using readium sdk in my ios app and when profiling instruments tells me that there are a lot of objects ePub3::xml::Node being retained.

I'm currently using the readium-sdk and i've also used the SDKLauncher-iOS as a base to use the objects. I've also profiled the SDKLauncher-app and having the same results.

I have shared on my google drive's account the instruments's trace file if that can help.

https://drive.google.com/file/d/0ByZoLe6w6184NU9JWF90bUFEd3M/edit?usp=sharing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.