question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Pdf not working on iOS

See original GitHub issue

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. What is the solution for this?

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>

ITxLn

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
RishavGoswamicommented, Mar 22, 2021

Get same problem on ios and android chrome too. Update chrome make problem disapprear but we can not update on ios

I got it fixed by downgrading react-pdf from the latest to version 4.2.0.

0reactions
diegomuracommented, Mar 29, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

React PDF not rendering PDF in IOS 15.5 - Stack Overflow
A quick fix would be to change renderMode to svg which just renders the SVG. SVG takes a bit more time to load...
Read more >
react-pdf examples - CodeSandbox
Learn how to use react-pdf by viewing and forking react-pdf example apps on CodeSandbox.
Read more >
How to Build a PDF Viewer with React Native PDF | PDFTron
In this blog, we show how to build a PDF viewer in React Native with react-native-view-pdf to render PDFs on Android and WKWebView...
Read more >
React-pdf
Since a renderer simply implements how elements render into something, you still need to have React to make it work (and react-dom for...
Read more >
Open a PDF in React on the Web with react-pdf - PSPDFKit
However, at the time of writing, the latter is only used to create PDFs. react-pdf provides a React-based component API for opening PDF...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found