@react-native-ohos/react-native-pdf 6.7.7-rc.1 → 6.8.0-rc.1
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.
- package/PdfView.js +417 -417
- package/README.md +1 -1
- package/fabric/RNPDFPdfNativeComponent.js +48 -48
- package/harmony/pdfview/BuildProfile.ets +16 -16
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/.ts_checker_cache +4426 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/.tsbuildinfo +1 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/.tsbuildinfo.linter +1 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/compileInfo.json +1 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/Index.ets-5eef5c87aa27b233ef53cb620fed1f5d.msgpack +0 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/Logger.ets-c555840d2a4b574cf40c57fc8b91bf97.msgpack +0 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/RTNPdfView.ets-030d7d4eb9347bd497689e1ef58937f0.msgpack +1711 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/types.ts-c405c8f7d848bd5a548ec85c97e839bd.msgpack +0 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/other/pkgName2SourceRoots.msgpack +1 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/plugins/plugins.msgpack +0 -0
- package/harmony/pdfview/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/dep_info.json +1 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/BuildProfile.ets +17 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/Index.ets +7 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/ResourceTable.txt +1 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/build-profile.json5 +28 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/consumer-rules.txt +0 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/hvigorfile.ts +6 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/obfuscation-rules.txt +18 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/oh-package-lock.json5 +21 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/oh-package.json5 +1 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/CMakeLists.txt +8 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/ComponentDescriptors.h +36 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/EventEmitters.cpp +39 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/EventEmitters.h +47 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/PdfEventEmitRequestHandler.h +50 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/PdfViewJSIBinder.h +71 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/PdfViewPackage.h +55 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/Props.cpp +58 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/Props.h +61 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/RTNPdfViewSpecsJSI-generated.cpp +34 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/RTNPdfViewSpecsJSI.h +36 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/ShadowNodes.cpp +33 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/ShadowNodes.h +47 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/States.cpp +33 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/cpp/States.h +52 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/ets/Logger.ets +64 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/ets/components/mainpage/RTNPdfView.ets +513 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/ets/components/mainpage/types.ts +15 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/module.json +32 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/resources/base/element/string.json +8 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/resources/en_US/element/string.json +8 -0
- package/harmony/pdfview/build/default/cache/default/default@PackageHar/src/main/resources/zh_CN/element/string.json +8 -0
- package/harmony/pdfview/build/default/generated/pm/default/oh-package.json5 +1 -0
- package/harmony/pdfview/build/default/generated/r/default/ResourceTable.h +24 -0
- package/harmony/pdfview/build/default/intermediates/loader/default/loader.json +25 -0
- package/harmony/pdfview/build/default/intermediates/merge_profile/default/module.json +29 -0
- package/harmony/pdfview/build/default/intermediates/patch/default/base_native_libs.json +1 -0
- package/harmony/pdfview/build/default/intermediates/process_profile/default/module.json +32 -0
- package/harmony/pdfview/build/default/intermediates/res/default/ResourceTable.txt +1 -0
- package/harmony/pdfview/build/default/intermediates/res/default/ark_module.json +1 -0
- package/harmony/pdfview/build/default/intermediates/res/default/ids_map/id_defined.json +7 -0
- package/harmony/pdfview/build/default/intermediates/res/default/module.json +28 -0
- package/harmony/pdfview/build/default/intermediates/res/default/opt-compression.json +1 -0
- package/harmony/pdfview/build/default/intermediates/res/default/resConfig.json +1 -0
- package/harmony/pdfview/build/default/intermediates/res/default/resources/rawfile/rnoh.profdata +0 -0
- package/harmony/pdfview/build/default/intermediates/res/default/resources.index +0 -0
- package/harmony/pdfview/build/default/outputs/default/pdfview.har +0 -0
- package/harmony/pdfview/oh-package-lock.json5 +9 -6
- package/harmony/pdfview/oh-package.json5 +1 -1
- package/harmony/pdfview.har +0 -0
- package/index.d.ts +72 -72
- package/index.js +491 -491
- package/index.js.flow +67 -67
- package/package.json +57 -61
|
@@ -0,0 +1,1711 @@
|
|
|
1
|
+
�r@��assertions�code�customTransformCache�dependencies�id�meta�moduleSideEffects�originalCode�originalSourcemap�resolvedIds�sourcemapChain�syntheticNamedExports�transformDependencies�transformFiles�cacheAst�rA��r0if (!("finalizeConstruction" in ViewPU.prototype)) {
|
|
2
|
+
Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { });
|
|
3
|
+
}
|
|
4
|
+
import { RNViewBase } from '@rnoh/react-native-openharmony';
|
|
5
|
+
import fs from '@ohos.file.fs';
|
|
6
|
+
import request from '@ohos.request';
|
|
7
|
+
import buffer from '@ohos.buffer';
|
|
8
|
+
import cryptoFramework from '@ohos.security.cryptoFramework';
|
|
9
|
+
import pdfService from "@hms.officeservice.pdfservice";
|
|
10
|
+
import { pdfViewManager as pdfViewManager } from "@hms.officeservice.PdfView";
|
|
11
|
+
import { PdfView as PdfView } from "@hms.officeservice.PdfView";
|
|
12
|
+
import { ON_PROGRESS_CHANGE } from './types';
|
|
13
|
+
import Logger from '../../Logger';
|
|
14
|
+
export const PDF_VIEW_TYPE = "RTNPdfView";
|
|
15
|
+
;
|
|
16
|
+
export class RTNPdfView extends ViewPU {
|
|
17
|
+
constructor(parent, params, __localStorage, elmtId = -1, paramsLambda = undefined, extraInfo) {
|
|
18
|
+
super(parent, __localStorage, elmtId, extraInfo);
|
|
19
|
+
if (typeof paramsLambda === "function") {
|
|
20
|
+
this.paramsGenerator_ = paramsLambda;
|
|
21
|
+
}
|
|
22
|
+
this.ctx = undefined;
|
|
23
|
+
this.tag = 0;
|
|
24
|
+
this.buildCustomComponent = this.emptyBuild;
|
|
25
|
+
this.__descriptor = new ObservedPropertyObjectPU(Object(), this, "descriptor");
|
|
26
|
+
this.__pageIndex = new ObservedPropertySimplePU(1, this, "pageIndex");
|
|
27
|
+
this.__controllerStatus = new ObservedPropertySimplePU(false, this, "controllerStatus");
|
|
28
|
+
this.__pdfUrl = new ObservedPropertySimplePU("", this, "pdfUrl");
|
|
29
|
+
this.__scrollEnabled = new ObservedPropertySimplePU(false, this, "scrollEnabled");
|
|
30
|
+
this.unregisterDescriptorChangesListener = undefined;
|
|
31
|
+
this.cleanupCommandCallback = undefined;
|
|
32
|
+
this.pdfController = new pdfViewManager.PdfController();
|
|
33
|
+
this.setInitiallyProvidedValue(params);
|
|
34
|
+
this.finalizeConstruction();
|
|
35
|
+
}
|
|
36
|
+
setInitiallyProvidedValue(params) {
|
|
37
|
+
if (params.ctx !== undefined) {
|
|
38
|
+
this.ctx = params.ctx;
|
|
39
|
+
}
|
|
40
|
+
if (params.tag !== undefined) {
|
|
41
|
+
this.tag = params.tag;
|
|
42
|
+
}
|
|
43
|
+
if (params.buildCustomComponent !== undefined) {
|
|
44
|
+
this.buildCustomComponent = params.buildCustomComponent;
|
|
45
|
+
}
|
|
46
|
+
if (params.descriptor !== undefined) {
|
|
47
|
+
this.descriptor = params.descriptor;
|
|
48
|
+
}
|
|
49
|
+
if (params.pageIndex !== undefined) {
|
|
50
|
+
this.pageIndex = params.pageIndex;
|
|
51
|
+
}
|
|
52
|
+
if (params.controllerStatus !== undefined) {
|
|
53
|
+
this.controllerStatus = params.controllerStatus;
|
|
54
|
+
}
|
|
55
|
+
if (params.pdfUrl !== undefined) {
|
|
56
|
+
this.pdfUrl = params.pdfUrl;
|
|
57
|
+
}
|
|
58
|
+
if (params.scrollEnabled !== undefined) {
|
|
59
|
+
this.scrollEnabled = params.scrollEnabled;
|
|
60
|
+
}
|
|
61
|
+
if (params.unregisterDescriptorChangesListener !== undefined) {
|
|
62
|
+
this.unregisterDescriptorChangesListener = params.unregisterDescriptorChangesListener;
|
|
63
|
+
}
|
|
64
|
+
if (params.cleanupCommandCallback !== undefined) {
|
|
65
|
+
this.cleanupCommandCallback = params.cleanupCommandCallback;
|
|
66
|
+
}
|
|
67
|
+
if (params.pdfController !== undefined) {
|
|
68
|
+
this.pdfController = params.pdfController;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
updateStateVars(params) {
|
|
72
|
+
}
|
|
73
|
+
purgeVariableDependenciesOnElmtId(rmElmtId) {
|
|
74
|
+
this.__descriptor.purgeDependencyOnElmtId(rmElmtId);
|
|
75
|
+
this.__pageIndex.purgeDependencyOnElmtId(rmElmtId);
|
|
76
|
+
this.__controllerStatus.purgeDependencyOnElmtId(rmElmtId);
|
|
77
|
+
this.__pdfUrl.purgeDependencyOnElmtId(rmElmtId);
|
|
78
|
+
this.__scrollEnabled.purgeDependencyOnElmtId(rmElmtId);
|
|
79
|
+
}
|
|
80
|
+
aboutToBeDeleted() {
|
|
81
|
+
this.__descriptor.aboutToBeDeleted();
|
|
82
|
+
this.__pageIndex.aboutToBeDeleted();
|
|
83
|
+
this.__controllerStatus.aboutToBeDeleted();
|
|
84
|
+
this.__pdfUrl.aboutToBeDeleted();
|
|
85
|
+
this.__scrollEnabled.aboutToBeDeleted();
|
|
86
|
+
SubscriberManager.Get().delete(this.id__());
|
|
87
|
+
this.aboutToBeDeletedInternal();
|
|
88
|
+
}
|
|
89
|
+
get descriptor() {
|
|
90
|
+
return this.__descriptor.get();
|
|
91
|
+
}
|
|
92
|
+
set descriptor(newValue) {
|
|
93
|
+
this.__descriptor.set(newValue);
|
|
94
|
+
}
|
|
95
|
+
get pageIndex() {
|
|
96
|
+
return this.__pageIndex.get();
|
|
97
|
+
}
|
|
98
|
+
set pageIndex(newValue) {
|
|
99
|
+
this.__pageIndex.set(newValue);
|
|
100
|
+
}
|
|
101
|
+
get controllerStatus() {
|
|
102
|
+
return this.__controllerStatus.get();
|
|
103
|
+
}
|
|
104
|
+
set controllerStatus(newValue) {
|
|
105
|
+
this.__controllerStatus.set(newValue);
|
|
106
|
+
}
|
|
107
|
+
get pdfUrl() {
|
|
108
|
+
return this.__pdfUrl.get();
|
|
109
|
+
}
|
|
110
|
+
set pdfUrl(newValue) {
|
|
111
|
+
this.__pdfUrl.set(newValue);
|
|
112
|
+
}
|
|
113
|
+
get scrollEnabled() {
|
|
114
|
+
return this.__scrollEnabled.get();
|
|
115
|
+
}
|
|
116
|
+
set scrollEnabled(newValue) {
|
|
117
|
+
this.__scrollEnabled.set(newValue);
|
|
118
|
+
}
|
|
119
|
+
emptyBuild(ctx, parent = null) {
|
|
120
|
+
}
|
|
121
|
+
async doLoadHttpDocument(path) {
|
|
122
|
+
Logger.debug(`[RTNPdfView]: doLoadHttpDocument, path is ${path}`);
|
|
123
|
+
try {
|
|
124
|
+
const filePath = await this.downloadHttpFile(path);
|
|
125
|
+
Logger.debug(`[RTNPdfView]: doLoadHttpDocument, filePath is ${filePath}`);
|
|
126
|
+
this.doLoadLocalDocument(filePath, !this.descriptor.rawProps.source?.cache);
|
|
127
|
+
}
|
|
128
|
+
catch (e) {
|
|
129
|
+
Logger.error(`[RTNPdfView]: fs accessSync: ${e}`);
|
|
130
|
+
this.onError(`[RTNPdfView]: fs accessSync: ${e}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
doLoadLocalDocument(filePath, isDelOriginFile = true) {
|
|
134
|
+
let initPageIndex = this.descriptor.rawProps.page;
|
|
135
|
+
let spacing = Number(this.descriptor.rawProps.spacing);
|
|
136
|
+
let scale = Number(this.descriptor.rawProps.scale);
|
|
137
|
+
let minScale = this.descriptor.rawProps.minScale;
|
|
138
|
+
let maxScale = this.descriptor.rawProps.maxScale;
|
|
139
|
+
let password = this.descriptor.rawProps.password;
|
|
140
|
+
let fitPolicy = this.descriptor.rawProps.fitPolicy;
|
|
141
|
+
// pdfView 初始 scale
|
|
142
|
+
let systemInitScale = 0;
|
|
143
|
+
Logger.debug(`[RTNPdfView]: doLoadLocalDocument, filePath is ${filePath}, isDelOriginFile is ${isDelOriginFile}`);
|
|
144
|
+
const progressCallBack = (progress) => {
|
|
145
|
+
Logger.debug(`[RTNPdfView]: proress is ${(progress / 100).toFixed(2)}`);
|
|
146
|
+
this.loadProgress(Number((progress / 100).toFixed(2)));
|
|
147
|
+
return 0;
|
|
148
|
+
};
|
|
149
|
+
if (filePath) {
|
|
150
|
+
this.pdfController.releaseDocument();
|
|
151
|
+
const initPage = initPageIndex ? Math.max(initPageIndex - 1, 0) : 0;
|
|
152
|
+
this.pdfController.loadDocument(filePath, password, initPage, progressCallBack)
|
|
153
|
+
.then((res) => {
|
|
154
|
+
switch (res) {
|
|
155
|
+
case pdfService.ParseResult.PARSE_SUCCESS:
|
|
156
|
+
this.pdfController.setPageSpacing(spacing, spacing); //由于rn侧值传递一个参数,故此处默认为连续滚动模式。设置上下面的间距。
|
|
157
|
+
this.pdfController.setPageZoom(scale);
|
|
158
|
+
const pageCount = this.pdfController.getPageCount();
|
|
159
|
+
if (typeof fitPolicy === 'number') {
|
|
160
|
+
if (fitPolicy === 0) {
|
|
161
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_WIDTH);
|
|
162
|
+
}
|
|
163
|
+
else if (fitPolicy === 1) {
|
|
164
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_HEIGHT);
|
|
165
|
+
}
|
|
166
|
+
else if (fitPolicy === 2) {
|
|
167
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_PAGE);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// 注册监听器
|
|
171
|
+
let tempScale = scale;
|
|
172
|
+
this.pdfController.registerScaleChangedListener((currentScale) => {
|
|
173
|
+
if (tempScale !== currentScale) {
|
|
174
|
+
if (typeof maxScale === 'number' && currentScale > maxScale) {
|
|
175
|
+
this.pdfController.setPageZoom(maxScale);
|
|
176
|
+
}
|
|
177
|
+
else if (typeof minScale === 'number' && currentScale < minScale) {
|
|
178
|
+
// 问题:当minScale为1时,其他平台不缩放,但鸿蒙pdfView的初始scale小于1,在这里会强制赋值为1,这样就会放大产生滚动,引起和其他平台不一致的效果
|
|
179
|
+
// 解决:systemInitScale为0时,currentScale表示pdfView初始scale,若小于minScale,则赋值给minScale,这样就不会强制赋值为1而产生缩放
|
|
180
|
+
if (!systemInitScale && minScale === 1) {
|
|
181
|
+
systemInitScale = currentScale;
|
|
182
|
+
minScale = systemInitScale;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
this.pdfController.setPageZoom(minScale);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
tempScale = currentScale;
|
|
189
|
+
}
|
|
190
|
+
this.onScaleChanged(currentScale);
|
|
191
|
+
});
|
|
192
|
+
this.pdfController.registerPageChangedListener((pageIndex) => {
|
|
193
|
+
this.onPageChanged((pageIndex + 1), pageCount);
|
|
194
|
+
});
|
|
195
|
+
this.pdfController.registerActionClickListener((redirectInfo) => {
|
|
196
|
+
this.onPressLink(redirectInfo.content);
|
|
197
|
+
});
|
|
198
|
+
this.loadComplete(pageCount, filePath);
|
|
199
|
+
Logger.debug(`[RTNPdfView]: loadDocument success`);
|
|
200
|
+
break;
|
|
201
|
+
case pdfService.ParseResult.PARSE_ERROR_FILE:
|
|
202
|
+
this.onError('loadDocument error: PARSE_ERROR_FILE');
|
|
203
|
+
break;
|
|
204
|
+
case pdfService.ParseResult.PARSE_ERROR_FORMAT:
|
|
205
|
+
this.onError('loadDocument error: PARSE_ERROR_FORMAT');
|
|
206
|
+
break;
|
|
207
|
+
case pdfService.ParseResult.PARSE_ERROR_PASSWORD:
|
|
208
|
+
this.onError('loadDocument error: PARSE_ERROR_PASSWORD');
|
|
209
|
+
break;
|
|
210
|
+
case pdfService.ParseResult.PARSE_ERROR_HANDLER:
|
|
211
|
+
this.onError('loadDocument error: PARSE_ERROR_HANDLER');
|
|
212
|
+
break;
|
|
213
|
+
case pdfService.ParseResult.PARSE_ERROR_CERT:
|
|
214
|
+
this.onError('loadDocument error: PARSE_ERROR_CERT');
|
|
215
|
+
break;
|
|
216
|
+
default:
|
|
217
|
+
this.onError('loadDocument error: UNKNOWN');
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
.catch((e) => {
|
|
222
|
+
Logger.error(`[RTNPdfView]: loadDocument error: ${e}`);
|
|
223
|
+
this.onError(e.message);
|
|
224
|
+
})
|
|
225
|
+
.finally(() => {
|
|
226
|
+
Logger.debug(`[RTNPdfView]: isDelOriginFile is : ${isDelOriginFile}`);
|
|
227
|
+
if (isDelOriginFile) {
|
|
228
|
+
fs.unlink(filePath).then(() => {
|
|
229
|
+
Logger.debug(`[RTNPdfView]: originFile deleted`);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async downloadHttpFile(url) {
|
|
236
|
+
let context = getContext(this);
|
|
237
|
+
let filesDir = context.filesDir;
|
|
238
|
+
let res = "";
|
|
239
|
+
const hashFileName = await this.processFileName(url);
|
|
240
|
+
const cacheFileName = await this.checkCache(hashFileName);
|
|
241
|
+
if (this.descriptor.rawProps.source?.cache && !!cacheFileName) {
|
|
242
|
+
res = cacheFileName;
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
if (!!cacheFileName && fs.accessSync(cacheFileName)) {
|
|
246
|
+
fs.unlinkSync(cacheFileName);
|
|
247
|
+
}
|
|
248
|
+
const fullFileName = filesDir + "/" + hashFileName + new Date().getTime() + '.pdf';
|
|
249
|
+
res = await this.downloadAction(context, url, fullFileName, {}, 0);
|
|
250
|
+
}
|
|
251
|
+
Logger.info(`[RTNPdfView]:res: ${res}`);
|
|
252
|
+
return res;
|
|
253
|
+
}
|
|
254
|
+
async downloadAction(context, url, fullFileName, distHeaders, redirectCount = 0) {
|
|
255
|
+
if (redirectCount > 5) {
|
|
256
|
+
throw new Error("Too many redirects");
|
|
257
|
+
}
|
|
258
|
+
return new Promise((resolve, reject) => {
|
|
259
|
+
// 获取应用文件路径
|
|
260
|
+
try {
|
|
261
|
+
Logger.info(`[RTNPdfView]: start downloadFile`);
|
|
262
|
+
const config = {
|
|
263
|
+
action: request.agent.Action.DOWNLOAD,
|
|
264
|
+
url,
|
|
265
|
+
method: this.descriptor.rawProps.source.method ?? 'GET',
|
|
266
|
+
headers: assignHeader(this.descriptor.rawProps.source?.headers || [], distHeaders || {}),
|
|
267
|
+
saveas: fullFileName,
|
|
268
|
+
overwrite: true,
|
|
269
|
+
mode: request.agent.Mode.FOREGROUND
|
|
270
|
+
};
|
|
271
|
+
request.agent.create(context, config).then((task) => {
|
|
272
|
+
task.on('completed', () => {
|
|
273
|
+
Logger.info(`[RTNPdfView]: finish downloadFile`);
|
|
274
|
+
resolve(fullFileName);
|
|
275
|
+
});
|
|
276
|
+
task.on('failed', (progress) => {
|
|
277
|
+
console.info('[RTNPdfView]: downloadFile failed.', JSON.stringify(progress));
|
|
278
|
+
});
|
|
279
|
+
task.on('response', async (response) => {
|
|
280
|
+
console.info('[RTNPdfView]: downloadFile response.', JSON.stringify(response));
|
|
281
|
+
if (response.statusCode > 300 && response.statusCode < 400) {
|
|
282
|
+
let redirectUrl = response.headers.get('location')?.toString() ?? '';
|
|
283
|
+
let cookie = response.headers.get('set-cookie')?.toString() ?? '';
|
|
284
|
+
task.off('progress');
|
|
285
|
+
task.off('completed');
|
|
286
|
+
task.off('response');
|
|
287
|
+
task.stop();
|
|
288
|
+
try {
|
|
289
|
+
const result = await this.downloadAction(context, redirectUrl, fullFileName, { 'cookie': cookie }, redirectCount + 1);
|
|
290
|
+
Logger.info(`[RTNPdfView]:result: ${result} -----count: ${redirectCount}}`);
|
|
291
|
+
resolve(result);
|
|
292
|
+
}
|
|
293
|
+
catch (e) {
|
|
294
|
+
reject(e);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
task.start();
|
|
299
|
+
}).catch((err) => {
|
|
300
|
+
Logger.info(`[RTNPdfView]: error downloadHttpFile`);
|
|
301
|
+
this.onError(err.message);
|
|
302
|
+
reject("downloadFile failed" + err.message);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
catch (error) {
|
|
306
|
+
Logger.info(`[RTNPdfView]: error downloadHttpFile`);
|
|
307
|
+
let err = error;
|
|
308
|
+
this.onError(err.message);
|
|
309
|
+
reject("downloadFile failed" + err.message);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
async processFileName(originalURL) {
|
|
314
|
+
return new Promise(async (resolve, reject) => {
|
|
315
|
+
let mdAlgName = 'SHA256'; // 摘要算法名
|
|
316
|
+
let md = cryptoFramework.createMd(mdAlgName);
|
|
317
|
+
try {
|
|
318
|
+
await md.update({ data: new Uint8Array(buffer.from(originalURL, 'utf-8').buffer) });
|
|
319
|
+
let mdResult = await md.digest();
|
|
320
|
+
const fileName = buffer.from(mdResult.data).toString('hex');
|
|
321
|
+
Logger.info(`[RTNPdfView]: fileName: ${fileName}`);
|
|
322
|
+
resolve(fileName);
|
|
323
|
+
}
|
|
324
|
+
catch (e) {
|
|
325
|
+
this.onError(e.message);
|
|
326
|
+
reject("processFileName error");
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
async checkCache(hashFileName) {
|
|
331
|
+
try {
|
|
332
|
+
let filesDir = getContext().filesDir;
|
|
333
|
+
let cacheFileName = "";
|
|
334
|
+
let fileList = fs.listFileSync(filesDir);
|
|
335
|
+
fileList.forEach(file => {
|
|
336
|
+
let _hashFileName = file.slice(0, -17);
|
|
337
|
+
_hashFileName === hashFileName && (cacheFileName = filesDir + "/" + file);
|
|
338
|
+
});
|
|
339
|
+
return Promise.resolve(cacheFileName);
|
|
340
|
+
}
|
|
341
|
+
catch (e) {
|
|
342
|
+
this.onError(e.message);
|
|
343
|
+
return Promise.reject("checkCache error");
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
async sendToSandBox(assetPath) {
|
|
347
|
+
assetPath = assetPath.replace("asset://", "assets/");
|
|
348
|
+
Logger.info(`[RTNPdfView]: load pdf assetPath: ${assetPath}`);
|
|
349
|
+
const hashFileName = await this.processFileName(assetPath);
|
|
350
|
+
const cacheFileName = await this.checkCache(hashFileName);
|
|
351
|
+
let fileFullPath = "";
|
|
352
|
+
if (this.descriptor.rawProps.source?.cache && !!cacheFileName) {
|
|
353
|
+
fileFullPath = cacheFileName;
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
if (!!cacheFileName && fs.accessSync(cacheFileName)) {
|
|
357
|
+
fs.unlinkSync(cacheFileName);
|
|
358
|
+
}
|
|
359
|
+
// 需将pdf文档复制到沙箱路径下
|
|
360
|
+
let context = getContext();
|
|
361
|
+
let content = context.resourceManager.getRawFileContentSync(`${assetPath}`); // pdf_reference
|
|
362
|
+
let dir = context.filesDir;
|
|
363
|
+
fileFullPath = dir + '/' + hashFileName + new Date().getTime() + '.pdf';
|
|
364
|
+
Logger.info(`[RTNPdfView]: load pdf filePath: ${fileFullPath}`);
|
|
365
|
+
let res = fs.accessSync(fileFullPath);
|
|
366
|
+
Logger.info(`[RTNPdfView]: fs accessSync: ${res}`);
|
|
367
|
+
let fdSand = fs.openSync(fileFullPath, fs.OpenMode.WRITE_ONLY | fs.OpenMode.CREATE | fs.OpenMode.TRUNC);
|
|
368
|
+
fs.writeSync(fdSand.fd, content.buffer);
|
|
369
|
+
fs.closeSync(fdSand.fd);
|
|
370
|
+
}
|
|
371
|
+
return fileFullPath;
|
|
372
|
+
}
|
|
373
|
+
async updateSource() {
|
|
374
|
+
let src = this.descriptor.rawProps.path;
|
|
375
|
+
Logger.info(`[RTNPdfView]: src is ${src}`);
|
|
376
|
+
if (src) {
|
|
377
|
+
this.pdfUrl = src;
|
|
378
|
+
this.scrollEnabled = this.descriptor.rawProps.scrollEnabled ?? false;
|
|
379
|
+
if (src.startsWith('http://') || src.startsWith('https://')) {
|
|
380
|
+
this.doLoadHttpDocument(src); // 适配加载在线文件
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
let isDeleteOriginFile = false;
|
|
384
|
+
if (src.startsWith('asset://')) { // 适配require('../assets/test.pdf')
|
|
385
|
+
src = await this.sendToSandBox(src);
|
|
386
|
+
isDeleteOriginFile = true;
|
|
387
|
+
}
|
|
388
|
+
this.doLoadLocalDocument(src, isDeleteOriginFile); // 适配本地其他目录,比如cache
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
aboutToAppear() {
|
|
393
|
+
this.descriptor = this.ctx.descriptorRegistry.getDescriptor(this.tag);
|
|
394
|
+
this.updateSource();
|
|
395
|
+
this.unregisterDescriptorChangesListener = this.ctx.descriptorRegistry.subscribeToDescriptorChanges(this.tag, (newDescriptor) => {
|
|
396
|
+
this.descriptor = newDescriptor;
|
|
397
|
+
this.updateSource();
|
|
398
|
+
});
|
|
399
|
+
this.cleanupCommandCallback = this.ctx.componentCommandReceiver.registerCommandCallback(this.tag, (command, args) => {
|
|
400
|
+
Logger.info(`[RNOH]: HarmonyOS does not support,command: ${command}, arg: ${args[0]}`);
|
|
401
|
+
this.pageIndex = args[0];
|
|
402
|
+
this.pdfUrl = "";
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
aboutToDisappear() {
|
|
406
|
+
this.cleanupCommandCallback?.();
|
|
407
|
+
this.unregisterDescriptorChangesListener?.();
|
|
408
|
+
}
|
|
409
|
+
loadComplete(numberOfPages, filePath) {
|
|
410
|
+
Logger.info("[RNOH]:enter loadComplete");
|
|
411
|
+
// 获取页面宽度、高度
|
|
412
|
+
this.ctx.rnInstance.emitComponentEvent(this.descriptor.tag, PDF_VIEW_TYPE, {
|
|
413
|
+
type: 'onChange',
|
|
414
|
+
message: `loadComplete|${numberOfPages}|100|100`
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
loadProgress(percent) {
|
|
418
|
+
Logger.info("[RNOH]:enter loadProgress");
|
|
419
|
+
this.ctx.rnInstance.emitComponentEvent(this.descriptor.tag, PDF_VIEW_TYPE, {
|
|
420
|
+
type: 'onChange',
|
|
421
|
+
message: `loadProgress|${percent}`
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
onError(e) {
|
|
425
|
+
Logger.info("[RNOH]:enter onError");
|
|
426
|
+
this.ctx.rnInstance.emitComponentEvent(this.descriptor.tag, PDF_VIEW_TYPE, {
|
|
427
|
+
type: 'onChange',
|
|
428
|
+
message: `error|${e}`
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
onPageChanged(page, numberOfPages) {
|
|
432
|
+
Logger.info("[RNOH]:enter pageChanged");
|
|
433
|
+
this.ctx.rnInstance.emitComponentEvent(this.descriptor.tag, PDF_VIEW_TYPE, {
|
|
434
|
+
type: 'onChange',
|
|
435
|
+
message: `pageChanged|${page}|${numberOfPages}`
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
onPressLink(url) {
|
|
439
|
+
Logger.info("[RNOH]:enter onPressLink");
|
|
440
|
+
this.ctx.rnInstance.emitComponentEvent(this.descriptor.tag, PDF_VIEW_TYPE, {
|
|
441
|
+
type: 'onChange',
|
|
442
|
+
message: `linkPressed|${url}`
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
onScaleChanged(currentScale) {
|
|
446
|
+
Logger.info("[RNOH]:enter scaleChanged");
|
|
447
|
+
this.ctx.rnInstance.emitComponentEvent(this.descriptor.tag, PDF_VIEW_TYPE, {
|
|
448
|
+
type: 'onChange',
|
|
449
|
+
message: `scaleChanged|${currentScale}`
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
onChange() {
|
|
453
|
+
Logger.info("[RNOH]:onChange not support");
|
|
454
|
+
this.ctx.rnInstance.emitComponentEvent(this.descriptor.tag, PDF_VIEW_TYPE, {
|
|
455
|
+
type: 'onChange',
|
|
456
|
+
message: ON_PROGRESS_CHANGE
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
initialRender() {
|
|
460
|
+
{
|
|
461
|
+
this.observeComponentCreation2((elmtId, isInitialRender) => {
|
|
462
|
+
if (isInitialRender) {
|
|
463
|
+
let componentCall = new RNViewBase(this, {
|
|
464
|
+
ctx: this.ctx, tag: this.tag,
|
|
465
|
+
renderChildren: () => {
|
|
466
|
+
this.observeComponentCreation2((elmtId, isInitialRender) => {
|
|
467
|
+
If.create();
|
|
468
|
+
if (this.descriptor.rawProps.path) {
|
|
469
|
+
this.ifElseBranchUpdateFunction(0, () => {
|
|
470
|
+
{
|
|
471
|
+
this.observeComponentCreation2((elmtId, isInitialRender) => {
|
|
472
|
+
if (isInitialRender) {
|
|
473
|
+
let componentCall = new PdfView(this, {
|
|
474
|
+
controller: this.pdfController,
|
|
475
|
+
pageLayout: pdfService.PageLayout.LAYOUT_SINGLE,
|
|
476
|
+
isContinuous: true,
|
|
477
|
+
pageFit: pdfService.PageFit.FIT_WIDTH,
|
|
478
|
+
showScroll: this.scrollEnabled
|
|
479
|
+
}, undefined, elmtId, () => { }, { page: "../../../gitcode/rntpc_react-native-pdf/harmony/pdfview/src/main/ets/components/mainpage/RTNPdfView.ets", line: 485, col: 9 });
|
|
480
|
+
ViewPU.create(componentCall);
|
|
481
|
+
let paramsLambda = () => {
|
|
482
|
+
return {
|
|
483
|
+
controller: this.pdfController,
|
|
484
|
+
pageLayout: pdfService.PageLayout.LAYOUT_SINGLE,
|
|
485
|
+
isContinuous: true,
|
|
486
|
+
pageFit: pdfService.PageFit.FIT_WIDTH,
|
|
487
|
+
showScroll: this.scrollEnabled
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
componentCall.paramsGenerator_ = paramsLambda;
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
this.updateStateVarsOfChildByElmtId(elmtId, {});
|
|
494
|
+
}
|
|
495
|
+
}, { name: "PdfView" });
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
this.ifElseBranchUpdateFunction(1, () => {
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
}, If);
|
|
504
|
+
If.pop();
|
|
505
|
+
}
|
|
506
|
+
}, undefined, elmtId, () => { }, { page: "../../../gitcode/rntpc_react-native-pdf/harmony/pdfview/src/main/ets/components/mainpage/RTNPdfView.ets", line: 483, col: 5 });
|
|
507
|
+
ViewPU.create(componentCall);
|
|
508
|
+
let paramsLambda = () => {
|
|
509
|
+
return {
|
|
510
|
+
ctx: this.ctx,
|
|
511
|
+
tag: this.tag,
|
|
512
|
+
renderChildren: () => {
|
|
513
|
+
this.observeComponentCreation2((elmtId, isInitialRender) => {
|
|
514
|
+
If.create();
|
|
515
|
+
if (this.descriptor.rawProps.path) {
|
|
516
|
+
this.ifElseBranchUpdateFunction(0, () => {
|
|
517
|
+
{
|
|
518
|
+
this.observeComponentCreation2((elmtId, isInitialRender) => {
|
|
519
|
+
if (isInitialRender) {
|
|
520
|
+
let componentCall = new PdfView(this, {
|
|
521
|
+
controller: this.pdfController,
|
|
522
|
+
pageLayout: pdfService.PageLayout.LAYOUT_SINGLE,
|
|
523
|
+
isContinuous: true,
|
|
524
|
+
pageFit: pdfService.PageFit.FIT_WIDTH,
|
|
525
|
+
showScroll: this.scrollEnabled
|
|
526
|
+
}, undefined, elmtId, () => { }, { page: "../../../gitcode/rntpc_react-native-pdf/harmony/pdfview/src/main/ets/components/mainpage/RTNPdfView.ets", line: 485, col: 9 });
|
|
527
|
+
ViewPU.create(componentCall);
|
|
528
|
+
let paramsLambda = () => {
|
|
529
|
+
return {
|
|
530
|
+
controller: this.pdfController,
|
|
531
|
+
pageLayout: pdfService.PageLayout.LAYOUT_SINGLE,
|
|
532
|
+
isContinuous: true,
|
|
533
|
+
pageFit: pdfService.PageFit.FIT_WIDTH,
|
|
534
|
+
showScroll: this.scrollEnabled
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
componentCall.paramsGenerator_ = paramsLambda;
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
this.updateStateVarsOfChildByElmtId(elmtId, {});
|
|
541
|
+
}
|
|
542
|
+
}, { name: "PdfView" });
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
this.ifElseBranchUpdateFunction(1, () => {
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
}, If);
|
|
551
|
+
If.pop();
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
componentCall.paramsGenerator_ = paramsLambda;
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
this.updateStateVarsOfChildByElmtId(elmtId, {});
|
|
559
|
+
}
|
|
560
|
+
}, { name: "RNViewBase" });
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
rerender() {
|
|
564
|
+
this.updateDirtyElements();
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
function arrayToRecord(headers) {
|
|
568
|
+
const record = {};
|
|
569
|
+
headers.forEach(item => {
|
|
570
|
+
record[item.key] = item.value;
|
|
571
|
+
});
|
|
572
|
+
return record;
|
|
573
|
+
}
|
|
574
|
+
function assignHeader(headers, ...source) {
|
|
575
|
+
const target = arrayToRecord(headers);
|
|
576
|
+
for (let s of source) {
|
|
577
|
+
for (let k of Object.keys(s)) {
|
|
578
|
+
target[k] = Reflect.get(s, k);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return target;
|
|
582
|
+
}
|
|
583
|
+
//# sourceMappingURL=RTNPdfView.js.map�@rnoh/react-native-openharmony�ghvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_openharmony_ets_api_@ohos.file.fs.d.ts�ghvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_openharmony_ets_api_@ohos.request.d.ts�fhvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_openharmony_ets_api_@ohos.buffer.d.ts�xhvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_openharmony_ets_api_@ohos.security.cryptoFramework.d.ts�ohvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_hms_ets_api_@hms.officeservice.pdfservice.d.ts�mhvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_hms_ets_api_@hms.officeservice.PdfView.d.ets�[E:\gitcode\rntpc_react-native-pdf\harmony\pdfview\src\main\ets\components\mainpage\types.ts�IE:\gitcode\rntpc_react-native-pdf\harmony\pdfview\src\main\ets\Logger.ets�aE:\gitcode\rntpc_react-native-pdf\harmony\pdfview\src\main\ets\components\mainpage\RTNPdfView.ets�rB��moduleName�isLocalDependency�isNodeEntryFile�pkgPath�belongProjectPath�pkgName�pkgVersion�dependencyPkgInfo�belongModulePath�checker�shouldEmitJs�hostModulesInfo�pdfview���1E:\gitcode\rntpc_react-native-pdf\harmony\pdfview�)E:\gitcode\rntpc_react-native-pdf\harmony�#@react-native-ohos/react-native-pdf�6.8.0-rc.1��1E:\gitcode\rntpc_react-native-pdf\harmony\pdfview�rC���getNodeCount�getIdentifierCount�getSymbolCount�getTypeCount�getInstantiationCount�getRelationCacheSizes�isUndefinedSymbol�isArgumentsSymbol�isUnknownSymbol�getMergedSymbol�getDiagnostics�getGlobalDiagnostics�getRecursionIdentity�getUnmatchedProperties�getTypeOfSymbolAtLocation�getTypeOfSymbol�(getSymbolsOfParameterPropertyDeclaration�getDeclaredTypeOfSymbol�getPropertiesOfType�getPropertyOfType�"getPrivateIdentifierPropertyOfType�getTypeOfPropertyOfType�getIndexInfoOfType�getIndexInfosOfType�getIndexInfosOfIndexSymbol�getSignaturesOfType�getIndexTypeOfType�getIndexType�getBaseTypes�getBaseTypeOfLiteralType�getWidenedType�getTypeFromTypeNode�getParameterType�$getParameterIdentifierNameAtPosition�getPromisedTypeOfPromise�getAwaitedType�getReturnTypeOfSignature�isNullableType�getNullableType�getNonNullableType�getNonOptionalType�getTypeArguments�typeToTypeNode�$indexInfoToIndexSignatureDeclaration�signatureToSignatureDeclaration�symbolToEntityName�symbolToExpression�symbolToNode�!symbolToTypeParameterDeclarations�symbolToParameterDeclaration�typeParameterToDeclaration�getSymbolsInScope�getSymbolAtLocation�getIndexInfosAtLocation�!getShorthandAssignmentValueSymbol�#getExportSpecifierLocalTargetSymbol�getExportSymbolOfSymbol�getTypeAtLocation� tryGetTypeAtLocationWithoutCheck�getTypeOfAssignmentPattern�*getPropertySymbolOfDestructuringAssignment�signatureToString�typeToString�symbolToString�typePredicateToString�writeSignature�writeType�writeSymbol�writeTypePredicate�getAugmentedPropertiesOfType�getRootSymbols�getSymbolOfExpando�getContextualType�(getContextualTypeForObjectLiteralElement�#getContextualTypeForArgumentAtIndex� getContextualTypeForJsxAttribute�isContextSensitive�!getTypeOfPropertyOfContextualType�getFullyQualifiedName�#tryGetResolvedSignatureWithoutCheck�getResolvedSignature�/getResolvedSignatureForStringLiteralCompletions�$getResolvedSignatureForSignatureHelp�getExpandedParameters�hasEffectiveRestParameter�containsArgumentsReference�getConstantValue�isValidPropertyAccess�#isValidPropertyAccessForCompletions�getSignatureFromDeclaration�isImplementationOfOverload�getImmediateAliasedSymbol�getAliasedSymbol�getEmitResolver�getExportsOfModule�getExportsAndPropertiesOfModule� forEachExportAndPropertyOfModule�getSymbolWalker�getAmbientModules�getJsxIntrinsicTagNamesAt�isOptionalParameter�tryGetMemberInModuleExports�(tryGetMemberInModuleExportsAndProperties�tryFindAmbientModule�(tryFindAmbientModuleWithoutAugmentations�getApparentType�getUnionType�isTypeAssignableTo�createAnonymousType�createSignature�createSymbol�createIndexInfo�getAnyType�getStringType�getNumberType�createPromiseType�createArrayType�getElementTypeOfArrayType�getBooleanType�getFalseType�getTrueType�getVoidType�getUndefinedType�getNullType�getESSymbolType�getNeverType�getOptionalType�getPromiseType�getPromiseLikeType�getAsyncIterableType�isSymbolAccessible�isArrayType�isTupleType�isArrayLikeType�#isTypeInvalidDueToUnionDiscriminant�getExactOptionalProperties�getAllPossiblePropertiesOfTypes�(getSuggestedSymbolForNonexistentProperty�#getSuggestionForNonexistentProperty�,getSuggestedSymbolForNonexistentJSXAttribute�&getSuggestedSymbolForNonexistentSymbol�!getSuggestionForNonexistentSymbol�&getSuggestedSymbolForNonexistentModule�!getSuggestionForNonexistentExport�+getSuggestedSymbolForNonexistentClassMember�getBaseConstraintOfType�getDefaultFromTypeParameter�resolveName�getJsxNamespace�getJsxFragmentFactory�getAccessibleSymbolChain�getTypePredicateOfSignature�resolveExternalModuleName�resolveExternalModuleSymbol�tryGetThisTypeAt�getTypeArgumentConstraint�getSuggestionDiagnostics�runWithCancellationToken�3getLocalTypeParametersOfClassOrInterfaceOrTypeAlias�isDeclarationVisible�isPropertyAccessible�getTypeOnlyAliasDeclaration�getMemberOverrideModifierStatus�!isTypeParameterPossiblyReferenced�getConstEnumRelate�clearConstEnumRelate�deleteConstEnumRelate�$getTypeArgumentsForResolvedSignature�getCheckedSourceFiles�"collectHaveTsNoCheckFilesForLinter�clearQualifiedNameCache�isStaticRecord�isStaticSourceFile�createIntrinsicType�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rD��hostDependencyName�hostModuleName�-./src/main/ets/components/mainpage/RTNPdfView�pdfview��M�/*
|
|
584
|
+
* MIT License
|
|
585
|
+
*
|
|
586
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
587
|
+
*
|
|
588
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
589
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
590
|
+
* in the Software without restriction, including without limitation the rights
|
|
591
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
592
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
593
|
+
* furnished to do so, subject to the following conditions:
|
|
594
|
+
*
|
|
595
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
596
|
+
* copies or substantial portions of the Software.
|
|
597
|
+
*
|
|
598
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
599
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
600
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
601
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
602
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
603
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
604
|
+
* SOFTWARE.
|
|
605
|
+
*/
|
|
606
|
+
|
|
607
|
+
import { Descriptor, ComponentBuilderContext, ViewRawProps, ViewBaseProps } from '@rnoh/react-native-openharmony';
|
|
608
|
+
import { RNOHContext, RNViewBase } from '@rnoh/react-native-openharmony';
|
|
609
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
610
|
+
import fs from '@ohos.file.fs';
|
|
611
|
+
import request from '@ohos.request';
|
|
612
|
+
import buffer from '@ohos.buffer';
|
|
613
|
+
import cryptoFramework from '@ohos.security.cryptoFramework';
|
|
614
|
+
import { pdfService, pdfViewManager, PdfView } from '@kit.PDFKit'
|
|
615
|
+
import { common } from '@kit.AbilityKit';
|
|
616
|
+
import { ON_PROGRESS_CHANGE } from './types';
|
|
617
|
+
import Logger from '../../Logger';
|
|
618
|
+
|
|
619
|
+
export const PDF_VIEW_TYPE: string = "RTNPdfView";
|
|
620
|
+
|
|
621
|
+
export interface PdfViewState {}
|
|
622
|
+
|
|
623
|
+
interface Headers {
|
|
624
|
+
key: string;
|
|
625
|
+
value: string;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
interface Source {
|
|
629
|
+
uri: string;
|
|
630
|
+
headers?: Array<Headers>;
|
|
631
|
+
cache?: boolean;
|
|
632
|
+
cacheFileName?: string;
|
|
633
|
+
expiration?: number;
|
|
634
|
+
method?: string;
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
export interface PdfViewRawProps extends ViewRawProps {
|
|
638
|
+
source: Source,
|
|
639
|
+
path?: string,
|
|
640
|
+
page?: number,
|
|
641
|
+
scale?: number,
|
|
642
|
+
minScale?: number,
|
|
643
|
+
maxScale?: number,
|
|
644
|
+
horizontal?: boolean,
|
|
645
|
+
enablePaging?: boolean,
|
|
646
|
+
enableRTL?: boolean,
|
|
647
|
+
enableAnnotationRendering?: boolean,
|
|
648
|
+
showsHorizontalScrollIndicator?: boolean,
|
|
649
|
+
showsVerticalScrollIndicator?: boolean,
|
|
650
|
+
scrollEnabled?: boolean,
|
|
651
|
+
enableAntialiasing?: boolean,
|
|
652
|
+
fitPolicy?: number,
|
|
653
|
+
spacing?: number,
|
|
654
|
+
password?: string,
|
|
655
|
+
singlePage?: boolean,
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export type PdfViewDescriptor = Descriptor<'RTNPdfView', ViewBaseProps, PdfViewState, PdfViewRawProps>
|
|
659
|
+
|
|
660
|
+
@Component
|
|
661
|
+
export struct RTNPdfView {
|
|
662
|
+
ctx!: RNOHContext;
|
|
663
|
+
tag: number = 0;
|
|
664
|
+
@BuilderParam buildCustomComponent: (componentBuilderContext: ComponentBuilderContext) => void = this.emptyBuild;
|
|
665
|
+
@State descriptor: PdfViewDescriptor = Object() as PdfViewDescriptor;
|
|
666
|
+
@State pageIndex: number = 1;
|
|
667
|
+
@State controllerStatus: boolean = false;
|
|
668
|
+
@State pdfUrl: string = "";
|
|
669
|
+
@State scrollEnabled: boolean = false;
|
|
670
|
+
private unregisterDescriptorChangesListener?: () => void = undefined;
|
|
671
|
+
private cleanupCommandCallback?: () => void = undefined;
|
|
672
|
+
private pdfController: pdfViewManager.PdfController = new pdfViewManager.PdfController();
|
|
673
|
+
|
|
674
|
+
@Builder
|
|
675
|
+
emptyBuild(ctx: ComponentBuilderContext) {
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
async doLoadHttpDocument(path: string): Promise<void> {
|
|
679
|
+
Logger.debug(`[RTNPdfView]: doLoadHttpDocument, path is ${path}`);
|
|
680
|
+
try {
|
|
681
|
+
const filePath: string = await this.downloadHttpFile(path);
|
|
682
|
+
Logger.debug(`[RTNPdfView]: doLoadHttpDocument, filePath is ${filePath}`);
|
|
683
|
+
this.doLoadLocalDocument(filePath, !this.descriptor.rawProps.source?.cache);
|
|
684
|
+
} catch (e) {
|
|
685
|
+
Logger.error(`[RTNPdfView]: fs accessSync: ${e}`);
|
|
686
|
+
this.onError(`[RTNPdfView]: fs accessSync: ${e}`);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
doLoadLocalDocument(filePath: string, isDelOriginFile: boolean = true): void {
|
|
691
|
+
let initPageIndex: number | undefined = this.descriptor.rawProps.page;
|
|
692
|
+
let spacing: number = Number(this.descriptor.rawProps.spacing);
|
|
693
|
+
let scale: number = Number(this.descriptor.rawProps.scale);
|
|
694
|
+
let minScale: number | undefined = this.descriptor.rawProps.minScale;
|
|
695
|
+
let maxScale: number | undefined = this.descriptor.rawProps.maxScale;
|
|
696
|
+
let password: string | undefined = this.descriptor.rawProps.password;
|
|
697
|
+
let fitPolicy: number | undefined = this.descriptor.rawProps.fitPolicy;
|
|
698
|
+
// pdfView 初始 scale
|
|
699
|
+
let systemInitScale = 0;
|
|
700
|
+
|
|
701
|
+
Logger.debug(`[RTNPdfView]: doLoadLocalDocument, filePath is ${filePath}, isDelOriginFile is ${isDelOriginFile}`);
|
|
702
|
+
const progressCallBack: (progress: number) => number = (progress: number) => {
|
|
703
|
+
Logger.debug(`[RTNPdfView]: proress is ${(progress / 100).toFixed(2)}`);
|
|
704
|
+
this.loadProgress(Number((progress / 100).toFixed(2)));
|
|
705
|
+
return 0;
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
if (filePath) {
|
|
709
|
+
this.pdfController.releaseDocument();
|
|
710
|
+
const initPage = initPageIndex ? Math.max(initPageIndex - 1, 0) : 0
|
|
711
|
+
this.pdfController.loadDocument(filePath, password, initPage, progressCallBack)
|
|
712
|
+
.then((res: pdfService.ParseResult) => {
|
|
713
|
+
switch (res) {
|
|
714
|
+
case pdfService.ParseResult.PARSE_SUCCESS:
|
|
715
|
+
this.pdfController.setPageSpacing(spacing, spacing); //由于rn侧值传递一个参数,故此处默认为连续滚动模式。设置上下面的间距。
|
|
716
|
+
this.pdfController.setPageZoom(scale);
|
|
717
|
+
const pageCount: number = this.pdfController.getPageCount();
|
|
718
|
+
if (typeof fitPolicy === 'number') {
|
|
719
|
+
if (fitPolicy === 0) {
|
|
720
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_WIDTH);
|
|
721
|
+
} else if (fitPolicy === 1) {
|
|
722
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_HEIGHT);
|
|
723
|
+
} else if (fitPolicy === 2) {
|
|
724
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_PAGE);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// 注册监听器
|
|
729
|
+
let tempScale: number | undefined = scale;
|
|
730
|
+
this.pdfController.registerScaleChangedListener((currentScale: number) => {
|
|
731
|
+
if (tempScale !== currentScale) {
|
|
732
|
+
if (typeof maxScale === 'number' && currentScale > maxScale) {
|
|
733
|
+
this.pdfController.setPageZoom(maxScale);
|
|
734
|
+
} else if (typeof minScale === 'number' && currentScale < minScale) {
|
|
735
|
+
// 问题:当minScale为1时,其他平台不缩放,但鸿蒙pdfView的初始scale小于1,在这里会强制赋值为1,这样就会放大产生滚动,引起和其他平台不一致的效果
|
|
736
|
+
// 解决:systemInitScale为0时,currentScale表示pdfView初始scale,若小于minScale,则赋值给minScale,这样就不会强制赋值为1而产生缩放
|
|
737
|
+
if (!systemInitScale && minScale === 1) {
|
|
738
|
+
systemInitScale = currentScale
|
|
739
|
+
minScale = systemInitScale;
|
|
740
|
+
} else {
|
|
741
|
+
this.pdfController.setPageZoom(minScale);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
tempScale = currentScale;
|
|
745
|
+
}
|
|
746
|
+
this.onScaleChanged(currentScale);
|
|
747
|
+
});
|
|
748
|
+
this.pdfController.registerPageChangedListener((pageIndex: number) => {
|
|
749
|
+
this.onPageChanged((pageIndex + 1), pageCount);
|
|
750
|
+
});
|
|
751
|
+
this.pdfController.registerActionClickListener((redirectInfo: pdfViewManager.RedirectInfo) => {
|
|
752
|
+
this.onPressLink(redirectInfo.content);
|
|
753
|
+
});
|
|
754
|
+
this.loadComplete(pageCount, filePath,);
|
|
755
|
+
Logger.debug(`[RTNPdfView]: loadDocument success`);
|
|
756
|
+
break;
|
|
757
|
+
case pdfService.ParseResult.PARSE_ERROR_FILE:
|
|
758
|
+
this.onError('loadDocument error: PARSE_ERROR_FILE');
|
|
759
|
+
break;
|
|
760
|
+
case pdfService.ParseResult.PARSE_ERROR_FORMAT:
|
|
761
|
+
this.onError('loadDocument error: PARSE_ERROR_FORMAT');
|
|
762
|
+
break;
|
|
763
|
+
case pdfService.ParseResult.PARSE_ERROR_PASSWORD:
|
|
764
|
+
this.onError('loadDocument error: PARSE_ERROR_PASSWORD');
|
|
765
|
+
break;
|
|
766
|
+
case pdfService.ParseResult.PARSE_ERROR_HANDLER:
|
|
767
|
+
this.onError('loadDocument error: PARSE_ERROR_HANDLER');
|
|
768
|
+
break;
|
|
769
|
+
case pdfService.ParseResult.PARSE_ERROR_CERT:
|
|
770
|
+
this.onError('loadDocument error: PARSE_ERROR_CERT');
|
|
771
|
+
break;
|
|
772
|
+
default:
|
|
773
|
+
this.onError('loadDocument error: UNKNOWN');
|
|
774
|
+
break;
|
|
775
|
+
}
|
|
776
|
+
})
|
|
777
|
+
.catch((e: Error) => {
|
|
778
|
+
Logger.error(`[RTNPdfView]: loadDocument error: ${e}`);
|
|
779
|
+
this.onError(e.message);
|
|
780
|
+
})
|
|
781
|
+
.finally(() => {
|
|
782
|
+
Logger.debug(`[RTNPdfView]: isDelOriginFile is : ${isDelOriginFile}`);
|
|
783
|
+
if (isDelOriginFile) {
|
|
784
|
+
fs.unlink(filePath).then(() => {
|
|
785
|
+
Logger.debug(`[RTNPdfView]: originFile deleted`);
|
|
786
|
+
})
|
|
787
|
+
}
|
|
788
|
+
})
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
async downloadHttpFile(url: string): Promise<string> {
|
|
793
|
+
let context = getContext(this) as common.UIAbilityContext;
|
|
794
|
+
let filesDir = context.filesDir;
|
|
795
|
+
let res: string = "";
|
|
796
|
+
const hashFileName: string = await this.processFileName(url);
|
|
797
|
+
const cacheFileName = await this.checkCache(hashFileName);
|
|
798
|
+
if(this.descriptor.rawProps.source?.cache && !!cacheFileName){
|
|
799
|
+
res = cacheFileName;
|
|
800
|
+
}else{
|
|
801
|
+
if (!!cacheFileName && fs.accessSync(cacheFileName)) {
|
|
802
|
+
fs.unlinkSync(cacheFileName);
|
|
803
|
+
}
|
|
804
|
+
const fullFileName: string = filesDir + "/" + hashFileName + new Date().getTime() + '.pdf';
|
|
805
|
+
res = await this.downloadAction(context, url, fullFileName, {}, 0);
|
|
806
|
+
}
|
|
807
|
+
Logger.info(`[RTNPdfView]:res: ${res}`);
|
|
808
|
+
return res;
|
|
809
|
+
}
|
|
810
|
+
async downloadAction(
|
|
811
|
+
context: Context,
|
|
812
|
+
url: string,
|
|
813
|
+
fullFileName: string,
|
|
814
|
+
distHeaders: Record<string, Object>,
|
|
815
|
+
redirectCount: number = 0,
|
|
816
|
+
): Promise<string> {
|
|
817
|
+
if (redirectCount > 5) {
|
|
818
|
+
throw new Error("Too many redirects");
|
|
819
|
+
}
|
|
820
|
+
return new Promise((resolve, reject) => {
|
|
821
|
+
// 获取应用文件路径
|
|
822
|
+
try {
|
|
823
|
+
Logger.info(`[RTNPdfView]: start downloadFile`);
|
|
824
|
+
const config: request.agent.Config = {
|
|
825
|
+
action: request.agent.Action.DOWNLOAD,
|
|
826
|
+
url,
|
|
827
|
+
method: this.descriptor.rawProps.source.method ?? 'GET',
|
|
828
|
+
headers: assignHeader(this.descriptor.rawProps.source?.headers || [], distHeaders|| {}),
|
|
829
|
+
saveas: fullFileName,
|
|
830
|
+
overwrite: true,
|
|
831
|
+
mode: request.agent.Mode.FOREGROUND
|
|
832
|
+
};
|
|
833
|
+
request.agent.create(context, config).then((task: request.agent.Task) => {
|
|
834
|
+
task.on('completed', () => {
|
|
835
|
+
Logger.info(`[RTNPdfView]: finish downloadFile`);
|
|
836
|
+
resolve(fullFileName);
|
|
837
|
+
})
|
|
838
|
+
task.on('failed', (progress: request.agent.Progress) => {
|
|
839
|
+
console.info('[RTNPdfView]: downloadFile failed.', JSON.stringify(progress));
|
|
840
|
+
});
|
|
841
|
+
task.on('response', async (response: request.agent.HttpResponse) => {
|
|
842
|
+
console.info('[RTNPdfView]: downloadFile response.', JSON.stringify(response));
|
|
843
|
+
if (response.statusCode > 300 && response.statusCode < 400) {
|
|
844
|
+
let redirectUrl: string = response.headers.get('location')?.toString() ?? '';
|
|
845
|
+
let cookie: string = response.headers.get('set-cookie')?.toString() ?? '';
|
|
846
|
+
task.off('progress');
|
|
847
|
+
task.off('completed');
|
|
848
|
+
task.off('response');
|
|
849
|
+
task.stop();
|
|
850
|
+
try {
|
|
851
|
+
const result = await this.downloadAction(context, redirectUrl, fullFileName, { 'cookie': cookie }, redirectCount + 1);
|
|
852
|
+
|
|
853
|
+
Logger.info(`[RTNPdfView]:result: ${result} -----count: ${redirectCount}}`);
|
|
854
|
+
resolve(result)
|
|
855
|
+
} catch (e) {
|
|
856
|
+
reject(e);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
task.start();
|
|
861
|
+
}).catch((err: BusinessError) => {
|
|
862
|
+
Logger.info(`[RTNPdfView]: error downloadHttpFile`);
|
|
863
|
+
this.onError(err.message);
|
|
864
|
+
reject("downloadFile failed" + err.message);
|
|
865
|
+
});
|
|
866
|
+
} catch (error) {
|
|
867
|
+
Logger.info(`[RTNPdfView]: error downloadHttpFile`);
|
|
868
|
+
let err: BusinessError = error as BusinessError;
|
|
869
|
+
this.onError(err.message);
|
|
870
|
+
reject("downloadFile failed" + err.message);
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
async processFileName(originalURL: string): Promise<string> {
|
|
876
|
+
return new Promise(async (resolve, reject) => {
|
|
877
|
+
let mdAlgName = 'SHA256'; // 摘要算法名
|
|
878
|
+
let md = cryptoFramework.createMd(mdAlgName);
|
|
879
|
+
try {
|
|
880
|
+
await md.update({ data: new Uint8Array(buffer.from(originalURL, 'utf-8').buffer) });
|
|
881
|
+
let mdResult: cryptoFramework.DataBlob = await md.digest();
|
|
882
|
+
const fileName: string = buffer.from(mdResult.data).toString('hex');
|
|
883
|
+
Logger.info(`[RTNPdfView]: fileName: ${fileName}`);
|
|
884
|
+
resolve(fileName);
|
|
885
|
+
} catch (e) {
|
|
886
|
+
this.onError(e.message);
|
|
887
|
+
reject("processFileName error");
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
async checkCache(hashFileName: string): Promise<string> {
|
|
892
|
+
try {
|
|
893
|
+
let filesDir = (getContext() as common.UIAbilityContext).filesDir;
|
|
894
|
+
let cacheFileName: string = "";
|
|
895
|
+
let fileList = fs.listFileSync(filesDir);
|
|
896
|
+
fileList.forEach(file=>{
|
|
897
|
+
let _hashFileName = file.slice(0, -17);
|
|
898
|
+
_hashFileName === hashFileName && (cacheFileName = filesDir + "/" + file);
|
|
899
|
+
})
|
|
900
|
+
return Promise.resolve(cacheFileName);
|
|
901
|
+
} catch (e) {
|
|
902
|
+
this.onError(e.message);
|
|
903
|
+
return Promise.reject("checkCache error");
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
async sendToSandBox(assetPath: string): Promise<string> {
|
|
908
|
+
assetPath = assetPath!.replace("asset://", "assets/");
|
|
909
|
+
Logger.info(`[RTNPdfView]: load pdf assetPath: ${assetPath}`);
|
|
910
|
+
const hashFileName: string = await this.processFileName(assetPath);
|
|
911
|
+
const cacheFileName = await this.checkCache(hashFileName);
|
|
912
|
+
let fileFullPath: string = "";
|
|
913
|
+
|
|
914
|
+
if(this.descriptor.rawProps.source?.cache && !!cacheFileName){
|
|
915
|
+
fileFullPath = cacheFileName;
|
|
916
|
+
}else{
|
|
917
|
+
if (!!cacheFileName && fs.accessSync(cacheFileName)) {
|
|
918
|
+
fs.unlinkSync(cacheFileName);
|
|
919
|
+
}
|
|
920
|
+
// 需将pdf文档复制到沙箱路径下
|
|
921
|
+
let context = getContext() as common.UIAbilityContext;
|
|
922
|
+
let content = context.resourceManager.getRawFileContentSync(`${assetPath}`); // pdf_reference
|
|
923
|
+
let dir = context.filesDir;
|
|
924
|
+
fileFullPath = dir + '/' + hashFileName + new Date().getTime() + '.pdf';
|
|
925
|
+
Logger.info(`[RTNPdfView]: load pdf filePath: ${fileFullPath}`);
|
|
926
|
+
let res = fs.accessSync(fileFullPath);
|
|
927
|
+
Logger.info(`[RTNPdfView]: fs accessSync: ${res}`);
|
|
928
|
+
let fdSand = fs.openSync(fileFullPath, fs.OpenMode.WRITE_ONLY | fs.OpenMode.CREATE | fs.OpenMode.TRUNC);
|
|
929
|
+
fs.writeSync(fdSand.fd, content.buffer);
|
|
930
|
+
fs.closeSync(fdSand.fd);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
return fileFullPath;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
async updateSource() {
|
|
937
|
+
let src: string | undefined = this.descriptor.rawProps.path;
|
|
938
|
+
Logger.info(`[RTNPdfView]: src is ${src}`);
|
|
939
|
+
if (src) {
|
|
940
|
+
this.pdfUrl = src;
|
|
941
|
+
this.scrollEnabled = this.descriptor.rawProps.scrollEnabled ?? false
|
|
942
|
+
if (src!.startsWith('http://') || src!.startsWith('https://')) {
|
|
943
|
+
this.doLoadHttpDocument(src); // 适配加载在线文件
|
|
944
|
+
} else {
|
|
945
|
+
let isDeleteOriginFile: boolean = false;
|
|
946
|
+
if (src!.startsWith('asset://')) { // 适配require('../assets/test.pdf')
|
|
947
|
+
src = await this.sendToSandBox(src);
|
|
948
|
+
isDeleteOriginFile = true;
|
|
949
|
+
}
|
|
950
|
+
this.doLoadLocalDocument(src, isDeleteOriginFile); // 适配本地其他目录,比如cache
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
aboutToAppear() {
|
|
956
|
+
this.descriptor = this.ctx.descriptorRegistry.getDescriptor<PdfViewDescriptor>(this.tag);
|
|
957
|
+
this.updateSource();
|
|
958
|
+
this.unregisterDescriptorChangesListener = this.ctx.descriptorRegistry.subscribeToDescriptorChanges(this.tag,
|
|
959
|
+
(newDescriptor) => {
|
|
960
|
+
this.descriptor = (newDescriptor as PdfViewDescriptor)
|
|
961
|
+
this.updateSource();
|
|
962
|
+
}
|
|
963
|
+
)
|
|
964
|
+
this.cleanupCommandCallback = this.ctx.componentCommandReceiver.registerCommandCallback(
|
|
965
|
+
this.tag,
|
|
966
|
+
(command, args: (boolean | number)[]) => {
|
|
967
|
+
Logger.info(`[RNOH]: HarmonyOS does not support,command: ${command}, arg: ${args[0]}`);
|
|
968
|
+
this.pageIndex = args[0] as number;
|
|
969
|
+
this.pdfUrl = "";
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
aboutToDisappear() {
|
|
974
|
+
this.cleanupCommandCallback?.();
|
|
975
|
+
this.unregisterDescriptorChangesListener?.();
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
loadComplete(numberOfPages: number, filePath: string) {
|
|
979
|
+
Logger.info("[RNOH]:enter loadComplete");
|
|
980
|
+
|
|
981
|
+
// 获取页面宽度、高度
|
|
982
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
983
|
+
this.descriptor.tag,
|
|
984
|
+
PDF_VIEW_TYPE,
|
|
985
|
+
{
|
|
986
|
+
type: 'onChange',
|
|
987
|
+
message: `loadComplete|${numberOfPages}|100|100`
|
|
988
|
+
}
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
loadProgress(percent: number) {
|
|
993
|
+
Logger.info("[RNOH]:enter loadProgress");
|
|
994
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
995
|
+
this.descriptor.tag,
|
|
996
|
+
PDF_VIEW_TYPE,
|
|
997
|
+
{
|
|
998
|
+
type: 'onChange',
|
|
999
|
+
message: `loadProgress|${percent}`
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
onError(e: string) {
|
|
1005
|
+
Logger.info("[RNOH]:enter onError");
|
|
1006
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1007
|
+
this.descriptor.tag,
|
|
1008
|
+
PDF_VIEW_TYPE,
|
|
1009
|
+
{
|
|
1010
|
+
type: 'onChange',
|
|
1011
|
+
message: `error|${e}`
|
|
1012
|
+
}
|
|
1013
|
+
);
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
onPageChanged(page: number, numberOfPages: number) {
|
|
1017
|
+
Logger.info("[RNOH]:enter pageChanged");
|
|
1018
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1019
|
+
this.descriptor.tag,
|
|
1020
|
+
PDF_VIEW_TYPE,
|
|
1021
|
+
{
|
|
1022
|
+
type: 'onChange',
|
|
1023
|
+
message: `pageChanged|${page}|${numberOfPages}`
|
|
1024
|
+
}
|
|
1025
|
+
);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
onPressLink(url: string) {
|
|
1029
|
+
Logger.info("[RNOH]:enter onPressLink");
|
|
1030
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1031
|
+
this.descriptor.tag,
|
|
1032
|
+
PDF_VIEW_TYPE,
|
|
1033
|
+
{
|
|
1034
|
+
type: 'onChange',
|
|
1035
|
+
message: `linkPressed|${url}`
|
|
1036
|
+
}
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
onScaleChanged(currentScale: number) {
|
|
1041
|
+
Logger.info("[RNOH]:enter scaleChanged");
|
|
1042
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1043
|
+
this.descriptor.tag,
|
|
1044
|
+
PDF_VIEW_TYPE,
|
|
1045
|
+
{
|
|
1046
|
+
type: 'onChange',
|
|
1047
|
+
message: `scaleChanged|${currentScale}`
|
|
1048
|
+
}
|
|
1049
|
+
);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
onChange() {
|
|
1053
|
+
Logger.info("[RNOH]:onChange not support");
|
|
1054
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1055
|
+
this.descriptor.tag,
|
|
1056
|
+
PDF_VIEW_TYPE,
|
|
1057
|
+
{
|
|
1058
|
+
type: 'onChange',
|
|
1059
|
+
message: ON_PROGRESS_CHANGE
|
|
1060
|
+
}
|
|
1061
|
+
);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
build() {
|
|
1065
|
+
RNViewBase({ ctx: this.ctx, tag: this.tag }) {
|
|
1066
|
+
if (this.descriptor.rawProps.path) {
|
|
1067
|
+
PdfView(
|
|
1068
|
+
{
|
|
1069
|
+
controller: this.pdfController,
|
|
1070
|
+
pageLayout: pdfService.PageLayout.LAYOUT_SINGLE,
|
|
1071
|
+
isContinuous: true,
|
|
1072
|
+
pageFit: pdfService.PageFit.FIT_WIDTH,
|
|
1073
|
+
showScroll: this.scrollEnabled
|
|
1074
|
+
}
|
|
1075
|
+
)
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function arrayToRecord(headers: Array<Headers>): Record<string, Object> {
|
|
1081
|
+
const record: Record<string, Object> = {}
|
|
1082
|
+
headers.forEach(item => {
|
|
1083
|
+
record[item.key] = item.value
|
|
1084
|
+
})
|
|
1085
|
+
return record
|
|
1086
|
+
}
|
|
1087
|
+
function assignHeader(headers: Array<Headers>, ...source: Record<string, Object>[]): Record<string, Object> {
|
|
1088
|
+
const target = arrayToRecord(headers)
|
|
1089
|
+
for(let s of source){
|
|
1090
|
+
for(let k of Object.keys(s)){
|
|
1091
|
+
target[k] = Reflect.get(s, k)
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
return target
|
|
1095
|
+
}�rE��version�mappings�names�sources�sourcesContent�G���������������������!��"��$��4���N���M���������Q�c���R)������������K�f��������������������������������������������������������������������������������������\���]����`�����c���d���e���e���f���g���h����k����m���n����������w���x���y���z���{���}���~���̀��́ ��̂
|
|
1096
|
+
��̃���̅���̇����̊����̌����̎��̏�������̖��̗�����̚����̝��̝��̞��̟��̠���̢��̣��̤����̧���̩��̪��̫��̬���̮��̯���̱��̲���̴��̵���̷��̸���̺��̻���̽��̾������������� ����
|
|
1097
|
+
����
|
|
1098
|
+
���������
|
|
1099
|
+
����
|
|
1100
|
+
����������������������������������������������� ����������������������������������������������������������
|
|
1101
|
+
������
|
|
1102
|
+
����
|
|
1103
|
+
����
|
|
1104
|
+
����
|
|
1105
|
+
���������
|
|
1106
|
+
���������
|
|
1107
|
+
�������
|
|
1108
|
+
�������������������� ������������������
|
|
1109
|
+
�������
|
|
1110
|
+
���
|
|
1111
|
+
���
|
|
1112
|
+
���������������������� ���!������&������*���+���,����.���.���/����1���2������6�����9����;���<���=���>���>���?���@���A������F������K����M���M ����O���P����R���S���T���U���V����X�����[���\���^����a����c���d���e���f���g���h���i���i
|
|
1113
|
+
* MIT License
|
|
1114
|
+
*
|
|
1115
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
1116
|
+
*
|
|
1117
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1118
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
1119
|
+
* in the Software without restriction, including without limitation the rights
|
|
1120
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1121
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
1122
|
+
* furnished to do so, subject to the following conditions:
|
|
1123
|
+
*
|
|
1124
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
1125
|
+
* copies or substantial portions of the Software.
|
|
1126
|
+
*
|
|
1127
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1128
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1129
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1130
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1131
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1132
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1133
|
+
* SOFTWARE.
|
|
1134
|
+
*/
|
|
1135
|
+
|
|
1136
|
+
import { Descriptor, ComponentBuilderContext, ViewRawProps, ViewBaseProps } from '@rnoh/react-native-openharmony';
|
|
1137
|
+
import { RNOHContext, RNViewBase } from '@rnoh/react-native-openharmony';
|
|
1138
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
1139
|
+
import fs from '@ohos.file.fs';
|
|
1140
|
+
import request from '@ohos.request';
|
|
1141
|
+
import buffer from '@ohos.buffer';
|
|
1142
|
+
import cryptoFramework from '@ohos.security.cryptoFramework';
|
|
1143
|
+
import { pdfService, pdfViewManager, PdfView } from '@kit.PDFKit'
|
|
1144
|
+
import { common } from '@kit.AbilityKit';
|
|
1145
|
+
import { ON_PROGRESS_CHANGE } from './types';
|
|
1146
|
+
import Logger from '../../Logger';
|
|
1147
|
+
|
|
1148
|
+
export const PDF_VIEW_TYPE: string = "RTNPdfView";
|
|
1149
|
+
|
|
1150
|
+
export interface PdfViewState {}
|
|
1151
|
+
|
|
1152
|
+
interface Headers {
|
|
1153
|
+
key: string;
|
|
1154
|
+
value: string;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
interface Source {
|
|
1158
|
+
uri: string;
|
|
1159
|
+
headers?: Array<Headers>;
|
|
1160
|
+
cache?: boolean;
|
|
1161
|
+
cacheFileName?: string;
|
|
1162
|
+
expiration?: number;
|
|
1163
|
+
method?: string;
|
|
1164
|
+
};
|
|
1165
|
+
|
|
1166
|
+
export interface PdfViewRawProps extends ViewRawProps {
|
|
1167
|
+
source: Source,
|
|
1168
|
+
path?: string,
|
|
1169
|
+
page?: number,
|
|
1170
|
+
scale?: number,
|
|
1171
|
+
minScale?: number,
|
|
1172
|
+
maxScale?: number,
|
|
1173
|
+
horizontal?: boolean,
|
|
1174
|
+
enablePaging?: boolean,
|
|
1175
|
+
enableRTL?: boolean,
|
|
1176
|
+
enableAnnotationRendering?: boolean,
|
|
1177
|
+
showsHorizontalScrollIndicator?: boolean,
|
|
1178
|
+
showsVerticalScrollIndicator?: boolean,
|
|
1179
|
+
scrollEnabled?: boolean,
|
|
1180
|
+
enableAntialiasing?: boolean,
|
|
1181
|
+
fitPolicy?: number,
|
|
1182
|
+
spacing?: number,
|
|
1183
|
+
password?: string,
|
|
1184
|
+
singlePage?: boolean,
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
export type PdfViewDescriptor = Descriptor<'RTNPdfView', ViewBaseProps, PdfViewState, PdfViewRawProps>
|
|
1188
|
+
|
|
1189
|
+
@Component
|
|
1190
|
+
export struct RTNPdfView {
|
|
1191
|
+
ctx!: RNOHContext;
|
|
1192
|
+
tag: number = 0;
|
|
1193
|
+
@BuilderParam buildCustomComponent: (componentBuilderContext: ComponentBuilderContext) => void = this.emptyBuild;
|
|
1194
|
+
@State descriptor: PdfViewDescriptor = Object() as PdfViewDescriptor;
|
|
1195
|
+
@State pageIndex: number = 1;
|
|
1196
|
+
@State controllerStatus: boolean = false;
|
|
1197
|
+
@State pdfUrl: string = "";
|
|
1198
|
+
@State scrollEnabled: boolean = false;
|
|
1199
|
+
private unregisterDescriptorChangesListener?: () => void = undefined;
|
|
1200
|
+
private cleanupCommandCallback?: () => void = undefined;
|
|
1201
|
+
private pdfController: pdfViewManager.PdfController = new pdfViewManager.PdfController();
|
|
1202
|
+
|
|
1203
|
+
@Builder
|
|
1204
|
+
emptyBuild(ctx: ComponentBuilderContext) {
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
async doLoadHttpDocument(path: string): Promise<void> {
|
|
1208
|
+
Logger.debug(`[RTNPdfView]: doLoadHttpDocument, path is ${path}`);
|
|
1209
|
+
try {
|
|
1210
|
+
const filePath: string = await this.downloadHttpFile(path);
|
|
1211
|
+
Logger.debug(`[RTNPdfView]: doLoadHttpDocument, filePath is ${filePath}`);
|
|
1212
|
+
this.doLoadLocalDocument(filePath, !this.descriptor.rawProps.source?.cache);
|
|
1213
|
+
} catch (e) {
|
|
1214
|
+
Logger.error(`[RTNPdfView]: fs accessSync: ${e}`);
|
|
1215
|
+
this.onError(`[RTNPdfView]: fs accessSync: ${e}`);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
doLoadLocalDocument(filePath: string, isDelOriginFile: boolean = true): void {
|
|
1220
|
+
let initPageIndex: number | undefined = this.descriptor.rawProps.page;
|
|
1221
|
+
let spacing: number = Number(this.descriptor.rawProps.spacing);
|
|
1222
|
+
let scale: number = Number(this.descriptor.rawProps.scale);
|
|
1223
|
+
let minScale: number | undefined = this.descriptor.rawProps.minScale;
|
|
1224
|
+
let maxScale: number | undefined = this.descriptor.rawProps.maxScale;
|
|
1225
|
+
let password: string | undefined = this.descriptor.rawProps.password;
|
|
1226
|
+
let fitPolicy: number | undefined = this.descriptor.rawProps.fitPolicy;
|
|
1227
|
+
// pdfView 初始 scale
|
|
1228
|
+
let systemInitScale = 0;
|
|
1229
|
+
|
|
1230
|
+
Logger.debug(`[RTNPdfView]: doLoadLocalDocument, filePath is ${filePath}, isDelOriginFile is ${isDelOriginFile}`);
|
|
1231
|
+
const progressCallBack: (progress: number) => number = (progress: number) => {
|
|
1232
|
+
Logger.debug(`[RTNPdfView]: proress is ${(progress / 100).toFixed(2)}`);
|
|
1233
|
+
this.loadProgress(Number((progress / 100).toFixed(2)));
|
|
1234
|
+
return 0;
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
if (filePath) {
|
|
1238
|
+
this.pdfController.releaseDocument();
|
|
1239
|
+
const initPage = initPageIndex ? Math.max(initPageIndex - 1, 0) : 0
|
|
1240
|
+
this.pdfController.loadDocument(filePath, password, initPage, progressCallBack)
|
|
1241
|
+
.then((res: pdfService.ParseResult) => {
|
|
1242
|
+
switch (res) {
|
|
1243
|
+
case pdfService.ParseResult.PARSE_SUCCESS:
|
|
1244
|
+
this.pdfController.setPageSpacing(spacing, spacing); //由于rn侧值传递一个参数,故此处默认为连续滚动模式。设置上下面的间距。
|
|
1245
|
+
this.pdfController.setPageZoom(scale);
|
|
1246
|
+
const pageCount: number = this.pdfController.getPageCount();
|
|
1247
|
+
if (typeof fitPolicy === 'number') {
|
|
1248
|
+
if (fitPolicy === 0) {
|
|
1249
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_WIDTH);
|
|
1250
|
+
} else if (fitPolicy === 1) {
|
|
1251
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_HEIGHT);
|
|
1252
|
+
} else if (fitPolicy === 2) {
|
|
1253
|
+
this.pdfController.setPageFit(pdfService.PageFit.FIT_PAGE);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
// 注册监听器
|
|
1258
|
+
let tempScale: number | undefined = scale;
|
|
1259
|
+
this.pdfController.registerScaleChangedListener((currentScale: number) => {
|
|
1260
|
+
if (tempScale !== currentScale) {
|
|
1261
|
+
if (typeof maxScale === 'number' && currentScale > maxScale) {
|
|
1262
|
+
this.pdfController.setPageZoom(maxScale);
|
|
1263
|
+
} else if (typeof minScale === 'number' && currentScale < minScale) {
|
|
1264
|
+
// 问题:当minScale为1时,其他平台不缩放,但鸿蒙pdfView的初始scale小于1,在这里会强制赋值为1,这样就会放大产生滚动,引起和其他平台不一致的效果
|
|
1265
|
+
// 解决:systemInitScale为0时,currentScale表示pdfView初始scale,若小于minScale,则赋值给minScale,这样就不会强制赋值为1而产生缩放
|
|
1266
|
+
if (!systemInitScale && minScale === 1) {
|
|
1267
|
+
systemInitScale = currentScale
|
|
1268
|
+
minScale = systemInitScale;
|
|
1269
|
+
} else {
|
|
1270
|
+
this.pdfController.setPageZoom(minScale);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
tempScale = currentScale;
|
|
1274
|
+
}
|
|
1275
|
+
this.onScaleChanged(currentScale);
|
|
1276
|
+
});
|
|
1277
|
+
this.pdfController.registerPageChangedListener((pageIndex: number) => {
|
|
1278
|
+
this.onPageChanged((pageIndex + 1), pageCount);
|
|
1279
|
+
});
|
|
1280
|
+
this.pdfController.registerActionClickListener((redirectInfo: pdfViewManager.RedirectInfo) => {
|
|
1281
|
+
this.onPressLink(redirectInfo.content);
|
|
1282
|
+
});
|
|
1283
|
+
this.loadComplete(pageCount, filePath,);
|
|
1284
|
+
Logger.debug(`[RTNPdfView]: loadDocument success`);
|
|
1285
|
+
break;
|
|
1286
|
+
case pdfService.ParseResult.PARSE_ERROR_FILE:
|
|
1287
|
+
this.onError('loadDocument error: PARSE_ERROR_FILE');
|
|
1288
|
+
break;
|
|
1289
|
+
case pdfService.ParseResult.PARSE_ERROR_FORMAT:
|
|
1290
|
+
this.onError('loadDocument error: PARSE_ERROR_FORMAT');
|
|
1291
|
+
break;
|
|
1292
|
+
case pdfService.ParseResult.PARSE_ERROR_PASSWORD:
|
|
1293
|
+
this.onError('loadDocument error: PARSE_ERROR_PASSWORD');
|
|
1294
|
+
break;
|
|
1295
|
+
case pdfService.ParseResult.PARSE_ERROR_HANDLER:
|
|
1296
|
+
this.onError('loadDocument error: PARSE_ERROR_HANDLER');
|
|
1297
|
+
break;
|
|
1298
|
+
case pdfService.ParseResult.PARSE_ERROR_CERT:
|
|
1299
|
+
this.onError('loadDocument error: PARSE_ERROR_CERT');
|
|
1300
|
+
break;
|
|
1301
|
+
default:
|
|
1302
|
+
this.onError('loadDocument error: UNKNOWN');
|
|
1303
|
+
break;
|
|
1304
|
+
}
|
|
1305
|
+
})
|
|
1306
|
+
.catch((e: Error) => {
|
|
1307
|
+
Logger.error(`[RTNPdfView]: loadDocument error: ${e}`);
|
|
1308
|
+
this.onError(e.message);
|
|
1309
|
+
})
|
|
1310
|
+
.finally(() => {
|
|
1311
|
+
Logger.debug(`[RTNPdfView]: isDelOriginFile is : ${isDelOriginFile}`);
|
|
1312
|
+
if (isDelOriginFile) {
|
|
1313
|
+
fs.unlink(filePath).then(() => {
|
|
1314
|
+
Logger.debug(`[RTNPdfView]: originFile deleted`);
|
|
1315
|
+
})
|
|
1316
|
+
}
|
|
1317
|
+
})
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
async downloadHttpFile(url: string): Promise<string> {
|
|
1322
|
+
let context = getContext(this) as common.UIAbilityContext;
|
|
1323
|
+
let filesDir = context.filesDir;
|
|
1324
|
+
let res: string = "";
|
|
1325
|
+
const hashFileName: string = await this.processFileName(url);
|
|
1326
|
+
const cacheFileName = await this.checkCache(hashFileName);
|
|
1327
|
+
if(this.descriptor.rawProps.source?.cache && !!cacheFileName){
|
|
1328
|
+
res = cacheFileName;
|
|
1329
|
+
}else{
|
|
1330
|
+
if (!!cacheFileName && fs.accessSync(cacheFileName)) {
|
|
1331
|
+
fs.unlinkSync(cacheFileName);
|
|
1332
|
+
}
|
|
1333
|
+
const fullFileName: string = filesDir + "/" + hashFileName + new Date().getTime() + '.pdf';
|
|
1334
|
+
res = await this.downloadAction(context, url, fullFileName, {}, 0);
|
|
1335
|
+
}
|
|
1336
|
+
Logger.info(`[RTNPdfView]:res: ${res}`);
|
|
1337
|
+
return res;
|
|
1338
|
+
}
|
|
1339
|
+
async downloadAction(
|
|
1340
|
+
context: Context,
|
|
1341
|
+
url: string,
|
|
1342
|
+
fullFileName: string,
|
|
1343
|
+
distHeaders: Record<string, Object>,
|
|
1344
|
+
redirectCount: number = 0,
|
|
1345
|
+
): Promise<string> {
|
|
1346
|
+
if (redirectCount > 5) {
|
|
1347
|
+
throw new Error("Too many redirects");
|
|
1348
|
+
}
|
|
1349
|
+
return new Promise((resolve, reject) => {
|
|
1350
|
+
// 获取应用文件路径
|
|
1351
|
+
try {
|
|
1352
|
+
Logger.info(`[RTNPdfView]: start downloadFile`);
|
|
1353
|
+
const config: request.agent.Config = {
|
|
1354
|
+
action: request.agent.Action.DOWNLOAD,
|
|
1355
|
+
url,
|
|
1356
|
+
method: this.descriptor.rawProps.source.method ?? 'GET',
|
|
1357
|
+
headers: assignHeader(this.descriptor.rawProps.source?.headers || [], distHeaders|| {}),
|
|
1358
|
+
saveas: fullFileName,
|
|
1359
|
+
overwrite: true,
|
|
1360
|
+
mode: request.agent.Mode.FOREGROUND
|
|
1361
|
+
};
|
|
1362
|
+
request.agent.create(context, config).then((task: request.agent.Task) => {
|
|
1363
|
+
task.on('completed', () => {
|
|
1364
|
+
Logger.info(`[RTNPdfView]: finish downloadFile`);
|
|
1365
|
+
resolve(fullFileName);
|
|
1366
|
+
})
|
|
1367
|
+
task.on('failed', (progress: request.agent.Progress) => {
|
|
1368
|
+
console.info('[RTNPdfView]: downloadFile failed.', JSON.stringify(progress));
|
|
1369
|
+
});
|
|
1370
|
+
task.on('response', async (response: request.agent.HttpResponse) => {
|
|
1371
|
+
console.info('[RTNPdfView]: downloadFile response.', JSON.stringify(response));
|
|
1372
|
+
if (response.statusCode > 300 && response.statusCode < 400) {
|
|
1373
|
+
let redirectUrl: string = response.headers.get('location')?.toString() ?? '';
|
|
1374
|
+
let cookie: string = response.headers.get('set-cookie')?.toString() ?? '';
|
|
1375
|
+
task.off('progress');
|
|
1376
|
+
task.off('completed');
|
|
1377
|
+
task.off('response');
|
|
1378
|
+
task.stop();
|
|
1379
|
+
try {
|
|
1380
|
+
const result = await this.downloadAction(context, redirectUrl, fullFileName, { 'cookie': cookie }, redirectCount + 1);
|
|
1381
|
+
|
|
1382
|
+
Logger.info(`[RTNPdfView]:result: ${result} -----count: ${redirectCount}}`);
|
|
1383
|
+
resolve(result)
|
|
1384
|
+
} catch (e) {
|
|
1385
|
+
reject(e);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
task.start();
|
|
1390
|
+
}).catch((err: BusinessError) => {
|
|
1391
|
+
Logger.info(`[RTNPdfView]: error downloadHttpFile`);
|
|
1392
|
+
this.onError(err.message);
|
|
1393
|
+
reject("downloadFile failed" + err.message);
|
|
1394
|
+
});
|
|
1395
|
+
} catch (error) {
|
|
1396
|
+
Logger.info(`[RTNPdfView]: error downloadHttpFile`);
|
|
1397
|
+
let err: BusinessError = error as BusinessError;
|
|
1398
|
+
this.onError(err.message);
|
|
1399
|
+
reject("downloadFile failed" + err.message);
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
async processFileName(originalURL: string): Promise<string> {
|
|
1405
|
+
return new Promise(async (resolve, reject) => {
|
|
1406
|
+
let mdAlgName = 'SHA256'; // 摘要算法名
|
|
1407
|
+
let md = cryptoFramework.createMd(mdAlgName);
|
|
1408
|
+
try {
|
|
1409
|
+
await md.update({ data: new Uint8Array(buffer.from(originalURL, 'utf-8').buffer) });
|
|
1410
|
+
let mdResult: cryptoFramework.DataBlob = await md.digest();
|
|
1411
|
+
const fileName: string = buffer.from(mdResult.data).toString('hex');
|
|
1412
|
+
Logger.info(`[RTNPdfView]: fileName: ${fileName}`);
|
|
1413
|
+
resolve(fileName);
|
|
1414
|
+
} catch (e) {
|
|
1415
|
+
this.onError(e.message);
|
|
1416
|
+
reject("processFileName error");
|
|
1417
|
+
}
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
async checkCache(hashFileName: string): Promise<string> {
|
|
1421
|
+
try {
|
|
1422
|
+
let filesDir = (getContext() as common.UIAbilityContext).filesDir;
|
|
1423
|
+
let cacheFileName: string = "";
|
|
1424
|
+
let fileList = fs.listFileSync(filesDir);
|
|
1425
|
+
fileList.forEach(file=>{
|
|
1426
|
+
let _hashFileName = file.slice(0, -17);
|
|
1427
|
+
_hashFileName === hashFileName && (cacheFileName = filesDir + "/" + file);
|
|
1428
|
+
})
|
|
1429
|
+
return Promise.resolve(cacheFileName);
|
|
1430
|
+
} catch (e) {
|
|
1431
|
+
this.onError(e.message);
|
|
1432
|
+
return Promise.reject("checkCache error");
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
async sendToSandBox(assetPath: string): Promise<string> {
|
|
1437
|
+
assetPath = assetPath!.replace("asset://", "assets/");
|
|
1438
|
+
Logger.info(`[RTNPdfView]: load pdf assetPath: ${assetPath}`);
|
|
1439
|
+
const hashFileName: string = await this.processFileName(assetPath);
|
|
1440
|
+
const cacheFileName = await this.checkCache(hashFileName);
|
|
1441
|
+
let fileFullPath: string = "";
|
|
1442
|
+
|
|
1443
|
+
if(this.descriptor.rawProps.source?.cache && !!cacheFileName){
|
|
1444
|
+
fileFullPath = cacheFileName;
|
|
1445
|
+
}else{
|
|
1446
|
+
if (!!cacheFileName && fs.accessSync(cacheFileName)) {
|
|
1447
|
+
fs.unlinkSync(cacheFileName);
|
|
1448
|
+
}
|
|
1449
|
+
// 需将pdf文档复制到沙箱路径下
|
|
1450
|
+
let context = getContext() as common.UIAbilityContext;
|
|
1451
|
+
let content = context.resourceManager.getRawFileContentSync(`${assetPath}`); // pdf_reference
|
|
1452
|
+
let dir = context.filesDir;
|
|
1453
|
+
fileFullPath = dir + '/' + hashFileName + new Date().getTime() + '.pdf';
|
|
1454
|
+
Logger.info(`[RTNPdfView]: load pdf filePath: ${fileFullPath}`);
|
|
1455
|
+
let res = fs.accessSync(fileFullPath);
|
|
1456
|
+
Logger.info(`[RTNPdfView]: fs accessSync: ${res}`);
|
|
1457
|
+
let fdSand = fs.openSync(fileFullPath, fs.OpenMode.WRITE_ONLY | fs.OpenMode.CREATE | fs.OpenMode.TRUNC);
|
|
1458
|
+
fs.writeSync(fdSand.fd, content.buffer);
|
|
1459
|
+
fs.closeSync(fdSand.fd);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
return fileFullPath;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
async updateSource() {
|
|
1466
|
+
let src: string | undefined = this.descriptor.rawProps.path;
|
|
1467
|
+
Logger.info(`[RTNPdfView]: src is ${src}`);
|
|
1468
|
+
if (src) {
|
|
1469
|
+
this.pdfUrl = src;
|
|
1470
|
+
this.scrollEnabled = this.descriptor.rawProps.scrollEnabled ?? false
|
|
1471
|
+
if (src!.startsWith('http://') || src!.startsWith('https://')) {
|
|
1472
|
+
this.doLoadHttpDocument(src); // 适配加载在线文件
|
|
1473
|
+
} else {
|
|
1474
|
+
let isDeleteOriginFile: boolean = false;
|
|
1475
|
+
if (src!.startsWith('asset://')) { // 适配require('../assets/test.pdf')
|
|
1476
|
+
src = await this.sendToSandBox(src);
|
|
1477
|
+
isDeleteOriginFile = true;
|
|
1478
|
+
}
|
|
1479
|
+
this.doLoadLocalDocument(src, isDeleteOriginFile); // 适配本地其他目录,比如cache
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
aboutToAppear() {
|
|
1485
|
+
this.descriptor = this.ctx.descriptorRegistry.getDescriptor<PdfViewDescriptor>(this.tag);
|
|
1486
|
+
this.updateSource();
|
|
1487
|
+
this.unregisterDescriptorChangesListener = this.ctx.descriptorRegistry.subscribeToDescriptorChanges(this.tag,
|
|
1488
|
+
(newDescriptor) => {
|
|
1489
|
+
this.descriptor = (newDescriptor as PdfViewDescriptor)
|
|
1490
|
+
this.updateSource();
|
|
1491
|
+
}
|
|
1492
|
+
)
|
|
1493
|
+
this.cleanupCommandCallback = this.ctx.componentCommandReceiver.registerCommandCallback(
|
|
1494
|
+
this.tag,
|
|
1495
|
+
(command, args: (boolean | number)[]) => {
|
|
1496
|
+
Logger.info(`[RNOH]: HarmonyOS does not support,command: ${command}, arg: ${args[0]}`);
|
|
1497
|
+
this.pageIndex = args[0] as number;
|
|
1498
|
+
this.pdfUrl = "";
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
aboutToDisappear() {
|
|
1503
|
+
this.cleanupCommandCallback?.();
|
|
1504
|
+
this.unregisterDescriptorChangesListener?.();
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
loadComplete(numberOfPages: number, filePath: string) {
|
|
1508
|
+
Logger.info("[RNOH]:enter loadComplete");
|
|
1509
|
+
|
|
1510
|
+
// 获取页面宽度、高度
|
|
1511
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1512
|
+
this.descriptor.tag,
|
|
1513
|
+
PDF_VIEW_TYPE,
|
|
1514
|
+
{
|
|
1515
|
+
type: 'onChange',
|
|
1516
|
+
message: `loadComplete|${numberOfPages}|100|100`
|
|
1517
|
+
}
|
|
1518
|
+
);
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
loadProgress(percent: number) {
|
|
1522
|
+
Logger.info("[RNOH]:enter loadProgress");
|
|
1523
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1524
|
+
this.descriptor.tag,
|
|
1525
|
+
PDF_VIEW_TYPE,
|
|
1526
|
+
{
|
|
1527
|
+
type: 'onChange',
|
|
1528
|
+
message: `loadProgress|${percent}`
|
|
1529
|
+
}
|
|
1530
|
+
);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
onError(e: string) {
|
|
1534
|
+
Logger.info("[RNOH]:enter onError");
|
|
1535
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1536
|
+
this.descriptor.tag,
|
|
1537
|
+
PDF_VIEW_TYPE,
|
|
1538
|
+
{
|
|
1539
|
+
type: 'onChange',
|
|
1540
|
+
message: `error|${e}`
|
|
1541
|
+
}
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
onPageChanged(page: number, numberOfPages: number) {
|
|
1546
|
+
Logger.info("[RNOH]:enter pageChanged");
|
|
1547
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1548
|
+
this.descriptor.tag,
|
|
1549
|
+
PDF_VIEW_TYPE,
|
|
1550
|
+
{
|
|
1551
|
+
type: 'onChange',
|
|
1552
|
+
message: `pageChanged|${page}|${numberOfPages}`
|
|
1553
|
+
}
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
onPressLink(url: string) {
|
|
1558
|
+
Logger.info("[RNOH]:enter onPressLink");
|
|
1559
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1560
|
+
this.descriptor.tag,
|
|
1561
|
+
PDF_VIEW_TYPE,
|
|
1562
|
+
{
|
|
1563
|
+
type: 'onChange',
|
|
1564
|
+
message: `linkPressed|${url}`
|
|
1565
|
+
}
|
|
1566
|
+
);
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
onScaleChanged(currentScale: number) {
|
|
1570
|
+
Logger.info("[RNOH]:enter scaleChanged");
|
|
1571
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1572
|
+
this.descriptor.tag,
|
|
1573
|
+
PDF_VIEW_TYPE,
|
|
1574
|
+
{
|
|
1575
|
+
type: 'onChange',
|
|
1576
|
+
message: `scaleChanged|${currentScale}`
|
|
1577
|
+
}
|
|
1578
|
+
);
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
onChange() {
|
|
1582
|
+
Logger.info("[RNOH]:onChange not support");
|
|
1583
|
+
this.ctx.rnInstance.emitComponentEvent(
|
|
1584
|
+
this.descriptor.tag,
|
|
1585
|
+
PDF_VIEW_TYPE,
|
|
1586
|
+
{
|
|
1587
|
+
type: 'onChange',
|
|
1588
|
+
message: ON_PROGRESS_CHANGE
|
|
1589
|
+
}
|
|
1590
|
+
);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
build() {
|
|
1594
|
+
RNViewBase({ ctx: this.ctx, tag: this.tag }) {
|
|
1595
|
+
if (this.descriptor.rawProps.path) {
|
|
1596
|
+
PdfView(
|
|
1597
|
+
{
|
|
1598
|
+
controller: this.pdfController,
|
|
1599
|
+
pageLayout: pdfService.PageLayout.LAYOUT_SINGLE,
|
|
1600
|
+
isContinuous: true,
|
|
1601
|
+
pageFit: pdfService.PageFit.FIT_WIDTH,
|
|
1602
|
+
showScroll: this.scrollEnabled
|
|
1603
|
+
}
|
|
1604
|
+
)
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
function arrayToRecord(headers: Array<Headers>): Record<string, Object> {
|
|
1610
|
+
const record: Record<string, Object> = {}
|
|
1611
|
+
headers.forEach(item => {
|
|
1612
|
+
record[item.key] = item.value
|
|
1613
|
+
})
|
|
1614
|
+
return record
|
|
1615
|
+
}
|
|
1616
|
+
function assignHeader(headers: Array<Headers>, ...source: Record<string, Object>[]): Record<string, Object> {
|
|
1617
|
+
const target = arrayToRecord(headers)
|
|
1618
|
+
for(let s of source){
|
|
1619
|
+
for(let k of Object.keys(s)){
|
|
1620
|
+
target[k] = Reflect.get(s, k)
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
return target
|
|
1624
|
+
}�rF��@ohos.file.fs�@ohos.request�@ohos.buffer�@ohos.security.cryptoFramework�@hms.officeservice.pdfservice�@hms.officeservice.PdfView�./types�../../Logger�@rnoh/react-native-openharmony�rG��assertions�external�id�meta�moduleSideEffects�resolvedBy�syntheticNamedExportsA��ghvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_openharmony_ets_api_@ohos.file.fs.d.ts�rH��hostModulesInfo�D�@ohos.file.fs�pdfviewêoh-resolve�GA��ghvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_openharmony_ets_api_@ohos.request.d.tsH�D�@ohos.request�pdfviewêoh-resolve�GA��fhvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_openharmony_ets_api_@ohos.buffer.d.tsH�D�@ohos.buffer�pdfviewêoh-resolve�GA��xhvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_openharmony_ets_api_@ohos.security.cryptoFramework.d.tsH�D�@ohos.security.cryptoFramework�pdfviewêoh-resolve�GA��ohvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_hms_ets_api_@hms.officeservice.pdfservice.d.tsH�D�@hms.officeservice.pdfservice�pdfviewêoh-resolve�GA��mhvigor_ignore_C:_Program Files_Huawei_DevEco Studio_sdk_default_hms_ets_api_@hms.officeservice.PdfView.d.etsH�D�@hms.officeservice.PdfView�pdfviewêoh-resolve�GA��[E:\gitcode\rntpc_react-native-pdf\harmony\pdfview\src\main\ets\components\mainpage\types.tsAêoh-resolve�GA��IE:\gitcode\rntpc_react-native-pdf\harmony\pdfview\src\main\ets\Logger.etsAêoh-resolve�GAþ@rnoh/react-native-openharmonyH�D�@rnoh/react-native-openharmony�pdfviewêoh-resolve�rI��missing�pluginægenAbc��rJ��dynamicImportCache�exportAllDeclarationCache�exportNamedDeclarationCache�importCache����rK��type�start�end�declaration�specifiers�source�ExportNamedDeclaration�����rL��type�start�end�declarations�kind�VariableDeclaration������rM��type�start�end�id�init�VariableDeclarator�����rN��type�start�end�name�Identifier�����PDF_VIEW_TYPE�rO��type�start�end�value�raw�Literal�����RTNPdfView�"RTNPdfView"�const��K�ExportNamedDeclaration���n��rP��type�start�end�id�superClass�body�ClassDeclaration���n�N�Identifier���̪RTNPdfViewN�Identifier���ۦViewPU�rQ��type�start�end�body�ClassBody���n��#�rR��type�start�end�static�computed�key�kind�value�MethodDefinition�����N�Identifier����constructor�constructor�rS��type�start�end�id�expression�generator�async�params�body�FunctionExpression������N�Identifier�����parentN�Identifier�����paramsN�Identifier���
|
|
1625
|
+
�scrollEnabled�"scrollEnabled"V�ExpressionStatement��K[�AssignmentExpression��J�=\�MemberExpression��>X�ThisExpression��N�Identifier��>�#unregisterDescriptorChangesListener��N�Identifier�A�J�undefinedV�ExpressionStatement�U�}[�AssignmentExpression�U�|�=\�MemberExpression�U�pX�ThisExpression�U�YN�Identifier�Z�p�cleanupCommandCallback��N�Identifier�s�|�undefinedV�ExpressionStatement����[�AssignmentExpression�����=\�MemberExpression����X�ThisExpression����N�Identifier�����pdfController��]�NewExpression����\�MemberExpression����N�Identifier�����pdfViewManagerN�Identifier�����PdfController�V�ExpressionStatement����W�CallExpression����\�MemberExpression����X�ThisExpression����N�Identifier����setInitiallyProvidedValue�N�Identifier����params�V�ExpressionStatement���W�CallExpression���\�MemberExpression���X�ThisExpression����N�Identifier����finalizeConstruction��R�MethodDefinition�#�t��N�Identifier�#�<�setInitiallyProvidedValue�methodS�FunctionExpression�<�t���N�Identifier�=�C�paramsQ�BlockStatement�E�t�Y�IfStatement�P��Z�BinaryExpression�T�l\�MemberExpression�T�^N�Identifier�T�Z�paramsN�Identifier�[�^�ctx�£!==N�Identifier�c�l�undefinedQ�BlockStatement�n���V�ExpressionStatement�}��[�AssignmentExpression�}���=\�MemberExpression�}��X�ThisExpression�}��N�Identifier�����ctx��\�MemberExpression����N�Identifier�����paramsN�Identifier�����ctx���Y�IfStatement����Z�BinaryExpression����\�MemberExpression����N�Identifier�����paramsN�Identifier�����tag�£!==N�Identifier���ĩundefinedQ�BlockStatement�����V�ExpressionStatement����[�AssignmentExpression����=\�MemberExpression����X�ThisExpression����N�Identifier���ݣtag��\�MemberExpression����N�Identifier����paramsN�Identifier����tag���Y�IfStatement���Z�BinaryExpression��-\�MemberExpression��N�Identifier��
|
|
1626
|
+
�paramsN�Identifier���buildCustomComponent�£!==N�Identifier�$�-�undefinedQ�BlockStatement�/���V�ExpressionStatement�>�v[�AssignmentExpression�>�u�=\�MemberExpression�>�WX�ThisExpression�>�BN�Identifier�C�W�buildCustomComponent��\�MemberExpression�Z�uN�Identifier�Z�`�paramsN�Identifier�a�u�buildCustomComponent���Y�IfStatement����Z�BinaryExpression����\�MemberExpression����N�Identifier�����paramsN�Identifier�����descriptor�£!==N�Identifier�����undefinedQ�BlockStatement����V�ExpressionStatement����[�AssignmentExpression����=\�MemberExpression����X�ThisExpression����N�Identifier���Ϊdescriptor��\�MemberExpression����N�Identifier���צparamsN�Identifier����descriptor���Y�IfStatement��� XZ�BinaryExpression��� \�MemberExpression��� N�Identifier��� �paramsN�Identifier� � �pageIndex�£!==N�Identifier� � �undefinedQ�BlockStatement� � X�V�ExpressionStatement� +� M[�AssignmentExpression� +� L�=\�MemberExpression� +� 9X�ThisExpression� +� /N�Identifier� 0� 9�pageIndex��\�MemberExpression� <� LN�Identifier� <� B�paramsN�Identifier� C� L�pageIndex���Y�IfStatement� b� �Z�BinaryExpression� f� �\�MemberExpression� f� }N�Identifier� f� l�paramsN�Identifier� m� }�controllerStatus�£!==N�Identifier� �� ��undefinedQ�BlockStatement� �� בV�ExpressionStatement� �� �[�AssignmentExpression� �� ˡ=\�MemberExpression� �� �X�ThisExpression� �� �N�Identifier� �� ��controllerStatus��\�MemberExpression� �� �N�Identifier� �� ��paramsN�Identifier� �� ˰controllerStatus���Y�IfStatement� ��
|
|
1627
|
+
8Z�BinaryExpression� ��
|
|
1628
|
+
\�MemberExpression� �� �N�Identifier� �� �paramsN�Identifier� �� �pdfUrl�£!==N�Identifier� ��
|
|
1629
|
+
�undefinedQ�BlockStatement�
|
|
1630
|
+
�
|
|
1631
|
+
8�V�ExpressionStatement�
|
|
1632
|
+
�
|
|
1633
|
+
-[�AssignmentExpression�
|
|
1634
|
+
�
|
|
1635
|
+
,�=\�MemberExpression�
|
|
1636
|
+
�
|
|
1637
|
+
X�ThisExpression�
|
|
1638
|
+
�
|
|
1639
|
+
N�Identifier�
|
|
1640
|
+
�
|
|
1641
|
+
�pdfUrl��\�MemberExpression�
|
|
1642
|
+
�
|
|
1643
|
+
,N�Identifier�
|
|
1644
|
+
�
|
|
1645
|
+
%�paramsN�Identifier�
|
|
1646
|
+
&�
|
|
1647
|
+
,�pdfUrl���Y�IfStatement�
|
|
1648
|
+
B�
|
|
1649
|
+
�Z�BinaryExpression�
|
|
1650
|
+
F�
|
|
1651
|
+
h\�MemberExpression�
|
|
1652
|
+
F�
|
|
1653
|
+
ZN�Identifier�
|
|
1654
|
+
F�
|
|
1655
|
+
L�paramsN�Identifier�
|
|
1656
|
+
M�
|
|
1657
|
+
Z�scrollEnabled�£!==N�Identifier�
|
|
1658
|
+
_�
|
|
1659
|
+
h�undefinedQ�BlockStatement�
|
|
1660
|
+
j�
|
|
1661
|
+
��V�ExpressionStatement�
|
|
1662
|
+
y�
|
|
1663
|
+
�[�AssignmentExpression�
|
|
1664
|
+
y�
|
|
1665
|
+
��=\�MemberExpression�
|
|
1666
|
+
y�
|
|
1667
|
+
�X�ThisExpression�
|
|
1668
|
+
y�
|
|
1669
|
+
}N�Identifier�
|
|
1670
|
+
~�
|
|
1671
|
+
��scrollEnabled��\�MemberExpression�
|
|
1672
|
+
��
|
|
1673
|
+
�N�Identifier�
|
|
1674
|
+
��
|
|
1675
|
+
��paramsN�Identifier�
|
|
1676
|
+
��
|
|
1677
|
+
��scrollEnabled���Y�IfStatement�
|
|
1678
|
+
��fZ�BinaryExpression�
|
|
1679
|
+
��
|
|
1680
|
+
�\�MemberExpression�
|
|
1681
|
+
��
|
|
1682
|
+
�N�Identifier�
|
|
1683
|
+
��
|
|
1684
|
+
¦paramsN�Identifier�
|
|
1685
|
+
��
|
|
1686
|
+
��#unregisterDescriptorChangesListener�£!==N�Identifier�
|
|
1687
|
+
��
|
|
1688
|
+
��undefinedQ�BlockStatement�
|
|
1689
|
+
��f�V�ExpressionStatement��[[�AssignmentExpression��Z�=\�MemberExpression��-X�ThisExpression�� N�Identifier�
|
|
1690
|
+
�-�#unregisterDescriptorChangesListener��\�MemberExpression�0�ZN�Identifier�0�6�paramsN�Identifier�7�Z�#unregisterDescriptorChangesListener���Y�IfStatement�p��Z�BinaryExpression�t��\�MemberExpression�t��N�Identifier�t�z�paramsN�Identifier�{���cleanupCommandCallback�£!==N�Identifier�����undefinedQ�BlockStatement�����V�ExpressionStatement����[�AssignmentExpression����=\�MemberExpression����X�ThisExpression����N�Identifier���˶cleanupCommandCallback��\�MemberExpression����N�Identifier���ԦparamsN�Identifier����cleanupCommandCallback���Y�IfStatement��mZ�BinaryExpression��'\�MemberExpression��N�Identifier���paramsN�Identifier���pdfController�£!==N�Identifier��'�undefinedQ�BlockStatement�)�m�V�ExpressionStatement�8�b[�AssignmentExpression�8�a�=\�MemberExpression�8�JX�ThisExpression�8�<N�Identifier�=�J�pdfController��\�MemberExpression�M�aN�Identifier�M�S�paramsN�Identifier�T�a�pdfController���R�MethodDefinition�z����N�Identifier�z���updateStateVars�methodS�FunctionExpression�������N�Identifier�����paramsQ�BlockStatement�����R�MethodDefinition�����N�Identifier�����!purgeVariableDependenciesOnElmtId�methodS�FunctionExpression������N�Identifier���ʨrmElmtIdQ�BlockStatement����V�ExpressionStatement���
|
|
1691
|
+
\�MemberExpression���
|
|
1692
|
+
��controllerStatus�setS�FunctionExpression��]���N�Identifier��#�newValueQ�BlockStatement�%�]�V�ExpressionStatement�0�VW�CallExpression�0�U\�MemberExpression�0�K\�MemberExpression�0�GX�ThisExpression�0�4N�Identifier�5�G�__controllerStatus��N�Identifier�H�K�set�N�Identifier�L�T�newValue�R�MethodDefinition�c����N�Identifier�g�m�pdfUrl�getS�FunctionExpression�m�����Q�BlockStatement�p���^�ReturnStatement�{��W�CallExpression����\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier�����__pdfUrl��N�Identifier�����get��R�MethodDefinition������N�Identifier�����pdfUrl�setS�FunctionExpression�������N�Identifier�����newValueQ�BlockStatement����V�ExpressionStatement����W�CallExpression����\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier���Ш__pdfUrl��N�Identifier���ԣset�N�Identifier���ݨnewValue�R�MethodDefinition���4��N�Identifier�����scrollEnabled�getS�FunctionExpression���4���Q�BlockStatement��4�^�ReturnStatement��-W�CallExpression��,\�MemberExpression��*\�MemberExpression��&X�ThisExpression��N�Identifier��&�__scrollEnabled��N�Identifier�'�*�get��R�MethodDefinition�:����N�Identifier�>�K�scrollEnabled�setS�FunctionExpression�K�����N�Identifier�L�T�newValueQ�BlockStatement�V���V�ExpressionStatement�a��W�CallExpression�a��\�MemberExpression�a�y\�MemberExpression�a�uX�ThisExpression�a�eN�Identifier�f�u�__scrollEnabled��N�Identifier�v�y�set�N�Identifier�z���newValue�R�MethodDefinition������N�Identifier�����emptyBuild�methodS�FunctionExpression�������N�Identifier�����ctxT�AssignmentPattern����N�Identifier�����parentO�Literal������nullQ�BlockStatement�����R�MethodDefinition������N�Identifier���ֲdoLoadHttpDocument�methodS�FunctionExpression�������ÑN�Identifier���ۤpathQ�BlockStatement���ޒV�ExpressionStatement���*W�CallExpression���)\�MemberExpression����N�Identifier����LoggerN�Identifier�����debug��r_��type�start�end�expressions�quasis�TemplateLiteral���(�N�Identifier�"�&�path��r`��type�start�end�value�tail�TemplateElement��� �ra��raw�cooked�*[RTNPdfView]: doLoadHttpDocument, path is �*[RTNPdfView]: doLoadHttpDocument, path is �`�TemplateElement�'�'a�����rb��type�start�end�block�handler�finalizer�TryStatement�4��Q�BlockStatement�8�7�L�VariableDeclaration�G�z�M�VariableDeclarator�M�yN�Identifier�M�U�filePath^�AwaitExpression�X�yW�CallExpression�^�y\�MemberExpression�^�sX�ThisExpression�^�bN�Identifier�c�s�downloadHttpFile�N�Identifier�t�x�path¥constV�ExpressionStatement����W�CallExpression����\�MemberExpression����N�Identifier�����LoggerN�Identifier�����debug�_�TemplateLiteral���БN�Identifier���ΨfilePath�`�TemplateElement����a�.[RTNPdfView]: doLoadHttpDocument, filePath is �.[RTNPdfView]: doLoadHttpDocument, filePath is �`�TemplateElement����a����V�ExpressionStatement���,W�CallExpression���+\�MemberExpression����X�ThisExpression����N�Identifier�����doLoadLocalDocument�N�Identifier����filePathU�UnaryExpression��*�!�V�ChainExpression��*\�MemberExpression��*\�MemberExpression��#\�MemberExpression��\�MemberExpression��X�ThisExpression��N�Identifier� ��descriptor��N�Identifier���rawProps��N�Identifier��#�source��N�Identifier�%�*�cache����rc��type�start�end�param�body�CatchClause�A��N�Identifier�H�I�eQ�BlockStatement�K�גV�ExpressionStatement�Z��W�CallExpression�Z��\�MemberExpression�Z�fN�Identifier�Z�`�LoggerN�Identifier�a�f�error�_�TemplateLiteral�g���N�Identifier�����e�`�TemplateElement�h��a�[RTNPdfView]: fs accessSync: �[RTNPdfView]: fs accessSync: �`�TemplateElement����a����V�ExpressionStatement����W�CallExpression����\�MemberExpression����X�ThisExpression����N�Identifier�����onError�_�TemplateLiteral���ʑN�Identifier���ȡe�`�TemplateElement����a�[RTNPdfView]: fs accessSync: �[RTNPdfView]: fs accessSync: �`�TemplateElement����a�����R�MethodDefinition���+���N�Identifier�����doLoadLocalDocument�methodS�FunctionExpression���+����N�Identifier����filePathT�AssignmentPattern��N�Identifier���isDelOriginFileO�Literal��ätrueQ�BlockStatement��+��L�VariableDeclaration�%�W�M�VariableDeclarator�)�VN�Identifier�)�6�initPageIndex\�MemberExpression�9�V\�MemberExpression�9�Q\�MemberExpression�9�HX�ThisExpression�9�=N�Identifier�>�H�descriptor��N�Identifier�I�Q�rawProps��N�Identifier�R�V�page�£letL�VariableDeclaration�a���M�VariableDeclarator�e��N�Identifier�e�l�spacingW�CallExpression�o��N�Identifier�o�u�Number�\�MemberExpression�v��\�MemberExpression�v��\�MemberExpression�v��X�ThisExpression�v�zN�Identifier�{���descriptor��N�Identifier�����rawProps��N�Identifier�����spacing��£letL�VariableDeclaration���ՑM�VariableDeclarator����N�Identifier�����scaleW�CallExpression����N�Identifier�����Number�\�MemberExpression����\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier���Īdescriptor��N�Identifier���ͨrawProps��N�Identifier���ӥscale��£letL�VariableDeclaration����M�VariableDeclarator���N�Identifier����minScale\�MemberExpression���\�MemberExpression���\�MemberExpression����X�ThisExpression����N�Identifier�����descriptor��N�Identifier����rawProps��N�Identifier���minScale�£letL�VariableDeclaration��K�M�VariableDeclarator��JN�Identifier��&�maxScale\�MemberExpression�)�J\�MemberExpression�)�A\�MemberExpression�)�8X�ThisExpression�)�-N�Identifier�.�8�descriptor��N�Identifier�9�A�rawProps��N�Identifier�B�J�maxScale�£letL�VariableDeclaration�U���M�VariableDeclarator�Y��N�Identifier�Y�a�password\�MemberExpression�d��\�MemberExpression�d�|\�MemberExpression�d�sX�ThisExpression�d�hN�Identifier�i�s�descriptor��N�Identifier�t�|�rawProps��N�Identifier�}���password�£letL�VariableDeclaration���ÑM�VariableDeclarator����N�Identifier�����fitPolicy\�MemberExpression����\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier�����descriptor��N�Identifier�����rawProps��N�Identifier���©fitPolicy�£letL�VariableDeclaration����M�VariableDeclarator���N�Identifier�����systemInitScaleO�Literal���0�letV�ExpressionStatement��~W�CallExpression��}\�MemberExpression��N�Identifier���LoggerN�Identifier���debug�_�TemplateLiteral��|�N�Identifier�K�S�filePathN�Identifier�k�z�isDelOriginFile�`�TemplateElement��Ia�/[RTNPdfView]: doLoadLocalDocument, filePath is �/[RTNPdfView]: doLoadLocalDocument, filePath is �`�TemplateElement�T�ia�, isDelOriginFile is �, isDelOriginFile is �`�TemplateElement�{�{a����L�VariableDeclaration���n�M�VariableDeclarator���mN�Identifier�����progressCallBackS�ArrowFunctionExpression���m���N�Identifier�����progressQ�BlockStatement���m�V�ExpressionStatement���W�CallExpression���\�MemberExpression����N�Identifier���ĦLoggerN�Identifier���ʥdebug�_�TemplateLiteral����W�CallExpression���\�MemberExpression����Z�BinaryExpression����N�Identifier����progress�/O�Literal�����d�100N�Identifier�����toFixed�O�Literal���2`�TemplateElement����a�[RTNPdfView]: proress is �[RTNPdfView]: proress is �`�TemplateElement��a����V�ExpressionStatement��KW�CallExpression��J\�MemberExpression��%X�ThisExpression��N�Identifier��%�loadProgress�W�CallExpression�&�IN�Identifier�&�,�Number�W�CallExpression�-�H\�MemberExpression�-�EZ�BinaryExpression�.�<N�Identifier�.�6�progress�/O�Literal�9�<�d�100N�Identifier�>�E�toFixed�O�Literal�F�G�2���^�ReturnStatement�Y�bO�Literal�`�a�0�constY�IfStatement�x�+|N�Identifier�|���filePathQ�BlockStatement���+|�V�ExpressionStatement����W�CallExpression����\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier�����pdfController��N�Identifier�����releaseDocument��L�VariableDeclaration����M�VariableDeclarator���N�Identifier���֨initPageY�ConditionalExpression���N�Identifier����initPageIndexW�CallExpression���\�MemberExpression����N�Identifier�����MathN�Identifier����max�Z�BinaryExpression���N�Identifier�����initPageIndex�-O�Literal���1O�Literal���0�O�Literal�
|
|
1693
|
+
��0�constV�ExpressionStatement��+qW�CallExpression��+p\�MemberExpression��*+W�CallExpression��*\�MemberExpression��)�W�CallExpression��)m\�MemberExpression���W�CallExpression��i\�MemberExpression��9\�MemberExpression��,X�ThisExpression��N�Identifier��,�pdfController��N�Identifier�-�9�loadDocument�N�Identifier�:�B�filePathN�Identifier�D�L�passwordN�Identifier�N�V�initPageN�Identifier�X�h�progressCallBack�N�Identifier�|���then�S�ArrowFunctionExpression���)l���N�Identifier�����resQ�BlockStatement���)l��rd��type�start�end�discriminant�cases�SwitchStatement���)]N�Identifier�����res��re��type�start�end�consequent�test�SwitchCase���%:�V�ExpressionStatement��9W�CallExpression��8\�MemberExpression��&\�MemberExpression��X�ThisExpression�� N�Identifier�
|
|
1694
|
+
��pdfController��N�Identifier��&�setPageSpacing�N�Identifier�'�.�spacingN�Identifier�0�7�spacing�V�ExpressionStatement�y��W�CallExpression�y��\�MemberExpression�y��\�MemberExpression�y��X�ThisExpression�y�}N�Identifier�~���pdfController��N�Identifier�����setPageZoom�N�Identifier�����scale�L�VariableDeclaration����M�VariableDeclarator����N�Identifier���ȩpageCountW�CallExpression����\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier���ݭpdfController��N�Identifier����getPageCount�¥constY�IfStatement��cZ�BinaryExpression��(U�UnaryExpression���typeof�N�Identifier���fitPolicy�===O�Literal� �(�number�'number'Q�BlockStatement�*�c�Y�IfStatement�I�HZ�BinaryExpression�M�\N�Identifier�M�V�fitPolicy�===O�Literal�[�\�0Q�BlockStatement�^�ܑV�ExpressionStatement����W�CallExpression����\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier�����pdfController��N�Identifier�����setPageFit�\�MemberExpression����\�MemberExpression����N�Identifier�����pdfServiceN�Identifier�����PageFit��N�Identifier�����FIT_WIDTH���Y�IfStatement���HZ�BinaryExpression��N�Identifier���fitPolicy�===O�Literal���1Q�BlockStatement����V�ExpressionStatement�7�tW�CallExpression�7�s\�MemberExpression�7�T\�MemberExpression�7�IX�ThisExpression�7�;N�Identifier�<�I�pdfController��N�Identifier�J�T�setPageFit�\�MemberExpression�U�r\�MemberExpression�U�gN�Identifier�U�_�pdfServiceN�Identifier�`�g�PageFit��N�Identifier�h�r�FIT_HEIGHT���Y�IfStatement���HZ�BinaryExpression����N�Identifier���éfitPolicy�===O�Literal�����2Q�BlockStatement���H�V�ExpressionStatement���)W�CallExpression���(\�MemberExpression���\�MemberExpression���X�ThisExpression����N�Identifier����pdfController��N�Identifier���setPageFit�\�MemberExpression��'\�MemberExpression��N�Identifier���pdfServiceN�Identifier���PageFit��N�Identifier��'�FIT_PAGE�����L�VariableDeclaration�����M�VariableDeclarator����N�Identifier�����tempScaleN�Identifier�����scale�letV�ExpressionStatement���#W�CallExpression���#
|
|
1695
|
+
\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier����pdfController��N�Identifier�����registerScaleChangedListener�S�ArrowFunctionExpression���# ���N�Identifier���currentScaleQ�BlockStatement��# �Y�IfStatement�0�"�Z�BinaryExpression�4�NN�Identifier�4�=�tempScale�!==N�Identifier�B�N�currentScaleQ�BlockStatement�P�"��Y�IfStatement�s�"TZ�LogicalExpression�w��Z�BinaryExpression�w��U�UnaryExpression�w���typeof�N�Identifier�~���maxScale�===O�Literal�����number�'number'�&&Z�BinaryExpression����N�Identifier�����currentScale�>N�Identifier�����maxScaleQ�BlockStatement���#�V�ExpressionStatement���W�CallExpression����\�MemberExpression����\�MemberExpression����X�ThisExpression����N�Identifier����pdfController��N�Identifier�����setPageZoom�N�Identifier�����maxScale�Y�IfStatement�J�"TZ�LogicalExpression�N��Z�BinaryExpression�N�jU�UnaryExpression�N�]�typeof�N�Identifier�U�]�minScale�===O�Literal�b�j�number�'number'�&&Z�BinaryExpression�n��N�Identifier�n�z�currentScale�<N�Identifier�}���minScaleQ�BlockStatement���"T�Y�IfStatement� ��"1Z�LogicalExpression� �� �U�UnaryExpression� �� ��!�N�Identifier� �� ��systemInitScale�&&Z�BinaryExpression� �� �N�Identifier� �� ͨminScale�===O�Literal� �� ��1Q�BlockStatement� ��!��V�ExpressionStatement�!�![�AssignmentExpression�!�!�=N�Identifier�!�!�systemInitScaleN�Identifier�!�!�currentScaleV�ExpressionStatement�!I�!d[�AssignmentExpression�!I�!c�=N�Identifier�!I�!Q�minScaleN�Identifier�!T�!c�systemInitScaleQ�BlockStatement�!��"1�V�ExpressionStatement�!��"
|
|
1696
|
+
W�CallExpression�!��" \�MemberExpression�!��!�\�MemberExpression�!��!�X�ThisExpression�!��!�N�Identifier�!��!�pdfController��N�Identifier�!��!��setPageZoom�N�Identifier�"�"�minScale��V�ExpressionStatement�"v�"�[�AssignmentExpression�"v�"��=N�Identifier�"v�"�tempScaleN�Identifier�"��"��currentScale�V�ExpressionStatement�"��"�W�CallExpression�"��"�\�MemberExpression�"��"�X�ThisExpression�"��"�N�Identifier�"��"߮onScaleChanged�N�Identifier�"��"�currentScale��V�ExpressionStatement�#%�#�W�CallExpression�#%�#�\�MemberExpression�#%�#S\�MemberExpression�#%�#7X�ThisExpression�#%�#)N�Identifier�#*�#7�pdfController��N�Identifier�#8�#S�registerPageChangedListener�S�ArrowFunctionExpression�#T�#����N�Identifier�#U�#^�pageIndexQ�BlockStatement�#c�#̑V�ExpressionStatement�#��#�W�CallExpression�#��#�\�MemberExpression�#��#�X�ThisExpression�#��#�N�Identifier�#��#��onPageChanged�Z�BinaryExpression�#��#�N�Identifier�#��#��pageIndex�+O�Literal�#��#��1N�Identifier�#��#��pageCount��V�ExpressionStatement�#��$�W�CallExpression�#��$�\�MemberExpression�#��$\�MemberExpression�#��#�X�ThisExpression�#��#�N�Identifier�#��#��pdfController��N�Identifier�#��$�registerActionClickListener�S�ArrowFunctionExpression�$�$����N�Identifier�$�$$�redirectInfoQ�BlockStatement�$)�$��V�ExpressionStatement�$H�$oW�CallExpression�$H�$n\�MemberExpression�$H�$XX�ThisExpression�$H�$LN�Identifier�$M�$X�onPressLink�\�MemberExpression�$Y�$mN�Identifier�$Y�$e�redirectInfoN�Identifier�$f�$m�content����V�ExpressionStatement�$��$�W�CallExpression�$��$�\�MemberExpression�$��$�X�ThisExpression�$��$�N�Identifier�$��$��loadComplete�N�Identifier�$��$��pageCountN�Identifier�$��$˨filePath�V�ExpressionStatement�$��%W�CallExpression�$��%\�MemberExpression�$��$�N�Identifier�$��$��LoggerN�Identifier�$��$�debug�_�TemplateLiteral�$��%��`�TemplateElement�$��%a�"[RTNPdfView]: loadDocument success�"[RTNPdfView]: loadDocument success���rf��type�start�end�label�BreakStatement�%4�%:�\�MemberExpression����\�MemberExpression����N�Identifier���ЪpdfServiceN�Identifier���ܫParseResult��N�Identifier����PARSE_SUCCESS��e�SwitchCase�%P�%�V�ExpressionStatement�%��%�W�CallExpression�%��%�\�MemberExpression�%��%�X�ThisExpression�%��%�N�Identifier�%��%��onError�O�Literal�%��%��$loadDocument error: PARSE_ERROR_FILE�&'loadDocument error: PARSE_ERROR_FILE'�f�BreakStatement�%��%��\�MemberExpression�%U�%|\�MemberExpression�%U�%kN�Identifier�%U�%_�pdfServiceN�Identifier�%`�%k�ParseResult��N�Identifier�%l�%|�PARSE_ERROR_FILE��e�SwitchCase�&�&��V�ExpressionStatement�&K�&�W�CallExpression�&K�&�\�MemberExpression�&K�&WX�ThisExpression�&K�&ON�Identifier�&P�&W�onError�O�Literal�&X�&��&loadDocument error: PARSE_ERROR_FORMAT�('loadDocument error: PARSE_ERROR_FORMAT'�f�BreakStatement�&��&��\�MemberExpression�&�&0\�MemberExpression�&�&N�Identifier�&�&�pdfServiceN�Identifier�&�&�ParseResult��N�Identifier�&�&0�PARSE_ERROR_FORMAT��e�SwitchCase�&��'\�V�ExpressionStatement�'�'<W�CallExpression�'�';\�MemberExpression�'�'X�ThisExpression�'�'N�Identifier�'�'�onError�O�Literal�'�':�(loadDocument error: PARSE_ERROR_PASSWORD�*'loadDocument error: PARSE_ERROR_PASSWORD'�f�BreakStatement�'V�'\�\�MemberExpression�&��&�\�MemberExpression�&��&�N�Identifier�&��&ǪpdfServiceN�Identifier�&��&ӫParseResult��N�Identifier�&��&�PARSE_ERROR_PASSWORD��e�SwitchCase�'r�(�V�ExpressionStatement�'��'�W�CallExpression�'��'�\�MemberExpression�'��'�X�ThisExpression�'��'�N�Identifier�'��'ȧonError�O�Literal�'��'��'loadDocument error: PARSE_ERROR_HANDLER�)'loadDocument error: PARSE_ERROR_HANDLER'�f�BreakStatement�(�(�\�MemberExpression�'w�'�\�MemberExpression�'w�'�N�Identifier�'w�'��pdfServiceN�Identifier�'��'��ParseResult��N�Identifier�'��'��PARSE_ERROR_HANDLER��e�SwitchCase�(*�(ƒV�ExpressionStatement�(q�(�W�CallExpression�(q�(�\�MemberExpression�(q�(}X�ThisExpression�(q�(uN�Identifier�(v�(}�onError�O�Literal�(~�(��$loadDocument error: PARSE_ERROR_CERT�&'loadDocument error: PARSE_ERROR_CERT'�f�BreakStatement�(��(��\�MemberExpression�(/�(V\�MemberExpression�(/�(EN�Identifier�(/�(9�pdfServiceN�Identifier�(:�(E�ParseResult��N�Identifier�(F�(V�PARSE_ERROR_CERT��e�SwitchCase�(��)J�V�ExpressionStatement�(��)*W�CallExpression�(��))\�MemberExpression�(��)
|
|
1697
|
+
X�ThisExpression�(��)N�Identifier�)�)
|
|
1698
|
+
�onError�O�Literal�)�)(�loadDocument error: UNKNOWN�'loadDocument error: UNKNOWN'�f�BreakStatement�)D�)J���N�Identifier�)��)��catch�S�ArrowFunctionExpression�)��*���N�Identifier�)��)��eQ�BlockStatement�)��*�V�ExpressionStatement�)��)�W�CallExpression�)��)�\�MemberExpression�)��)�N�Identifier�)��)��LoggerN�Identifier�)��)��error�_�TemplateLiteral�)��)ՑN�Identifier�)��)ӡe�`�TemplateElement�)��)�a�"[RTNPdfView]: loadDocument error: �"[RTNPdfView]: loadDocument error: �`�TemplateElement�)��)�a����V�ExpressionStatement�)��*W�CallExpression�)��*\�MemberExpression�)��)�X�ThisExpression�)��)�N�Identifier�)��)��onError�\�MemberExpression�)��)�N�Identifier�)��)��eN�Identifier�)��)��message����N�Identifier�*$�*+�finally�S�ArrowFunctionExpression�*,�+o���Q�BlockStatement�*2�+o�V�ExpressionStatement�*E�*�W�CallExpression�*E�*�\�MemberExpression�*E�*QN�Identifier�*E�*K�LoggerN�Identifier�*L�*Q�debug�_�TemplateLiteral�*R�*��N�Identifier�*x�*��isDelOriginFile�`�TemplateElement�*S�*va�#[RTNPdfView]: isDelOriginFile is : �#[RTNPdfView]: isDelOriginFile is : �`�TemplateElement�*��*�a����Y�IfStatement�*��+`N�Identifier�*��*��isDelOriginFileQ�BlockStatement�*��+`�V�ExpressionStatement�*��+MW�CallExpression�*��+L\�MemberExpression�*��*�W�CallExpression�*��*�\�MemberExpression�*��*�N�Identifier�*��*ˢfsN�Identifier�*��*Ҧunlink�N�Identifier�*��*ۨfilePath�N�Identifier�*��*�then�S�ArrowFunctionExpression�*��+K���Q�BlockStatement�*��+K�V�ExpressionStatement�+�+4W�CallExpression�+�+3\�MemberExpression�+�+N�Identifier�+�+ �LoggerN�Identifier�+
|
|
1699
|
+
�+�debug�_�TemplateLiteral�+�+2��`�TemplateElement�+�+1a� [RTNPdfView]: originFile deleted� [RTNPdfView]: originFile deleted������R�MethodDefinition�+��.���N�Identifier�+��+��downloadHttpFile�methodS�FunctionExpression�+��.����ÑN�Identifier�+��+��urlQ�BlockStatement�+��.��L�VariableDeclaration�+��+ϑM�VariableDeclarator�+��+�N�Identifier�+��+��contextW�CallExpression�+��+�N�Identifier�+��+ȪgetContext�X�ThisExpression�+��+�£letL�VariableDeclaration�+��+��M�VariableDeclarator�+��+�N�Identifier�+��+�filesDir\�MemberExpression�+��+�N�Identifier�+��+�contextN�Identifier�+��+��filesDir�£letL�VariableDeclaration�,�,�M�VariableDeclarator�,�,N�Identifier�,�,
|
|
1700
|
+
�resO�Literal�,
|
|
1701
|
+
�V�ExpressionStatement�,��,�[�AssignmentExpression�,��,��=N�Identifier�,��,�resN�Identifier�,��,��cacheFileNameQ�BlockStatement�-�.Y�Y�IfStatement�-(�-�Z�LogicalExpression�-,�-[U�UnaryExpression�-,�-;�!�U�UnaryExpression�--�-;�!�N�Identifier�-.�-;�cacheFileName�&&W�CallExpression�-?�-[\�MemberExpression�-?�-LN�Identifier�-?�-A�fsN�Identifier�-B�-L�accessSync�N�Identifier�-M�-Z�cacheFileName�Q�BlockStatement�-]�-��V�ExpressionStatement�-p�-�W�CallExpression�-p�-�\�MemberExpression�-p�-}N�Identifier�-p�-r�fsN�Identifier�-s�-}�unlinkSync�N�Identifier�-~�-��cacheFileName��L�VariableDeclaration�-��-��M�VariableDeclarator�-��-�N�Identifier�-��-��fullFileNameZ�BinaryExpression�-��-�Z�BinaryExpression�-��-�Z�BinaryExpression�-��-�Z�BinaryExpression�-��-�N�Identifier�-��-ǨfilesDir�+O�Literal�-��-͡/�"/"�+N�Identifier�-��-ܬhashFileName�+W�CallExpression�-��-�\�MemberExpression�-��-�]�NewExpression�-��-�N�Identifier�-��-�Date�N�Identifier�-��-�getTime�¡+O�Literal�-��-��.pdf�'.pdf'�constV�ExpressionStatement�.�.N[�AssignmentExpression�.�.M�=N�Identifier�.�.�res^�AwaitExpression�.�.MW�CallExpression�.�.M\�MemberExpression�.�.*X�ThisExpression�.�.N�Identifier�.�.*�downloadAction�N�Identifier�.+�.2�contextN�Identifier�.4�.7�urlN�Identifier�.9�.E�fullFileName�rg��type�start�end�properties�ObjectExpression�.G�.I�O�Literal�.K�.L�0�V�ExpressionStatement�.c�.�W�CallExpression�.c�.�\�MemberExpression�.c�.nN�Identifier�.c�.i�LoggerN�Identifier�.j�.n�info�_�TemplateLiteral�.o�.��N�Identifier�.��.��res�`�TemplateElement�.p�.�a�[RTNPdfView]:res: �[RTNPdfView]:res: �`�TemplateElement�.��.�a����^�ReturnStatement�.��.�N�Identifier�.��.��resR�MethodDefinition�.��:{��N�Identifier�.��.��downloadAction�methodS�FunctionExpression�.��:{���ÕN�Identifier�.��.ɧcontextN�Identifier�.��.ΣurlN�Identifier�.��.ܬfullFileNameN�Identifier�.��.�distHeadersT�AssignmentPattern�.��.�N�Identifier�.��.��redirectCountO�Literal�.��.��0Q�BlockStatement�.��:{�Y�IfStatement�/ �/`Z�BinaryExpression�/
|
|
1702
|
+
�config�N�Identifier�2�2�then�S�ArrowFunctionExpression�2�8w���N�Identifier�2�2�taskQ�BlockStatement�2�8w�V�ExpressionStatement�22�2�W�CallExpression�22�2�\�MemberExpression�22�29N�Identifier�22�26�taskN�Identifier�27�29�on�O�Literal�2:�2E�completed�'completed'S�ArrowFunctionExpression�2G�2����Q�BlockStatement�2M�2��V�ExpressionStatement�2h�2�W�CallExpression�2h�2�\�MemberExpression�2h�2sN�Identifier�2h�2n�LoggerN�Identifier�2o�2s�info�_�TemplateLiteral�2t�2���`�TemplateElement�2u�2�a�![RTNPdfView]: finish downloadFile�![RTNPdfView]: finish downloadFile��V�ExpressionStatement�2��2�W�CallExpression�2��2�N�Identifier�2��2��resolve�N�Identifier�2��2ǬfullFileName��V�ExpressionStatement�2��3�W�CallExpression�2��3�\�MemberExpression�2��2�N�Identifier�2��2��taskN�Identifier�2��2��on�O�Literal�3�3�failed�'failed'S�ArrowFunctionExpression�3
|
|
1703
|
+
�3����N�Identifier�3�3�progressQ�BlockStatement�3�3��V�ExpressionStatement�33�3�W�CallExpression�33�3\�MemberExpression�33�3?N�Identifier�33�3:�consoleN�Identifier�3;�3?�info�O�Literal�3@�3d�"[RTNPdfView]: downloadFile failed.�$'[RTNPdfView]: downloadFile failed.'W�CallExpression�3f�3~\�MemberExpression�3f�3tN�Identifier�3f�3j�JSONN�Identifier�3k�3t�stringify�N�Identifier�3u�3}�progress���V�ExpressionStatement�3��8AW�CallExpression�3��8@\�MemberExpression�3��3�N�Identifier�3��3��taskN�Identifier�3��3��on�O�Literal�3��3��response�'response'S�ArrowFunctionExpression�3��8?���ÑN�Identifier�3��3ҨresponseQ�BlockStatement�3��8?�V�ExpressionStatement�3��4AW�CallExpression�3��4@\�MemberExpression�3��3�N�Identifier�3��3��consoleN�Identifier�3��3��info�O�Literal�3��4%�$[RTNPdfView]: downloadFile response.�&'[RTNPdfView]: downloadFile response.'W�CallExpression�4'�4?\�MemberExpression�4'�45N�Identifier�4'�4+�JSONN�Identifier�4,�45�stringify�N�Identifier�46�4>�response��Y�IfStatement�4[�8(Z�LogicalExpression�4_�4�Z�BinaryExpression�4_�4x\�MemberExpression�4_�4rN�Identifier�4_�4g�responseN�Identifier�4h�4r�statusCode�¡>O�Literal�4u�4x�,�300�&&Z�BinaryExpression�4|�4�\�MemberExpression�4|�4�N�Identifier�4|�4��responseN�Identifier�4��4��statusCode�¡<O�Literal�4��4����400Q�BlockStatement�4��8(�L�VariableDeclaration�4��4��M�VariableDeclarator�4��4�N�Identifier�4��4ūredirectUrlZ�LogicalExpression�4��4�V�ChainExpression�4��4�W�CallExpression�4��4�\�MemberExpression�4��4�W�CallExpression�4��4�\�MemberExpression�4��4�\�MemberExpression�4��4�N�Identifier�4��4ШresponseN�Identifier�4��4اheaders��N�Identifier�4��4ܣget�O�Literal�4��4�location�'location'�N�Identifier�4��4�toString�Т??O�Literal�4��4���''�letL�VariableDeclaration�5�5[�M�VariableDeclarator�5�5ZN�Identifier�5�5#�cookieZ�LogicalExpression�5&�5ZV�ChainExpression�5&�5TW�CallExpression�5&�5T\�MemberExpression�5&�5RW�CallExpression�5&�5H\�MemberExpression�5&�5:\�MemberExpression�5&�56N�Identifier�5&�5.�responseN�Identifier�5/�56�headers��N�Identifier�57�5:�get�O�Literal�5;�5G�set-cookie�'set-cookie'�N�Identifier�5J�5R�toString�Т??O�Literal�5X�5Z��''�letV�ExpressionStatement�5y�5�W�CallExpression�5y�5�\�MemberExpression�5y�5�N�Identifier�5y�5}�taskN�Identifier�5~�5��off�O�Literal�5��5��progress�'progress'�V�ExpressionStatement�5��5�W�CallExpression�5��5�\�MemberExpression�5��5�N�Identifier�5��5��taskN�Identifier�5��5��off�O�Literal�5��5��completed�'completed'�V�ExpressionStatement�5��5�W�CallExpression�5��5�\�MemberExpression�5��5�N�Identifier�5��5�taskN�Identifier�5��5�off�O�Literal�5��5�response�'response'�V�ExpressionStatement�6�6W�CallExpression�6�6\�MemberExpression�6�6N�Identifier�6�6�taskN�Identifier�6�6�stop��b�TryStatement�6=�8
|
|
1704
|
+
�?�cacheFileName�c�CatchClause�?.�?�N�Identifier�?5�?6�eQ�BlockStatement�?8�?��V�ExpressionStatement�?G�?_W�CallExpression�?G�?^\�MemberExpression�?G�?SX�ThisExpression�?G�?KN�Identifier�?L�?S�onError�\�MemberExpression�?T�?]N�Identifier�?T�?U�eN�Identifier�?V�?]�message���^�ReturnStatement�?m�?�W�CallExpression�?t�?�\�MemberExpression�?t�?�N�Identifier�?t�?{�PromiseN�Identifier�?|�?��reject�O�Literal�?��?��checkCache error�"checkCache error"��R�MethodDefinition�?��E ��N�Identifier�?��?sendToSandBox�methodS�FunctionExpression�?��E ���ÑN�Identifier�?��?̩assetPathQ�BlockStatement�?��E �V�ExpressionStatement�?��@[�AssignmentExpression�?��@
|
|
1705
|
+
�JX�ThisExpression�J
|
|
1706
|
+
�JN�Identifier�J�J�tag��S�ArrowFunctionExpression�J�J����N�Identifier�J�J�commandN�Identifier�J�J"�argsQ�BlockStatement�J'�JߓV�ExpressionStatement�J6�J�W�CallExpression�J6�J�\�MemberExpression�J6�JAN�Identifier�J6�J<�LoggerN�Identifier�J=�JA�info�_�TemplateLiteral�JB�J��N�Identifier�Jr�Jy�command\�MemberExpression�J��J�N�Identifier�J��J��argsO�Literal�J��J��0�`�TemplateElement�JC�Jpa�-[RNOH]: HarmonyOS does not support,command: �-[RNOH]: HarmonyOS does not support,command: �`�TemplateElement�Jz�J�a�, arg: �, arg: �`�TemplateElement�J��J�a����V�ExpressionStatement�J��J�[�AssignmentExpression�J��J��=\�MemberExpression�J��J�X�ThisExpression�J��J�N�Identifier�J��J��pageIndex��\�MemberExpression�J��J�N�Identifier�J��J��argsO�Literal�J��J��0��V�ExpressionStatement�J��J�[�AssignmentExpression�J��Jӡ=\�MemberExpression�J��J�X�ThisExpression�J��J�N�Identifier�J��JΦpdfUrl��O�Literal�J��JӠ�""�R�MethodDefinition�J��Kj��N�Identifier�J��J��aboutToDisappear�methodS�FunctionExpression�J��Kj���Q�BlockStatement�K�Kj�V�ExpressionStatement�K�K,V�ChainExpression�K�K+W�CallExpression�K�K+\�MemberExpression�K�K'X�ThisExpression�K�KN�Identifier�K�K'�cleanupCommandCallback��V�ExpressionStatement�K6�KcV�ChainExpression�K6�KbW�CallExpression�K6�Kb\�MemberExpression�K6�K^X�ThisExpression�K6�K:N�Identifier�K;�K^�#unregisterDescriptorChangesListener��R�MethodDefinition�Kp�L���N�Identifier�Kp�K|�loadComplete�methodS�FunctionExpression�K|�L����N�Identifier�K}�K��numberOfPagesN�Identifier�K��K��filePathQ�BlockStatement�K��L��V�ExpressionStatement�K��K�W�CallExpression�K��K�\�MemberExpression�K��K�N�Identifier�K��K��LoggerN�Identifier�K��K��info�O�Literal�K��Kȹ[RNOH]:enter loadComplete�"[RNOH]:enter loadComplete"�V�ExpressionStatement�K��L�W�CallExpression�K��L�\�MemberExpression�K��L\�MemberExpression�K��K�\�MemberExpression�K��K�X�ThisExpression�K��K�N�Identifier�K��K�ctx��N�Identifier�K��K��rnInstance��N�Identifier�K��L�emitComponentEvent�\�MemberExpression�L�L$\�MemberExpression�L�L X�ThisExpression�L�LN�Identifier�L�L �descriptor��N�Identifier�L!�L$�tag��N�Identifier�L&�L3�PDF_VIEW_TYPEg�ObjectExpression�L5�L��h�Property�LD�LT���N�Identifier�LD�LH�typeO�Literal�LJ�LT�onChange�'onChange'�inith�Property�Lc�L����N�Identifier�Lc�Lj�message_�TemplateLiteral�Ll�L��N�Identifier�L|�L��numberOfPages�`�TemplateElement�Lm�Lza�loadComplete|�loadComplete|�`�TemplateElement�L��L�a�|100|100�|100|100äinit�R�MethodDefinition�L��M���N�Identifier�L��L��loadProgress�methodS�FunctionExpression�L��M����N�Identifier�L��L��percentQ�BlockStatement�L��M��V�ExpressionStatement�L��L�W�CallExpression�L��L�\�MemberExpression�L��L�N�Identifier�L��LԦLoggerN�Identifier�L��L٤info�O�Literal�L��L��[RNOH]:enter loadProgress�"[RNOH]:enter loadProgress"�V�ExpressionStatement�M�M�W�CallExpression�M�M�\�MemberExpression�M�M'\�MemberExpression�M�M\�MemberExpression�M�M X�ThisExpression�M�MN�Identifier�M�M �ctx��N�Identifier�M
|
|
1707
|
+
�M�rnInstance��N�Identifier�M�M'�emitComponentEvent�\�MemberExpression�M(�M;\�MemberExpression�M(�M7X�ThisExpression�M(�M,N�Identifier�M-�M7�descriptor��N�Identifier�M8�M;�tag��N�Identifier�M=�MJ�PDF_VIEW_TYPEg�ObjectExpression�ML�M��h�Property�M[�Mk���N�Identifier�M[�M_�typeO�Literal�Ma�Mk�onChange�'onChange'�inith�Property�Mz�M����N�Identifier�Mz�M��message_�TemplateLiteral�M��M��N�Identifier�M��M��percent�`�TemplateElement�M��M�a�loadProgress|�loadProgress|�`�TemplateElement�M��M�a��äinit�R�MethodDefinition�M��N���N�Identifier�M��M��onError�methodS�FunctionExpression�M��N����N�Identifier�M��M��eQ�BlockStatement�M��N��V�ExpressionStatement�M��M�W�CallExpression�M��M�\�MemberExpression�M��M�N�Identifier�M��MҦLoggerN�Identifier�M��Mפinfo�O�Literal�M��M�[RNOH]:enter onError�"[RNOH]:enter onError"�V�ExpressionStatement�M��N�W�CallExpression�M��N�\�MemberExpression�M��N \�MemberExpression�M��N
|
|
1708
|
+
X�ThisExpression�O�ON�Identifier�O�O
|
|
1709
|
+
�ctx��N�Identifier�O�O�rnInstance��N�Identifier�O�O(�emitComponentEvent�\�MemberExpression�O)�O<\�MemberExpression�O)�O8X�ThisExpression�O)�O-N�Identifier�O.�O8�descriptor��N�Identifier�O9�O<�tag��N�Identifier�O>�OK�PDF_VIEW_TYPEg�ObjectExpression�OM�O��h�Property�O\�Ol���N�Identifier�O\�O`�typeO�Literal�Ob�Ol�onChange�'onChange'�inith�Property�O{�O����N�Identifier�O{�O��message_�TemplateLiteral�O��O��N�Identifier�O��O��pageN�Identifier�O��O��numberOfPages�`�TemplateElement�O��O�a�pageChanged|�pageChanged|�`�TemplateElement�O��O�a�|�|�`�TemplateElement�O��O�a��äinit�R�MethodDefinition�O��P���N�Identifier�O��OϫonPressLink�methodS�FunctionExpression�O��P����N�Identifier�O��OӣurlQ�BlockStatement�O��P��V�ExpressionStatement�O��PW�CallExpression�O��P\�MemberExpression�O��O�N�Identifier�O��O�LoggerN�Identifier�O��O�info�O�Literal�O��P�[RNOH]:enter onPressLink�"[RNOH]:enter onPressLink"�V�ExpressionStatement�P�P�W�CallExpression�P�P�\�MemberExpression�P�P8\�MemberExpression�P�P%\�MemberExpression�P�PX�ThisExpression�P�PN�Identifier�P�P�ctx��N�Identifier�P�P%�rnInstance��N�Identifier�P&�P8�emitComponentEvent�\�MemberExpression�P9�PL\�MemberExpression�P9�PHX�ThisExpression�P9�P=N�Identifier�P>�PH�descriptor��N�Identifier�PI�PL�tag��N�Identifier�PN�P[�PDF_VIEW_TYPEg�ObjectExpression�P]�P��h�Property�Pl�P|���N�Identifier�Pl�Pp�typeO�Literal�Pr�P|�onChange�'onChange'�inith�Property�P��P����N�Identifier�P��P��message_�TemplateLiteral�P��P��N�Identifier�P��P��url�`�TemplateElement�P��P�a�linkPressed|�linkPressed|�`�TemplateElement�P��P�a��äinit�R�MethodDefinition�P��Q���N�Identifier�P��PЮonScaleChanged�methodS�FunctionExpression�P��Q����N�Identifier�P��PݬcurrentScaleQ�BlockStatement�P��QђV�ExpressionStatement�P��QW�CallExpression�P��Q\�MemberExpression�P��P�N�Identifier�P��P�LoggerN�Identifier�P��P��info�O�Literal�P��Q�[RNOH]:enter scaleChanged�"[RNOH]:enter scaleChanged"�V�ExpressionStatement�Q�Q�W�CallExpression�Q�Q�\�MemberExpression�Q�QC\�MemberExpression�Q�Q0\�MemberExpression�Q�Q%X�ThisExpression�Q�Q!N�Identifier�Q"�Q%�ctx��N�Identifier�Q&�Q0�rnInstance��N�Identifier�Q1�QC�emitComponentEvent�\�MemberExpression�QD�QW\�MemberExpression�QD�QSX�ThisExpression�QD�QHN�Identifier�QI�QS�descriptor��N�Identifier�QT�QW�tag��N�Identifier�QY�Qf�PDF_VIEW_TYPEg�ObjectExpression�Qh�QȒh�Property�Qw�Q����N�Identifier�Qw�Q{�typeO�Literal�Q}�Q��onChange�'onChange'�inith�Property�Q��Q����N�Identifier�Q��Q��message_�TemplateLiteral�Q��Q��N�Identifier�Q��Q��currentScale�`�TemplateElement�Q��Q�a�scaleChanged|�scaleChanged|�`�TemplateElement�Q��Q�a��äinit�R�MethodDefinition�Q��R���N�Identifier�Q��QߨonChange�methodS�FunctionExpression�Q��R����Q�BlockStatement�Q��RʒV�ExpressionStatement�Q��RW�CallExpression�Q��R\�MemberExpression�Q��Q�N�Identifier�Q��Q�LoggerN�Identifier�Q��Q��info�O�Literal�Q��R�[RNOH]:onChange not support�"[RNOH]:onChange not support"�V�ExpressionStatement�R"�R�W�CallExpression�R"�R�\�MemberExpression�R"�RH\�MemberExpression�R"�R5\�MemberExpression�R"�R*X�ThisExpression�R"�R&N�Identifier�R'�R*�ctx��N�Identifier�R+�R5�rnInstance��N�Identifier�R6�RH�emitComponentEvent�\�MemberExpression�RI�R\\�MemberExpression�RI�RXX�ThisExpression�RI�RMN�Identifier�RN�RX�descriptor��N�Identifier�RY�R\�tag��N�Identifier�R^�Rk�PDF_VIEW_TYPEg�ObjectExpression�Rm�R��h�Property�R|�R����N�Identifier�R|�R��typeO�Literal�R��R��onChange�'onChange'�inith�Property�R��R����N�Identifier�R��R��messageN�Identifier�R��R��ON_PROGRESS_CHANGE�init�R�MethodDefinition�R��n���N�Identifier�R��RݭinitialRender�methodS�FunctionExpression�R��n����Q�BlockStatement�R��n��Q�BlockStatement�R��n��V�ExpressionStatement�R��n�W�CallExpression�R��n�\�MemberExpression�R��SX�ThisExpression�R��R�N�Identifier�R��S�observeComponentCreation2�S�ArrowFunctionExpression�S�n����N�Identifier�S�S �elmtIdN�Identifier�S"�S1�isInitialRenderQ�BlockStatement�S6�n��Y�IfStatement�SI�n�N�Identifier�SM�S\�isInitialRenderQ�BlockStatement�S^�n�L�VariableDeclaration�Su�`L�M�VariableDeclarator�Sy�`KN�Identifier�Sy�S��componentCall]�NewExpression�S��`KN�Identifier�S��S��RNViewBase�X�ThisExpression�S��S�g�ObjectExpression�S��_��h�Property�S��S����N�Identifier�S��S��ctx\�MemberExpression�S��S�X�ThisExpression�S��S�N�Identifier�S��Sƣctx�¤inith�Property�S��S����N�Identifier�S��Sˣtag\�MemberExpression�S��S�X�ThisExpression�S��S�N�Identifier�S��Sգtag�¤inith�Property�S��_����N�Identifier�S��S��renderChildrenS�ArrowFunctionExpression�T�_����Q�BlockStatement�T�_��V�ExpressionStatement�T%�_KW�CallExpression�T%�_J\�MemberExpression�T%�TCX�ThisExpression�T%�T)N�Identifier�T*�TC�observeComponentCreation2�S�ArrowFunctionExpression�TD�_E���N�Identifier�TE�TK�elmtIdN�Identifier�TM�T\�isInitialRenderQ�BlockStatement�Ta�_E�V�ExpressionStatement�T��T�W�CallExpression�T��T�\�MemberExpression�T��T�N�Identifier�T��T��IfN�Identifier�T��T��create��Y�IfStatement�T��_&\�MemberExpression�T��T�\�MemberExpression�T��T�\�MemberExpression�T��T�X�ThisExpression�T��T�N�Identifier�T��TŪdescriptor��N�Identifier�T��TΨrawProps��N�Identifier�T��TӤpath��Q�BlockStatement�T��^b�V�ExpressionStatement�T��^?W�CallExpression�T��^>\�MemberExpression�T��UX�ThisExpression�T��UN�Identifier�U�U�ifElseBranchUpdateFunction�O�Literal�U�U�0S�ArrowFunctionExpression�U�^=���Q�BlockStatement�U%�^=�Q�BlockStatement�UP�^�V�ExpressionStatement�U�]�W�CallExpression�U�]�\�MemberExpression�U�U�X�ThisExpression�U�U�N�Identifier�U��U��observeComponentCreation2�S�ArrowFunctionExpression�U��]����N�Identifier�U��U��elmtIdN�Identifier�U��U��isInitialRenderQ�BlockStatement�U��]ԑY�IfStatement�U��]�N�Identifier�U��V�isInitialRenderQ�BlockStatement�V�\ԔL�VariableDeclaration�V:�Y�M�VariableDeclarator�V>�YN�Identifier�V>�VK�componentCall]�NewExpression�VN�YN�Identifier�VR�VY�PdfView�X�ThisExpression�VZ�V^g�ObjectExpression�V`�X`�h�Property�V��V����N�Identifier�V��V��controller\�MemberExpression�V��V�X�ThisExpression�V��V�N�Identifier�V��V��pdfController�¤inith�Property�V��W#���N�Identifier�V��V��pageLayout\�MemberExpression�W�W#\�MemberExpression�W�WN�Identifier�W�W
|
|
1710
|
+
�pdfServiceN�Identifier�W�W�PageLayout��N�Identifier�W�W#�LAYOUT_SINGLE�¤inith�Property�W^�Wp���N�Identifier�W^�Wj�isContinuousO�Literal�Wl�Wpätrue�inith�Property�W��W����N�Identifier�W��W��pageFit\�MemberExpression�W��W�\�MemberExpression�W��W�N�Identifier�W��W��pdfServiceN�Identifier�W��WƧPageFit��N�Identifier�W��WЩFIT_WIDTH�¤inith�Property�X�X)���N�Identifier�X�X�showScroll\�MemberExpression�X�X)X�ThisExpression�X�XN�Identifier�X�X)�scrollEnabled�¤initN�Identifier�Xb�Xk�undefinedN�Identifier�Xm�Xs�elmtIdS�ArrowFunctionExpression�Xu�X~���Q�BlockStatement�X{�X~�g�ObjectExpression�X��Y�h�Property�X��X����N�Identifier�X��X��pageO�Literal�X��X��g../../../gitcode/rntpc_react-native-pdf/harmony/pdfview/src/main/ets/components/mainpage/RTNPdfView.ets�i"../../../gitcode/rntpc_react-native-pdf/harmony/pdfview/src/main/ets/components/mainpage/RTNPdfView.ets"�inith�Property�X��X����N�Identifier�X��X��lineO�Literal�X��X���485�inith�Property�X��Y���N�Identifier�X��Y�colO�Literal�Y�Y �9�init�letV�ExpressionStatement�Y>�Y[W�CallExpression�Y>�YZ\�MemberExpression�Y>�YKN�Identifier�Y>�YD�ViewPUN�Identifier�YE�YK�create�N�Identifier�YL�YY�componentCall�L�VariableDeclaration�Y��\=�M�VariableDeclarator�Y��\<N�Identifier�Y��Y��paramsLambdaS�ArrowFunctionExpression�Y��\<���Q�BlockStatement�Y��\<�^�ReturnStatement�Y��\g�ObjectExpression�Y��\�h�Property�Z+�ZI���N�Identifier�Z+�Z5�controller\�MemberExpression�Z7�ZIX�ThisExpression�Z7�Z;N�Identifier�Z<�ZI�pdfController�¤inith�Property�Z��Z����N�Identifier�Z��Z��pageLayout\�MemberExpression�Z��Z�\�MemberExpression�Z��Z�N�Identifier�Z��Z��pdfServiceN�Identifier�Z��Z��PageLayout��N�Identifier�Z��Z��LAYOUT_SINGLE�¤inith�Property�Z��[���N�Identifier�Z��[�isContinuousO�Literal�[�[ätrue�inith�Property�[G�[l���N�Identifier�[G�[N�pageFit\�MemberExpression�[P�[l\�MemberExpression�[P�[bN�Identifier�[P�[Z�pdfServiceN�Identifier�[[�[b�PageFit��N�Identifier�[c�[l�FIT_WIDTH�¤inith�Property�[��[����N�Identifier�[��[��showScroll\�MemberExpression�[��[�X�ThisExpression�[��[�N�Identifier�[��[ɭscrollEnabled�¤init�letV�ExpressionStatement�\s�\�[�AssignmentExpression�\s�\��=\�MemberExpression�\s�\�N�Identifier�\s�\��componentCallN�Identifier�\��\��paramsGenerator_��N�Identifier�\��\��paramsLambdaQ�BlockStatement�]�]��V�ExpressionStatement�]B�]rW�CallExpression�]B�]q\�MemberExpression�]B�]eX�ThisExpression�]B�]FN�Identifier�]G�]e�updateStateVarsOfChildByElmtId�N�Identifier�]f�]l�elmtIdg�ObjectExpression�]n�]p��g�ObjectExpression�]��]�h�Property�]��]����N�Identifier�]��]ܤnameO�Literal�]��]�PdfView�"PdfView"�init��Q�BlockStatement�^��_&�V�ExpressionStatement�^��_W�CallExpression�^��_\�MemberExpression�^��^�X�ThisExpression�^��^�N�Identifier�^��^ϺifElseBranchUpdateFunction�O�Literal�^��^��1S�ArrowFunctionExpression�^��_���Q�BlockStatement�^��_��N�Identifier�_G�_I�If�V�ExpressionStatement�_i�_rW�CallExpression�_i�_q\�MemberExpression�_i�_oN�Identifier�_i�_k�IfN�Identifier�_l�_o�pop�¤initN�Identifier�_��_��undefinedN�Identifier�_��_��elmtIdS�ArrowFunctionExpression�_��_����Q�BlockStatement�_��_g�ObjectExpression�_��`J�h�Property�_��`5���N�Identifier�_��_ʤpageO�Literal�_��`5�g../../../gitcode/rntpc_react-native-pdf/harmony/pdfview/src/main/ets/components/mainpage/RTNPdfView.ets�i"../../../gitcode/rntpc_react-native-pdf/harmony/pdfview/src/main/ets/components/mainpage/RTNPdfView.ets"�inith�Property�`7�`@���N�Identifier�`7�`;�lineO�Literal�`=�`@��483�inith�Property�`B�`H���N�Identifier�`B�`E�colO�Literal�`G�`H�5�init�letV�ExpressionStatement�`b�`W�CallExpression�`b�`~\�MemberExpression�`b�`oN�Identifier�`b�`h�ViewPUN�Identifier�`i�`o�create�N�Identifier�`p�`}�componentCall�L�VariableDeclaration�`��m��M�VariableDeclarator�`��m�N�Identifier�`��`��paramsLambdaS�ArrowFunctionExpression�`��m����Q�BlockStatement�`��m��^�ReturnStatement�`��m�g�ObjectExpression�`��m��h�Property�`��`����N�Identifier�`��`�ctx\�MemberExpression�`��`�X�ThisExpression�`��`�N�Identifier�`��`��ctx�¤inith�Property�a�a(���N�Identifier�a�a�tag\�MemberExpression�a �a(X�ThisExpression�a �a$N�Identifier�a%�a(�tag�¤inith�Property�aG�m����N�Identifier�aG�aU�renderChildrenS�ArrowFunctionExpression�aW�m����Q�BlockStatement�a]�m��V�ExpressionStatement�a��m:W�CallExpression�a��m9\�MemberExpression�a��a�X�ThisExpression�a��a�N�Identifier�a��a��observeComponentCreation2�S�ArrowFunctionExpression�a��m4���N�Identifier�a��a��elmtIdN�Identifier�a��a��isInitialRenderQ�BlockStatement�a��m4�V�ExpressionStatement�a��a�W�CallExpression�a��a�\�MemberExpression�a��a�N�Identifier�a��a�IfN�Identifier�a��a�create��Y�IfStatement�b�m\�MemberExpression�b�b6\�MemberExpression�b�b1\�MemberExpression�b�b(X�ThisExpression�b�bN�Identifier�b�b(�descriptor��N�Identifier�b)�b1�rawProps��N�Identifier�b2�b6�path��Q�BlockStatement�b8�l=�V�ExpressionStatement�bc�lW�CallExpression�bc�l\�MemberExpression�bc�b�X�ThisExpression�bc�bgN�Identifier�bh�b��ifElseBranchUpdateFunction�O�Literal�b��b��0S�ArrowFunctionExpression�b��l���Q�BlockStatement�b��l�Q�BlockStatement�b��k�V�ExpressionStatement�b��k�W�CallExpression�b��k�\�MemberExpression�b��cX�ThisExpression�b��b�N�Identifier�b��c�observeComponentCreation2�S�ArrowFunctionExpression�c
|
|
1711
|
+
�f
|