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

Load Complete callback doesn't happen due to case issue #875

Open
GaryGiebler opened this issue Oct 16, 2024 · 2 comments
Open

Load Complete callback doesn't happen due to case issue #875

GaryGiebler opened this issue Oct 16, 2024 · 2 comments

Comments

@GaryGiebler
Copy link

react-native 0.73.x

react-native-pdf version 6.7.5

What platform does your issue occur on? both

The load complete callback doesn't happen because the code is trying to match case using upper case letters while the actual case is lower case.

Here's the fixed code (line 291 in index.js):

if (res && res.respInfo && res.respInfo.headers && !res.respInfo.headers["content-encoding"] && !res.respInfo.headers["transfer-encoding"] && res.respInfo.headers["content-length"]) {
const expectedContentLength = res.respInfo.headers["content-length"];

@rajivchaulagain
Copy link

  <Pdf
          ref={pdfRef}
          trustAllCerts={false}
          source={{
            uri,
          }}
          onLoadProgress={(percent) => calculateLoadingProgress(percent)}
          style={{
            width,
            height,
          }}
          onPageSingleTap={(e, x, y) => handlePosition(e, x, y)}
          onLoadComplete={(numberOfPages, path, { height, width }) =>
            console.log(`height & width : ${height} ${width}`)
          }
        />

isn't these working?

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

No branches or pull requests

3 participants
@GaryGiebler @rajivchaulagain and others