diff --git a/ArkWebKit/ProcessWebPageCont/.gitignore b/ArkWebKit/ProcessWebPageCont/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..d2ff20141ceed86d87c0ea5d99481973005bab2b
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/.gitignore
@@ -0,0 +1,12 @@
+/node_modules
+/oh_modules
+/local.properties
+/.idea
+**/build
+/.hvigor
+.cxx
+/.clangd
+/.clang-format
+/.clang-tidy
+**/.test
+/.appanalyzer
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/AppScope/app.json5 b/ArkWebKit/ProcessWebPageCont/AppScope/app.json5
new file mode 100644
index 0000000000000000000000000000000000000000..4b1ce53f111420364c0803811493cd969dc80603
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/AppScope/app.json5
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "app": {
+ "bundleName": "com.samples.processwebpagecont",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name"
+ }
+}
diff --git a/ArkWebKit/ProcessWebPageCont/AppScope/resources/base/element/string.json b/ArkWebKit/ProcessWebPageCont/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..4779102effef55e6d1414c9166b60b0783cdc210
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "ProcessWebPageCont"
+ }
+ ]
+}
diff --git a/ArkWebKit/ProcessWebPageCont/AppScope/resources/base/media/app_icon.png b/ArkWebKit/ProcessWebPageCont/AppScope/resources/base/media/app_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3
Binary files /dev/null and b/ArkWebKit/ProcessWebPageCont/AppScope/resources/base/media/app_icon.png differ
diff --git a/ArkWebKit/ProcessWebPageCont/README.md b/ArkWebKit/ProcessWebPageCont/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..8a7bae3d95dda95b45cabd1f819eb1341074ec40
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/README.md
@@ -0,0 +1,131 @@
+## 使用Web组件打印前端页面
+
+### 介绍
+
+2. 本工程主要实现了对以下指南文档中 https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/web/web-print.md 示例代码片段的工程化,主要目标是实现指南中示例代码需要与sample工程文件同源。
+
+### InitiatePrintW3CAPI
+
+#### 介绍
+
+1. 本示例主要介绍使用Web组件打印前端页面,通过创建打印适配器,拉起打印应用,并对当前Web页面内容进行渲染,渲染后生成的PDF文件信息通过fd传递给打印框架。W3C标准协议接口window.print()方法用于打印当前页面或弹出打印对话框。该方法没有任何参数,只需要在JavaScript中调用即可。
+
+#### 效果预览
+
+| 主页 |
+| ------------------------------------------------------------ |
+|
|
+
+使用说明
+
+1. 点击print按钮,触发window.print()操作,即可对页面内容进行打印。
+
+### InitiatePrintAppAPI
+
+#### 介绍
+
+1. 本示例主要介绍使用Web组件打印前端页面,应用侧通过调用createWebPrintDocumentAdapter创建打印适配器,通过将适配器传入打印的print接口调起打印。
+
+#### 效果预览
+
+| 主页 |
+| ------------------------------------------------------------ |
+|
|
+
+使用说明
+
+1. 点击createWebPrintDocumentAdapter按钮应用侧会创建打印适配器,并将其传入打印接口,以触发打印操作。
+
+## 使用Web组件的PDF文档预览能力
+
+### 介绍
+
+1. 本工程主要实现了对以下指南文档中 https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/web/web-pdf-preview.md 示例代码片段的工程化,主要目标是实现指南中示例代码需要与sample工程文件同源。
+
+### PreviewPDF
+
+#### 介绍
+
+1. 本示例主要介绍使用Web组件的PDF文档预览能力。Web组件提供了在网页中预览PDF的能力。应用可以通过Web组件的src参数和loadUrl()接口中传入PDF文件,来加载PDF文档。根据PDF文档来源不同,可以分为三种常用场景:加载网络PDF文档、加载本地PDF文档、加载应用内resource资源PDF文档。
+
+#### 效果预览
+
+| 主页 |
+| ------------------------------------------------------- |
+|
|
+
+使用说明
+
+1. Web组件创建时指定默认加载的网络PDF文档example.com/test.pdf。
+
+## 网页中安全区域计算和避让适配
+
+### 介绍
+
+### CalcAdjustSafeArea
+
+1. 本工程主要实现了对以下指南文档中 https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/web/web-safe-area-insets.md 示例代码片段的工程化,主要目标是实现指南中示例代码需要与sample工程文件同源。
+
+#### 介绍
+
+1. 本示例主要介绍网页中安全区域计算和避让适配。Web组件提供了利用W3C CSS进行安全区域计算并避让适配的能力,用来支持异形屏幕设备在沉浸式效果下页面的正常显示。此时,网页开发者想对重叠元素进行避让,就可以该能力。ArkWeb内核将持续监测Web组件及系统安全区域的位置与尺寸,依据两者的重叠部分,计算出当前Web组件的安全区域,以及在各个方向上所需避让的具体距离。
+
+#### 效果预览
+
+| 主页 |
+| ------------------------------------------------------------ |
+|
|
+
+使用说明
+
+1. 通过expandSafeArea来开启沉浸式效果。Web组件根据实际情况对网页元素进行相应的避让,防止与系统的非安全区域发生重叠遮挡。
+
+## 工程目录
+
+```
+entry/src/main/
+|---ets
+|---|---entryability
+|---|---|---EntryAbility.ets
+|---|---pages
+|---|---|---Index.ets // 首页
+|---|---|---InitiatePrintAppAPI
+|---|---|---InitiatePrintW3CAPI
+|---|---|---PreviewPDF
+|---|---|---CalcAdjustSafeArea
+|---resources // 静态资源
+|---ohosTest
+|---|---ets
+|---|---|---tests
+|---|---|---|---Ability.test.ets // 自动化测试用例
+```
+
+
+## 相关权限
+
+[ohos.permission.PRINT](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionprint)
+
+[ohos.permission.INTERNET](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissioninternet)
+
+## 依赖
+
+不涉及。
+
+## 约束与限制
+
+1. 本示例仅支持标准系统上运行,支持设备:RK3568。
+2. 本示例支持API14版本SDK,SDK版本号(API Version 14 Release)。
+3. 本示例需要使用DevEco Studio 版本号(5.0.1Release)才可编译运行。
+
+## 下载
+
+如需单独下载本工程,执行如下命令:
+
+```
+git init
+git config core.sparsecheckout true
+echo code/DocsSample/ArkWeb/ProcessWebPageCont > .git/info/sparse-checkout
+git remote add origin https://gitee.com/openharmony/applications_app_samples.git
+git pull origin master
+```
+
diff --git a/ArkWebKit/ProcessWebPageCont/build-profile.json5 b/ArkWebKit/ProcessWebPageCont/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..7a9c78377eb963833422d699676b8fb5b20bae29
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/build-profile.json5
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "app": {
+ "signingConfigs": [],
+ "products": [
+ {
+ "name": "default",
+ "signingConfig": "default",
+ "compileSdkVersion": 14,
+ "compatibleSdkVersion": 14,
+ "targetSdkVersion": 14,
+ "runtimeOS": "OpenHarmony",
+ }
+ ],
+ "buildModeSet": [
+ {
+ "name": "debug",
+ },
+ {
+ "name": "release"
+ }
+ ]
+ },
+ "modules": [
+ {
+ "name": "entry",
+ "srcPath": "./entry",
+ "targets": [
+ {
+ "name": "default",
+ "applyToProducts": [
+ "default"
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/code-linter.json5 b/ArkWebKit/ProcessWebPageCont/code-linter.json5
new file mode 100644
index 0000000000000000000000000000000000000000..28586467ee7a761c737d8654a73aed6fddbc3c71
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/code-linter.json5
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "files": [
+ "**/*.ets"
+ ],
+ "ignore": [
+ "**/src/ohosTest/**/*",
+ "**/src/test/**/*",
+ "**/src/mock/**/*",
+ "**/node_modules/**/*",
+ "**/oh_modules/**/*",
+ "**/build/**/*",
+ "**/.preview/**/*"
+ ],
+ "ruleSet": [
+ "plugin:@performance/recommended",
+ "plugin:@typescript-eslint/recommended"
+ ],
+ "rules": {
+ }
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/.gitignore b/ArkWebKit/ProcessWebPageCont/entry/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/.gitignore
@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/build-profile.json5 b/ArkWebKit/ProcessWebPageCont/entry/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..e7569e3056e27af38e9991b7ea73ec10f3ba8a05
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/build-profile.json5
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "apiType": "stageMode",
+ "buildOption": {
+ },
+ "buildOptionSet": [
+ {
+ "name": "release",
+ "arkOptions": {
+ "obfuscation": {
+ "ruleOptions": {
+ "enable": false,
+ "files": [
+ "./obfuscation-rules.txt"
+ ]
+ }
+ }
+ }
+ },
+ ],
+ "targets": [
+ {
+ "name": "default"
+ },
+ {
+ "name": "ohosTest",
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/hvigorfile.ts b/ArkWebKit/ProcessWebPageCont/entry/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..98d52319cb1dee60511b5716dba03b76e68a6d8b
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/hvigorfile.ts
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2025 Huawei Device Co., Ltd.
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import { hapTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+}
diff --git a/ArkWebKit/ProcessWebPageCont/entry/obfuscation-rules.txt b/ArkWebKit/ProcessWebPageCont/entry/obfuscation-rules.txt
new file mode 100644
index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/obfuscation-rules.txt
@@ -0,0 +1,23 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope
+
+-enable-property-obfuscation
+-enable-toplevel-obfuscation
+-enable-filename-obfuscation
+-enable-export-obfuscation
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/oh-package.json5 b/ArkWebKit/ProcessWebPageCont/entry/oh-package.json5
new file mode 100644
index 0000000000000000000000000000000000000000..c9cb6c8174858277c9b0d465a51547dcab16d5ff
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/oh-package.json5
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "name": "entry",
+ "version": "1.0.0",
+ "description": "Please describe the basic information.",
+ "main": "",
+ "author": "",
+ "license": "",
+ "dependencies": {}
+}
+
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/entryability/EntryAbility.ets b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/entryability/EntryAbility.ets
new file mode 100644
index 0000000000000000000000000000000000000000..82e98bec44d83d2df03deb52508045cb06cc8604
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/entryability/EntryAbility.ets
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit';
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { window } from '@kit.ArkUI';
+
+export default class EntryAbility extends UIAbility {
+ onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
+ hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
+ }
+
+ onDestroy(): void {
+ hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
+ }
+
+ onWindowStageCreate(windowStage: window.WindowStage): void {
+ // Main window is created, set main page for this ability
+ hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
+
+ windowStage.loadContent('pages/Index', (err) => {
+ if (err.code) {
+ hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
+ return;
+ }
+ hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
+ });
+ }
+
+ onWindowStageDestroy(): void {
+ // Main window is destroyed, release UI related resources
+ hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
+ }
+
+ onForeground(): void {
+ // Ability has brought to foreground
+ hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
+ }
+
+ onBackground(): void {
+ // Ability has back to background
+ hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
+ }
+}
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets
new file mode 100644
index 0000000000000000000000000000000000000000..29feaca7669174be5c2b0e2366529ee94ab7e726
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit';
+
+export default class EntryBackupAbility extends BackupExtensionAbility {
+ async onBackup() {
+ hilog.info(0x0000, 'testTag', 'onBackup ok');
+ }
+
+ async onRestore(bundleVersion: BundleVersion) {
+ hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion));
+ }
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/CalcAdjustSafeArea.ets b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/CalcAdjustSafeArea.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e813d66410ad9fd1471e91b9d66567fe4883a46f
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/CalcAdjustSafeArea.ets
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// [Start use_expand_safe_area_to_enable_immersive_effect]
+import { webview } from '@kit.ArkWeb';
+
+@Entry
+@Component
+struct WebComponent {
+ controller: webview.WebviewController = new webview.WebviewController();
+
+ build() {
+ Column() {
+ Web({ src: 'www.example.com', controller: this.controller })
+ .width('100%').height('100%')
+ // 扩展至系统默认非安全区域(状态栏、导航栏),并设置只扩展上方区域和下方区域
+ .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
+ }
+ }
+}
+// [End use_expand_safe_area_to_enable_immersive_effect]
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/Index.ets b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/Index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1def271b5633e957e9dd40c3b9591542f5cae01f
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/Index.ets
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { router } from '@kit.ArkUI';
+
+@Entry
+@Component
+struct Index {
+ build() {
+ Column({ space: 10 }) {
+ Button('InitiatePrintW3CAPI')
+ .onClick(() => {
+ router.pushUrl({ url: 'pages/InitiatePrintW3CAPI' });
+ })
+ Button('InitiatePrintAppAPI')
+ .onClick(() => {
+ router.pushUrl({ url: 'pages/InitiatePrintAppAPI' });
+ })
+ Button('PreviewPDF')
+ .onClick(() => {
+ router.pushUrl({ url: 'pages/PreviewPDF' });
+ })
+ Button('CalcAdjustSafeArea')
+ .onClick(() => {
+ router.pushUrl({ url: 'pages/CalcAdjustSafeArea' });
+ })
+ }.height('100%')
+ .width('100%')
+ }
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/InitiatePrintAppAPI.ets b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/InitiatePrintAppAPI.ets
new file mode 100644
index 0000000000000000000000000000000000000000..30eecf7173f0c347787a368ec2b185ff925d4e3d
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/InitiatePrintAppAPI.ets
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// [Start create_web_print_document]
+import { webview } from '@kit.ArkWeb';
+import { BusinessError } from '@kit.BasicServicesKit';
+import { print } from '@kit.BasicServicesKit';
+
+@Entry
+@Component
+struct WebComponent {
+ controller: webview.WebviewController = new webview.WebviewController();
+
+ build() {
+ Column() {
+ Button('createWebPrintDocumentAdapter')
+ .onClick(() => {
+ try {
+ let webPrintDocadapter = this.controller.createWebPrintDocumentAdapter('example.pdf');
+ print.print('example_jobid', webPrintDocadapter, null, getContext());
+ } catch (error) {
+ console.error(`ErrorCode: ${(error as BusinessError).code}, Message: ${(error as BusinessError).message}`);
+ }
+ })
+ Web({ src: 'www.example.com', controller: this.controller });
+ }
+ }
+}
+// [End create_web_print_document]
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/InitiatePrintW3CAPI.ets b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/InitiatePrintW3CAPI.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7d1281e593d6ba6c272dcd97a49da7cc006a16c2
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/InitiatePrintW3CAPI.ets
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// [Start w3c_print_html]
+import { webview } from '@kit.ArkWeb';
+
+@Entry
+@Component
+struct Index {
+ controller: webview.WebviewController = new webview.WebviewController();
+
+ build() {
+ Row() {
+ Column() {
+ Web({ src: $rawfile('print.html'), controller: this.controller })
+ .javaScriptAccess(true)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+// [End w3c_print_html]
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/PreviewPDF.ets b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/PreviewPDF.ets
new file mode 100644
index 0000000000000000000000000000000000000000..74725488de3036aa82a5af0e94132ad567a521ac
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/ets/pages/PreviewPDF.ets
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// [Start web_module_create_load_pdf]
+import { webview } from '@kit.ArkWeb';
+
+@Entry
+@Component
+struct WebComponent {
+ controller: webview.WebviewController = new webview.WebviewController();
+
+ build() {
+ Column() {
+ Web({
+ src:
+ 'https://www.example.com/test.pdf', // 方式一 加载网络PDF文档
+ // this.getUIContext().getHostContext()!.filesDir + '/test.pdf', // 方式二 加载本地应用沙箱内PDF文档
+ // 'resource://rawfile/test.pdf', // 方式三 本地PDF文档 (格式一)
+ // $rawfile('test.pdf'), // 方式三 本地PDF文档 (格式二)
+ controller: this.controller
+ })
+ .domStorageAccess(true)
+ }
+ }
+}
+// [End web_module_create_load_pdf]
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/module.json5 b/ArkWebKit/ProcessWebPageCont/entry/src/main/module.json5
new file mode 100644
index 0000000000000000000000000000000000000000..c86fd002393d2ddfc6c6bace607995445ec7cf74
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/module.json5
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "description": "$string:module_desc",
+ "mainElement": "EntryAbility",
+ "deviceTypes": [
+ "default",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "abilities": [
+ {
+ "name": "EntryAbility",
+ "srcEntry": "./ets/entryability/EntryAbility.ets",
+ "description": "$string:EntryAbility_desc",
+ "icon": "$media:layered_image",
+ "label": "$string:EntryAbility_label",
+ "startWindowIcon": "$media:startIcon",
+ "startWindowBackground": "$color:start_window_background",
+ "exported": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ],
+ "extensionAbilities": [
+ {
+ "name": "EntryBackupAbility",
+ "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets",
+ "type": "backup",
+ "exported": false,
+ "metadata": [
+ {
+ "name": "ohos.extension.backup",
+ "resource": "$profile:backup_config"
+ }
+ ]
+ }
+ ],
+ // [Start web_module_print_html]
+ // [Start web_module_preview_pdf]
+ "requestPermissions":[
+ // [StartExclude web_module_print_html]
+ {
+ "name" : "ohos.permission.INTERNET"
+ }
+ // [EndExclude web_module_print_html]
+ ],
+ // [End web_module_preview_pdf]
+ // [End web_module_print_html]
+ }
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/element/color.json b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/element/color.json
@@ -0,0 +1,8 @@
+{
+ "color": [
+ {
+ "name": "start_window_background",
+ "value": "#FFFFFF"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/element/string.json b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..1f758cd41cf67e4c769d7526ee83f962d0d865c6
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,20 @@
+{
+ "string": [
+ {
+ "name": "module_desc",
+ "value": "module description"
+ },
+ {
+ "name": "EntryAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "EntryAbility_label",
+ "value": "ProcessWebPageCont"
+ },
+ {
+ "name": "web_path",
+ "value": "https://www.example.com/test.pdf"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/background.png b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/background.png
new file mode 100644
index 0000000000000000000000000000000000000000..f939c9fa8cc8914832e602198745f592a0dfa34d
Binary files /dev/null and b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/background.png differ
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/foreground.png b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/foreground.png
new file mode 100644
index 0000000000000000000000000000000000000000..4483ddad1f079e1089d685bd204ee1cfe1d01902
Binary files /dev/null and b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/foreground.png differ
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/layered_image.json b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/layered_image.json
new file mode 100644
index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/layered_image.json
@@ -0,0 +1,7 @@
+{
+ "layered-image":
+ {
+ "background" : "$media:background",
+ "foreground" : "$media:foreground"
+ }
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/startIcon.png b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/startIcon.png
new file mode 100644
index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b
Binary files /dev/null and b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/media/startIcon.png differ
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/profile/backup_config.json b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/profile/backup_config.json
new file mode 100644
index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/profile/backup_config.json
@@ -0,0 +1,3 @@
+{
+ "allowToBackupRestore": true
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/profile/main_pages.json b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..ead1e2c5ae06ebd7246b0a4028b9899b3de9574a
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,9 @@
+{
+ "src": [
+ "pages/Index",
+ "pages/InitiatePrintW3CAPI",
+ "pages/InitiatePrintAppAPI",
+ "pages/PreviewPDF",
+ "pages/CalcAdjustSafeArea"
+ ]
+}
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/en_US/element/string.json b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/en_US/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..448a2a5210af13626ae587985d80eb8c51800e4d
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/en_US/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "module_desc",
+ "value": "module description"
+ },
+ {
+ "name": "EntryAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "EntryAbility_label",
+ "value": "ProcessWebPageCont"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/rawfile/print.html b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/rawfile/print.html
new file mode 100644
index 0000000000000000000000000000000000000000..7225f16ebc840f16091bc9e7c75380f4c1104470
--- /dev/null
+++ b/ArkWebKit/ProcessWebPageCont/entry/src/main/resources/rawfile/print.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
content content content
+| Thing | +Chairs | +
| 1 | +blue | +
| 2 | +green | +
content content content
+content content content
+