Skip to content

PDF display broken on mobile platform #60

@ben-ryder

Description

@ben-ryder

Describe the bug
PDF display is broken on the mobile platform.
The file appears to be loading fine into the browser as a Uint8Array, but is then failing to display.

Line 85 - Msg: Uncaught (in promise) TypeError: this[#e].getOrInsertComputed is not a function

It appears fine on desktop platform. I'm unable to check web platform at the moment without a way to add files to OPFS.

Expected behaviour
PDF is displayed on mobile.

Additional context
I think this is the same issue as mozilla/pdf.js#20680.

As per their FAQs PDF.js targets the latest browser versions only, whereas I assume Capacitor and/or Android is using an older version of webview/chrome so fails.
I think I'll need to use a legacy version of the library/keep downgrading until I find the first version that works for mobile and fix to that version.

This may require explicitly deciding the supported Android versions for the project (15/16 only?) and further work if the PDF.js APIs are different between package versions, as the same application code then couldn't be shared between all platforms.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions