React-pdf not working on iOS ( safari and chrome )

Viewed 825

I'm using React-pdf, which works fine on chrome, both on desktop and android devices but doesn't seem to work on iPhone ( both chrome and safari ) and mac safari. Can someone suggest a solution or any other lib that I could use?

Getting this on safari:

Error: The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. ReadableStream and/o…

import { Document, Page, pdfjs } from 'react-pdf/dist/esm/entry.webpack'

 <Document
    options={{
        cMapUrl: `//cdn.jsdelivr.net/npm/pdfjs-dist@${pdfjs.version}/cmaps/`,
        cMapPacked: true,
    }}
    file={url}
    onLoadSuccess={onDocumentLoadSuccess}
>
    <Page pageNumber={pageNumber} />
</Document>

enter image description here

0 Answers
Related