wonday/react-native-pdf

Load Complete callback doesn't happen due to case issue

GaryGiebler opened this issue · 3 comments

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"];

  <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?