@react-native-ohos/react-native-pdf 6.7.5-rc.2 → 6.7.5-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,6 +33,7 @@ import { pdfService, pdfViewManager, PdfView } from '@kit.PDFKit'
|
|
|
33
33
|
import { common } from '@kit.AbilityKit';
|
|
34
34
|
import { ON_PROGRESS_CHANGE } from './types';
|
|
35
35
|
import Logger from '../../Logger';
|
|
36
|
+
import deviceInfo from '@ohos.deviceInfo';
|
|
36
37
|
|
|
37
38
|
export const PDF_VIEW_TYPE: string = "RTNPdfView";
|
|
38
39
|
|
|
@@ -124,6 +125,17 @@ export struct RTNPdfView {
|
|
|
124
125
|
.then((res: pdfService.ParseResult) => {
|
|
125
126
|
switch (res) {
|
|
126
127
|
case pdfService.ParseResult.PARSE_SUCCESS:
|
|
128
|
+
let apiVersion = deviceInfo?.sdkApiVersion;
|
|
129
|
+
if(apiVersion >= 22){
|
|
130
|
+
let pdfController: ESObject = this.pdfController;
|
|
131
|
+
const SELF_FIRST = 1;
|
|
132
|
+
pdfController.setNestedScroll({
|
|
133
|
+
scrollUp: SELF_FIRST,
|
|
134
|
+
scrollDown: SELF_FIRST,
|
|
135
|
+
scrollLeft: SELF_FIRST,
|
|
136
|
+
scrollRight: SELF_FIRST,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
127
139
|
this.pdfController.setPageSpacing(spacing, spacing); //由于rn侧值传递一个参数,故此处默认为连续滚动模式。设置上下面的间距。
|
|
128
140
|
if(scale!==1){
|
|
129
141
|
this.pdfController.setPageZoom(scale);
|
|
@@ -390,6 +402,7 @@ export struct RTNPdfView {
|
|
|
390
402
|
}
|
|
391
403
|
|
|
392
404
|
aboutToDisappear() {
|
|
405
|
+
this.pdfController.releaseDocument();
|
|
393
406
|
this.cleanupCommandCallback?.();
|
|
394
407
|
this.unregisterDescriptorChangesListener?.();
|
|
395
408
|
}
|
package/harmony/pdfview.har
CHANGED
|
Binary file
|
package/package.json
CHANGED