Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Table of Contents List for PDF LCP #245

Closed
Tenten18 opened this issue Sep 19, 2022 · 2 comments
Closed

Empty Table of Contents List for PDF LCP #245

Tenten18 opened this issue Sep 19, 2022 · 2 comments
Labels
feature request Something is missing

Comments

@Tenten18
Copy link

Bug Report

What happened?

We tried to open PDF (LCP) file both in our App(with Swift-toolkit integration) and Test app. We were able to successfully open it. However, we experienced an empty Table of Contents for pdf files.

mediaType : application/pdf+lcp
Extension: lcpdf
Sample PDF LCP
https://tuxedo-preprod-icdp.yondu.net/api/ebook/mobile/lcp/get-book-lcp/be7ec450-4617-4b53-bc92-d910951636ea/293
[passphrase: 293]

We tried to view the PDF with LCP in other Ebook Reader like Thorium and it can fetch the publication's table contents. However in the Test app and our app, we can't retrieve it. Hope you can assist us on how to fetch it thanks!

Expected behavior

We expected to view the table of contents list like the one we are using on .epub files.

How to reproduce?

Using Test App:

  1. Press the "+" button on the right navigation bar and select From a URL.
  2. Enter https://tuxedo-preprod-icdp.yondu.net/api/ebook/mobile/lcp/get-book-lcp/be7ec450-4617-4b53-bc92-d910951636ea/293
  3. Enter 293 as passphrase.
  4. Open Book
  5. View Table of Contents (from the Option Hamburger menu).

Result on Test App:
Screen Shot 2022-09-19 at 5 14 09 PM

Logs upon Opening PDF

Screen Shot 2022-09-19 at 5 01 55 PM

vs

Logs on .epub Files

Screen Shot 2022-09-19 at 6 28 59 PM

Environment

  • Readium version:
    Using Swift Package Manager:
    {
    "identity" : "swift-toolkit",
    "kind" : "remoteSourceControl",
    "location" : "https://github.com/readium/swift-toolkit.git",
    "state" : {
    "branch" : "main",
    "revision" : "2e0c647221612f923f9888851c848c88d14f7679"
    }
    }

Development environment

Testing device

  • iOS version: 15.5
  • Model (e.g. iPhone 11 Pro Max): iPhone 13 Pro Max
  • Is it an emulator? Yes

Tried it also on actual device. Problem also occurs.

Additional context

  • Are you willing to fix the problem and contribute a pull request? No
@mickael-menu mickael-menu added the feature request Something is missing label Sep 19, 2022
@mickael-menu
Copy link
Member

This is not supported right now, only the metadata taken from the manifest.json file inside the lcpdf are used.

We might implement a fallback on the LCP encrypted PDF in specific cases (blank manifest and only one PDF resource). This was not done because it required to open the PDF twice, in the Streamer and then in the Navigator. Now it should be easier to implement it with the CacheService.

I don't know if and when this will be implemented, as it's not a priority for the core maintainers right now. So unless a contributor step up, it might take a while.

@mickael-menu
Copy link
Member

Addressed in #480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Something is missing
Projects
None yet
Development

No branches or pull requests

2 participants