From f4d3f88f6bb43a6a8af3bbe6270ba7e82c2efd85 Mon Sep 17 00:00:00 2001 From: YMXSDLBQ <3205777270@qq.com> Date: Mon, 23 Sep 2024 17:48:23 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[#IAT2YN]=E6=9B=B4=E6=96=B0react-native?= =?UTF-8?q?-pdf=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/react-native-pdf.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/zh-cn/react-native-pdf.md b/zh-cn/react-native-pdf.md index 9783a4f3..6fe724d6 100644 --- a/zh-cn/react-native-pdf.md +++ b/zh-cn/react-native-pdf.md @@ -258,19 +258,19 @@ ohpm install > [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 | Name | Description | Type | Required | Platform | HarmonyOS Support | -| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------- | ------------- | ----------------- | +| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------- | ------------- |-------------------| | source | PDF source like {uri:xxx, cache:false}. see the following for detail. | object | YES | iOS / Android | yes | -| page | initial page index | number | NO | iOS / Android | no | -| scale | should minScale<=scale<=maxScale | number | NO | iOS / Android | no | -| minScale | min scale | number | NO | iOS / Android | no | -| maxScale | max scale | number | NO | iOS / Android | no | +| page | initial page index | number | NO | iOS / Android | yes | +| scale | should minScale<=scale<=maxScale | number | NO | iOS / Android | yes | +| minScale | min scale | number | NO | iOS / Android | yes | +| maxScale | max scale | number | NO | iOS / Android | yes | | horizontal | draw page direction, if you want to listen the orientation change, you can use [[react-native-orientation-locker\]](https://github.com/react-native-oh-library/react-native-orientation-locker) | bool | NO | iOS / Android | no | | showsHorizontalScrollIndicator | shows or hides the horizontal scroll bar indicator on iOS | bool | NO | iOS | no | | showsVerticalScrollIndicator | shows or hides the vertical scroll bar indicator on iOS | bool | NO | iOS | no | | fitWidth | if true fit the width of view, can not use fitWidth=true together with scale | bool | NO | iOS / Android | no | -| fitPolicy | 0:fit width, 1:fit height, 2:fit both(default) | number | NO | iOS / Android | no | -| spacing | the breaker size between pages | number | NO | iOS / Android | no | -| password | pdf password, if password error, will call OnError() with message "Password required or incorrect password." | string | NO | iOS / Android | no | +| fitPolicy | 0:fit width, 1:fit height, 2:fit both(default) | number | NO | iOS / Android | yes | +| spacing | the breaker size between pages | number | NO | iOS / Android | yes | +| password | pdf password, if password error, will call OnError() with message "Password required or incorrect password." | string | NO | iOS / Android | yes | | style | support normal view style, you can use this to set border/spacing color... | object | NO | iOS / Android | yes | | renderActivityIndicator | when loading show it as an indicator, you can use your component | (progress) => Component | NO | iOS / Android | no | | enableAntialiasing | improve rendering a little bit on low-res screens, but maybe course some problem on Android 4.4, so add a switch | bool | NO | iOS / Android | no | @@ -280,13 +280,13 @@ ohpm install | enableDoubleTapZoom | Enable double tap to zoom gesture | bool | NO | iOS / Android | no | | trustAllCerts | Allow connections to servers with self-signed certification | bool | NO | iOS / Android | no | | singlePage | Only show first page, useful for thumbnail views | bool | NO | iOS / Android | no | -| onLoadProgress | callback when loading, return loading progress (0-1) | function(percent) | NO | iOS / Android | no | -| onLoadComplete | callback when pdf load completed, return total page count, pdf local/cache path, {width,height} and table of contents | function(numberOfPages, path, {width, height}, tableContents) | NO | iOS / Android | no | -| onPageChanged | callback when page changed ,return current page and total page count | function(page,numberOfPages) | NO | iOS / Android | no | -| onError | callback when error happened | function(error) | NO | iOS / Android | no | +| onLoadProgress | callback when loading, return loading progress (0-1) | function(percent) | NO | iOS / Android | yes | +| onLoadComplete | callback when pdf load completed, return total page count, pdf local/cache path, {width,height} and table of contents | function(numberOfPages, path, {width, height}, tableContents) | NO | iOS / Android | partially | +| onPageChanged | callback when page changed ,return current page and total page count | function(page,numberOfPages) | NO | iOS / Android | yes | +| onError | callback when error happened | function(error) | NO | iOS / Android | yes | | onPageSingleTap | callback when page was single tapped | function(page) | NO | iOS / Android | no | -| onScaleChanged | callback when scale page | function(scale) | NO | iOS / Android | no | -| onPressLink | callback when link tapped | function(uri) | NO | iOS / Android | no | +| onScaleChanged | callback when scale page | function(scale) | NO | iOS / Android | yes | +| onPressLink | callback when link tapped | function(uri) | NO | iOS / Android | yes | #### Source @@ -320,8 +320,9 @@ ohpm install ## 遗留问题 -- [ ] react-nativepdf 仅支持 source 和 style 属性,其他属性暂未实现 HarmonyOS 化: [issue#20](https://github.com/react-native-oh-library/react-native-pdf/issues/20) - +- [ ] onLoadComplete 回调函数参数返回目前仅支持 numberOfPages, path参数,其他参数:[issue#47](https://github.com/react-native-oh-library/react-native-pdf/issues/47) +- [ ] 原库部分接口在 HarmonyOS 中没有对应属性及接口处理相关逻辑,问题: [issue#48](https://github.com/react-native-oh-library/react-native-pdf/issues/48) + ## 其他 ## 开源协议 -- Gitee