readium / SDKLauncher-iOS

A small iOS application to serve as a launcher/testbed for the Readium SDK.
BSD 3-Clause "New" or "Revised" License
71 stars 47 forks source link

epub looks and work perfect in chrome plugins, does not work on IOS #37

Closed OmarCur closed 6 years ago

OmarCur commented 9 years ago

Hi there,

We are working and testing the Readium project. We are using the Chrome plugin to test an epub3.

This epub is exported from indesign cc2014 (latest build), it looks perfect in windows/chrome/readium plugin.

we have build our own app for iOs and there are a ton of issues, i hope you can explain and /or help us.

First of all if we leave the TOC generation on in Indesign the ePub crashes, if we switch it to TOC - filename it works.

Most fonts do not look correct on IOS, they do look correctly on the chrome plugin.

We have a Epub 3 file, full of interactive animations made in Adobe Edge, these animations need to go inside the Indesign document,

These animations work in the chrome plugin and in the Gitden IOS reader but do not in the readium IOS versions.

We really want to have a good reader for these complex epub files, please help or steer us in the right directions.

Thanks.

O. Curiere OCG Studios info@ocgstudios.com

danielweck commented 9 years ago

Hello @OmarCur (I am a Readium developer) Are you able to privately share an examplar EPUB, so we can investigate further? Regards, Daniel

OmarCur commented 9 years ago

Hi Daniel,

I can share all the files you need, these are both 8 mb files, can i mail them?

With kind regards / Met vriendelijke groet

Omar Curiëre OCG Studios

T ..31-[0]35 6946091

http://www.ocgstudios.com/ https://www.facebook.com/OCGStudios https://twitter.com/ocgstudios https://www.youtube.com/user/ocgstudios

Wilhelminaplantsoen 7B 1404 JA Bussum The Netherlands

On Mon, Nov 10, 2014 at 3:31 PM, danielweck notifications@github.com wrote:

Hello @OmarCur https://github.com/OmarCur (I am a Readium developer) Are you able to privately share an examplar EPUB, so we can investigate further? Regards, Daniel

— Reply to this email directly or view it on GitHub https://github.com/readium/SDKLauncher-iOS/issues/37#issuecomment-62391197 .

danielweck commented 9 years ago

@OmarCur daniel.weck@gmail.com Thank you :)

OmarCur commented 9 years ago

Hi Daniel,

A wetransfer is on it's way,

Please do not share these files with anyone,

Both files read perfectly in the Chrom plugins, both have issues in the IOS sdk version, the animations do not show anything.

The main problem with Indesign CC2014 and epub3 compatibility/readium is it's TOC generater. When switched on the IOS readium crashes, when switched to "Filename" it works but without a usable TOC.

Furthermore a lot of fonts do not work on IOS.

Epub validation does not work on Indesign CC2014 files, somehow they generate very crappy code. But we where very happy that we got it working on the Readium chrome plugin and where expecting the same result on the IOS version :(

Thanks for your time.

With kind regards / Met vriendelijke groet

Omar Curiëre OCG Studios

T ..31-[0]35 6946091

http://www.ocgstudios.com/ https://www.facebook.com/OCGStudios https://twitter.com/ocgstudios https://www.youtube.com/user/ocgstudios

Wilhelminaplantsoen 7B 1404 JA Bussum The Netherlands

On Mon, Nov 10, 2014 at 4:35 PM, danielweck notifications@github.com wrote:

@OmarCur https://github.com/OmarCur daniel.weck@gmail.com Thank you :)

— Reply to this email directly or view it on GitHub https://github.com/readium/SDKLauncher-iOS/issues/37#issuecomment-62401189 .

rkwright commented 9 years ago

Omar, Follow up. When you say iOS, where are you pulling it from. We are in the midst of some serious reconstruction since mid-year. At present, the master branch is not in very good shape (major push on now to fix that). You should be pulling from the develop branch instead.

Thanks Ric Wright Director of Engineering Readium Foundation

OmarCur commented 9 years ago

Hi Ric,

This is where we got the version from:

https://github.com/readium/SDKLauncher-iOS

With kind regards / Met vriendelijke groet

Omar Curiëre OCG Studios

T ..31-[0]35 6946091

http://www.ocgstudios.com/ https://www.facebook.com/OCGStudios https://twitter.com/ocgstudios https://www.youtube.com/user/ocgstudios

Wilhelminaplantsoen 7B 1404 JA Bussum The Netherlands

On Mon, Nov 10, 2014 at 5:05 PM, Ric Wright notifications@github.com wrote:

Omar, Follow up. When you say iOS, where are you pulling it from. We are in the midst of some serious reconstruction since mid-year. At present, the master branch is not in very good shape (major push on now to fix that). You should be pulling from the develop branch instead.

Thanks Ric Wright Director of Engineering Readium Foundation

— Reply to this email directly or view it on GitHub https://github.com/readium/SDKLauncher-iOS/issues/37#issuecomment-62406491 .

rkwright commented 9 years ago

Right, but if you simply did

git clone --recursive https://github.com/readium/SDKLauncher-iOS.git

You got what is in the master branch, which is woefully out of date. What you should do is

git clone --recursive https://github.com/readium/SDKLauncher-iOS.git -b develop

Which will get you what is in the current develop branch, which is far better. Normally, master is the right place to pull from, but that is NOT the case right now.

danielweck commented 9 years ago

@OmarCur thank you for privately sharing the 2x EPUBs.

I am using SDKLauncher-OSX for debugging, but SDKLauncher-iOS is implemented using similar principles, so my findings will apply to both applications.

First of all, there are validation errors in animations.epub (EPUB-Check 3.0.1):

ERROR: animations.epub/OEBPS/animations-1.xhtml(14,105): 'OEBPS/html/114/Assets/117-1.html': referenced resource missing in the package.

ERROR: animations.epub/OEBPS/animations-3.xhtml(14,140): 'OEBPS/html/117-1/<iframe src="index.html"></iframe>': referenced resource missing in the package.

WARNING: animations.epub/OEBPS/html/117-1/Assets/images/metaal-stemvork klein.png: Filename contains spaces. Consider changing filename such that URI escaping is not necessary

I am implementing a code fix to patch this particular edge case (so that instead of crashing, the application degrades gracefully), but please make sure that your EPUBs are valid.

I will report further, once I get pass this stage. Regards, Daniel

danielweck commented 9 years ago

Validation errors in Final Book-total-Physics-8.epub

(REMOVED, MESSAGE TOO LARGE)

OmarCur commented 9 years ago

Thanks Daniel,

I know there are errors but this is directly from indesign cc2014, which claims to export correct epub3 files. The source is very complex, i don't no where to start to fix these errors. I am pretty sure since CC2014 is really the first program to export fixed layout epub3's that you will encounter tons of these files in the near future.

Did you look at the files in the chrome plugins?, you colleague Ric send me towards a newer IOS SDK, we will try that too.

Thanks for your time.

With kind regards / Met vriendelijke groet

Omar Curiëre OCG Studios

T ..31-[0]35 6946091

http://www.ocgstudios.com/ https://www.facebook.com/OCGStudios https://twitter.com/ocgstudios https://www.youtube.com/user/ocgstudios

Wilhelminaplantsoen 7B 1404 JA Bussum The Netherlands

On Mon, Nov 10, 2014 at 9:46 PM, danielweck notifications@github.com wrote:

@OmarCur https://github.com/OmarCur thank you for privately sharing the 2x EPUBs.

I am using SDKLauncher-OSX for debugging, but SDKLauncher-iOS is implemented using similar principles, so my findings will apply to both applications.

First of all, there are validation errors (EPUB-Check 3.0.1):

ERROR: animations.epub/OEBPS/animations-1.xhtml(14,105): 'OEBPS/html/114/Assets/117-1.html': referenced resource missing in the package.

ERROR: animations.epub/OEBPS/animations-3.xhtml(14,140): 'OEBPS/html/117-1/': referenced resource missing in the package.

WARNING: animations.epub/OEBPS/html/117-1/Assets/images/metaal-stemvork klein.png: Filename contains spaces. Consider changing filename such that URI escaping is not necessary

I am implementing a code fix to patch this particular edge case (so that instead of crashing, the application degrades gracefully), but please make sure that your EPUBs are valid.

I will report further, once I get pass this stage. Regards, Daniel

— Reply to this email directly or view it on GitHub https://github.com/readium/SDKLauncher-iOS/issues/37#issuecomment-62452042 .

danielweck commented 9 years ago

@OmarCur I am afraid your sample EPUBs have serious validation problems, which may (in some cases) be handled more gracefully by pure-HTML/Javascript ReadiumJS, but the native C++ core ReadiumSDK is stricter and will not tolerate certain types of failures.

For example, note the missing closing meta element (XML is not well-formed):

115.html, iframe'd from animations-2.xhtml (generated by Adobe Edge?)

<!--Adobe Edge Runtime-->
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--Adobe Edge Runtime End-->

In the web browser, this error is ignored because the extension of the file is .html Simply rename to .xhtml and you will be able to see the XML parsing error!

In a native application's WebView browser component, XHTML is explicitly used as the mime-type (HTTP content type header), so the WebKit control itself does not tolerate XML errors.

OmarCur commented 9 years ago

Hi Daniel,

The files in the ePub document are direct imports from Adobe Edge *.AN files and imported in CC2014.

This is the advertised way to go from Adobe, i am not saying your are wrong and Adobe is right but there will be a ton of Interactive fixed layout publication coming out in the near future. Is there a way where by the SDK can have the same leniency as the JS version?

Adobes own ePub reader does not show the ePub files as correctly as your JS reader :)

With kind regards / Met vriendelijke groet

Omar Curiëre OCG Studios

T ..31-[0]35 6946091

http://www.ocgstudios.com/ https://www.facebook.com/OCGStudios https://twitter.com/ocgstudios https://www.youtube.com/user/ocgstudios

Wilhelminaplantsoen 7B 1404 JA Bussum The Netherlands

On Mon, Nov 10, 2014 at 10:03 PM, danielweck notifications@github.com wrote:

@OmarCur https://github.com/OmarCur I am afraid your sample EPUBs have serious validation problems, which may (in some cases) be handled more gracefully by pure-HTML/Javascript ReadiumJS, but the native C++ core ReadiumSDK is stricter and will not tolerate certain types of failures.

For example, note the missing closing meta element (XML is not well-formed):

115.html, iframe'd from animations-2.xhtml (generated by Adobe Edge?)

<meta http-equiv="X-UA-Compatible" content="IE=Edge">

In the web browser, this error is ignored because the extension of the file is .html Simply rename to .xhtml and you will be able to see the XML parsing error!

In a native application's WebView browser component, XHTML is explicitly used as the mime-type (HTTP content type header), so the WebKit control itself does not tolerate XML errors.

— Reply to this email directly or view it on GitHub https://github.com/readium/SDKLauncher-iOS/issues/37#issuecomment-62454606 .

danielweck commented 9 years ago

Now that I can open the "physics" EPUB in SDKLauncher-OSX (after patching the "missing resource file" issue), the pages seem to look fine. The font problems (here and there) are identical to when I open the HTML directly in the web browser, so this is not a Readium-related issue.

To my horror, I discovered that each word is absolutely-positioned using CSS pixel offsets, which is not great. But hey, as you say, it's how EPUB "support" is implemented in the authoring tool :)

I'll see what I can do about relaxing the XML constraints. I must be very careful because CSS selectors are namespace-aware (e.g. styling depending on epub:type attribute), and may be matched differently depending on the application/xml+html versus the text/html content type (HTTP mime type).

OmarCur commented 9 years ago

Yes, i know the file is horrible, is is a 10 year old quark express file converted to indesign, on each page there are tons of overrules sections. It took us ages to figure out a way to get it decent in Indesign and ePub,

The big problem is they have almost 1000 books they want to convert :(

The strange things is that in the JS version all the fonts look correct, which is very important. In all other readers it looks like the IOS version.

I have included a file that is generated in Indesign CC2014 (so no conversion) this one is much cleaner but this file has got a automatically generated TOC, this crashes the IOS SDK version but works fine in the JS version.

Any idea how we can fix the font issues.

Another horrible thing is that Indesign creates images for each graphical element, there are a lot of rectangles with a border and a background color. I presume this can be done by code. So the big epub file i send you contains almost 1500 images ?!?

I hope this file helps.

Thanks for your time and help

With kind regards / Met vriendelijke groet

Omar Curiëre OCG Studios

T ..31-[0]35 6946091

http://www.ocgstudios.com/ https://www.facebook.com/OCGStudios https://twitter.com/ocgstudios https://www.youtube.com/user/ocgstudios

Wilhelminaplantsoen 7B 1404 JA Bussum The Netherlands

On Mon, Nov 10, 2014 at 10:12 PM, danielweck notifications@github.com wrote:

Now that I can open the "physics" EPUB in SDKLauncher-OSX (after patching the "missing resource file" issue), the pages seem to look fine. The font problems (here and there) are identical to when I open the HTML directly in the web browser, so this is not a Readium-related issue.

To my horror, I discovered that each word is absolutely-positioned using CSS pixel offsets, which is not great. But hey, as you say, it's how EPUB "support" is implemented in the authoring tool :)

I'll see what I can do about relaxing the XML constraints. I must be very careful because CSS selectors are namespace-aware (e.g. styling depending on epub:type attribute), and may be matched differently depending on the application/xml+html versus the text/html content type (HTTP mime type).

— Reply to this email directly or view it on GitHub https://github.com/readium/SDKLauncher-iOS/issues/37#issuecomment-62455911 .

rkwright commented 9 years ago

To echo Daniel's concern, we must be very careful to balance the support for "normal" EPUBs vs. those that, while they may be legal (in the sense they meet the spec and pass EPUBCheck) are so inefficiently constructed that they render poorly, slowly or both. A file such as this may pass EPUBCheck but would almost certainly flunk any "EPUB Preflight" tool.

danielweck commented 9 years ago

Another kind of error I found in the "physics" EPUB (note the missing src image path):

<img src="image/" />

Could you please make a screenshot of a font that does not render correctly. I need a visual reference. Thanks!

OmarCur commented 9 years ago

Hi,

These are two screenshots, i hope they help.

Ric and you are right, to balance the support for "normal" EPUBS and other Epubs but since Adobe is the main tools for a lot of publishers for their content with a specific layout it will be something to think about.

The preflight tools of Indesign actually does not flunk this file, even better (or worse) the preview epub tool they have shows the file correctly. Their Adobe DIgitale Editons 4.0 epub tool does not BTW

Indesign has got a lot of tools to tweak the epub content but it is hidden between several menus and completely unusable as it contains to much technical stuff i am pretty sure no body (expect you guys) can understand.

Adobe targets their Indesign CC2014 program as the best Fixed Layout Epub3 tool available, only in the last update their DIgital Editons reader can read Indesgn cc2014 files.

Thanks

With kind regards / Met vriendelijke groet

Omar Curiëre OCG Studios

T ..31-[0]35 6946091

http://www.ocgstudios.com/ https://www.facebook.com/OCGStudios https://twitter.com/ocgstudios https://www.youtube.com/user/ocgstudios

Wilhelminaplantsoen 7B 1404 JA Bussum The Netherlands

On Tue, Nov 11, 2014 at 12:03 AM, danielweck notifications@github.com wrote:

Another kind of error I found in the "physics" EPUB (note the missing src image path):

Could you please make a screenshot of a font that does not render correctly. I need a visual reference. Thanks!

— Reply to this email directly or view it on GitHub https://github.com/readium/SDKLauncher-iOS/issues/37#issuecomment-62472632 .

danielweck commented 9 years ago

Fixes / workarounds (both your EPUBs now work fine in SDKLauncher-OSX, minus the missing files / resources):

1) XHTML / XML mimetype (HTTP content-type header) now fallback to HTML (text/html) when parser fails:

https://github.com/readium/SDKLauncher-OSX/commit/d945ddaf32f585e6a0cad29520f51140e4b62d65

Note: okay in OSX, not sure about iOS (performance hit?)

2) Graceful degradation when encountering percent-escape encoding discrepancies (e.g. lower vs. upper case, or OPF vs. HTML href/src syntax), and some other fixes related to handling of URL path encoding (e.g. libzip "sanitize" function)

https://github.com/readium/readium-sdk/commit/bc86c60e72d0b97ff3c626353f4c1e3dfe9356a0

I'll check iOS tomorrow (late night here). /Dan

OmarCur commented 9 years ago

Thank you. Goodnight

Op dinsdag 11 november 2014 heeft danielweck notifications@github.com het volgende geschreven:

Fixes / workarounds (both your EPUBs now work fine in SDKLauncher-OSX, minus the missing files / resources):

1) XHTML / XML mimetype (HTTP content-type header) now fallback to HTML (text/html) when parser fails:

readium/SDKLauncher-OSX@d945dda https://github.com/readium/SDKLauncher-OSX/commit/d945ddaf32f585e6a0cad29520f51140e4b62d65

Note: okay in OSX, not sure about iOS (performance hit?)

2) Graceful degradation when encountering percent-escape encoding discrepancies (e.g. lower vs. upper case, or OPF vs. HTML href/src syntax), and some other fixes related to handling of URL path encoding (e.g. libzip "sanitize" function)

readium/readium-sdk@bc86c60 https://github.com/readium/readium-sdk/commit/bc86c60e72d0b97ff3c626353f4c1e3dfe9356a0

I'll check iOS tomorrow (late night here). /Dan

— Reply to this email directly or view it on GitHub https://github.com/readium/SDKLauncher-iOS/issues/37#issuecomment-62477681 .

With kind regards / Met vriendelijke groet

Omar Curiëre OCG Studios

T ..31-[0]35 6946091

http://www.ocgstudios.com/ https://www.facebook.com/OCGStudios https://twitter.com/ocgstudios https://www.youtube.com/user/ocgstudios

Wilhelminaplantsoen 7B 1404 JA Bussum The Netherlands

danielweck commented 9 years ago

@OmarCur it looks like you are replying to the issue tracker discussion thread via your email client. I did not receive the EPUB that exemplifies the TOC problem, and I cannot see your screenshots. Feel free to send me an email. Cheers, Dan

danielweck commented 9 years ago

SDKLauncher iOS now updated to be in sync with OSX (as per my message, 3 steps above this one):

https://github.com/readium/readium-sdk/commit/1d6c35768c2a4da43109b79b6018591d733d79e1

Sptibo commented 6 years ago

Hi Daniel, I've cloned ReadiumSDKLauncher and test it in my device by importing .epub file. It is working. Now I want to integrate the launcher on my existing project. I used the carthage file for the implementation of the dependencies. There are R2Shared.framework and other frameworks. But in ReadiumSDKLauncher there are RDServices folder and Viewcontroller classes too. I do not know how to integrate this launcher on my existing project. Could you please tell me something about those sdks?

rkwright commented 6 years ago

@Sptibo Can you outline what you are ultimately trying to do? Are you trying to build a R1-SDK application or an R2-based application? Can you tell us what you are trying to achieve?

Sptibo commented 6 years ago

@rkwright I've downloaded R2-based dependencies. I have some kind of CCID of books got from URMS SDK and now want to read that book using Readium. Firstly I clone Readium sdk launcher, copy .epub file on device and open that with readium. Then I download readium sdk and include them in my existing project Please guide ma how do I use those sdks in my project in order to read books.

danielweck commented 6 years ago

This repository (SDKLauncher-iOS) demonstrates how to integrate readium-shared-js and readium-sdk which are Readium "1" projects. It seems you are trying to integrate Readium2 components, which is probably not going to work. There are "launcher" apps (aka "test apps") for each Readium2 target platform: iOS-Swift, Android-Kotlin, desktop-Electron/NodeJS (Linux, Windows, MacOS). You should focus your efforts on either R1 or R2, as the projects were never really intended for "hybrid" applications. My knowledge of URMS is only superficial. I think there are existing ReadiumSDK (Readium "1") integrations, perhaps @aferditamuriqi can provide some guidance? Readium2 apps are LCP-ready, and in principle other DRM schemes are supported too (although at this point in time I am not aware of any existing practical implementation). I hope this helps.

Sptibo commented 6 years ago

@danielweck I am trying to use r2-testapp-swift as a template and modify it. Is that a better way to do? Because I do not understand how to integrate and implement those sdks on existing project. Can you provide me a good documentation (with step wise description) to integrate r2 in my project. Or I have to pay you for support?

danielweck commented 6 years ago

Could you please file an issue at r2-testapp-swift, this would be more appropriate. Thanks!