readium / web

🌐 Readium Web is a toolkit for building Web Readers that support ebooks, audiobooks and comics
https://readium.org/web
BSD 3-Clause "New" or "Revised" License
14 stars 0 forks source link

Support for PDF #6

Open HadrienGardeur opened 4 months ago

HadrienGardeur commented 4 months ago

PDF support is an important part of the Readium Mobile toolkit and something that we also want to replicate on the Web.

In Readium Mobile, this support is based on native support for PDF (PDFKit on iOS, iPadOS and macOS while Android uses PDFium) as well as PSPDFKit (only on Android for now and which requires a commercial license).

On the Web, there's no native support for PDF, which means that using a PDF library will be mandatory. Rather than re-inventing the wheel, Readium Web will integrate an existing project (such as PDF.js) and make sure that the navigator and all of its usual API (Preferences or Content Iterator API for example) behave as expected and consistently with the rest of the project.

This integration must support the ability to stream a PDF using byte ranges as long as the PDF is linearized in order to provide a decent UX for larger PDF files.

HadrienGardeur commented 4 months ago

I've created this issue in the Web repo but most of the work should be handled in the ts-toolkit.

There are very few reasons why a PDF should be parsed and streamed from the go-toolkit, aside from potentially encrypting/decrypting byte ranges on the fly.