wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.6k stars 557 forks source link

Make onLoadProgress specify the size if it is known #890

Open trajano opened 1 day ago

trajano commented 1 day ago

What react-native version are you using?

"react": "18.2.0",
"react-native": "0.74.5"

What react-native-pdf version are you using?

"react-native-pdf": "^6.7.5",

What platform does your issue occur on? (android/ios/both)

Describe your issue as precisely as possible :

It would be nice to have the size be passed to the onLoadProgress handler something like

type PdfSize = {height: number, width: number}

onLoadProgress?: (percent: number, size: PdfSize|null) => void

Allow passing in null in case the size is still not yet known.