瀏覽代碼

compdfkit(rn) - v2.2.2 新增添加水印功能保存方式配置

liuxiaolong 3 周之前
父節點
當前提交
8bc212a3d1

+ 1 - 1
API.md

@@ -957,7 +957,7 @@ Promise Parameters:
 const pageCount = await pdfReaderRef.current?._pdfDocument.getPageCount();
 ```
 
-#### 
+
 
 ### Annotations
 

+ 17 - 2
CHANGELOG.md

@@ -1,4 +1,20 @@
 ## Newest Release
+### 2.2.2 - 19 Feb. 2025
+
+* Added the features support for ComPDFKit PDF SDK for iOS iOS V2.2.2.
+
+* Added the features support for ComPDFKit PDF SDK for Android Android V2.2.2.
+* Added the ability to save a watermark to the current PDF when adding it.
+* Fixed the inaccurate judgment issue in the `hasChange()` method.
+* Fixed an issue where some document text fields in forms were not displaying content.
+* Fixed an issue on the Android platform where Ink annotations became smaller after drawing.
+* Fixed an issue on the Android platform where the pen size shrank when drawing Ink annotations after zooming in on a page.
+* Fixed an input issue with the LaBan Key input method on the Android platform.
+* Fixed a potential crash issue on the Android platform when enabling the rotate function.
+* Fixed a crash issue on the Android platform when importing XFDF annotations.
+
+
+## Previous Release
 
 ### 2.2.1 - 21 Jan. 2025
 * Added the features support for ComPDFKit PDF SDK for iOS [iOS V2.2.1](https://www.compdf.com/pdf-sdk/changelog-ios#v2-2-1).
@@ -19,9 +35,8 @@
 * Fixed an issue on Android where form background color was transparent when highlighting forms was not enabled.
 * Fixed an issue on Android where annotation text would display incorrectly when editing text in highlighted comment areas.
 * Fixed an issue on Android where cloud comment borders were displayed incorrectly in graphic annotations.
-For detailed information about the new interfaces, please refer to `CPDFReaderView.tsx` and `CPDFDocument.tsx`.
+  For detailed information about the new interfaces, please refer to `CPDFReaderView.tsx` and `CPDFDocument.tsx`.
 
-## Previous Release
 
 ### 2.2.0 - 13 Dec. 2024
 * Added features support for ComPDFKit PDF SDK for [Android V2.2.0](https://www.compdf.com/pdf-sdk/changelog-android#v2-2-0).

+ 9 - 5
CONFIGURATION.md

@@ -784,10 +784,11 @@ This section is used to configure the types of forms enabled in the view's botto
 
 ##### Parameters
 
-| Name                    | Type          | Example | Description                                                  |
-| ----------------------- | ------------- | ------- | ------------------------------------------------------------ |
-| themeMode               | CPDFThemeMode | light   | Set the view theme style, support `light`, `dark`, `system`, the default is `light` theme<br />**ComPDFKit SDK for Flutter:** => 2.0.2<br />Only Android Platform. |
-| fileSaveExtraFontSubset | boolean       | true    | When saving a document, whether to save the used font set together with the document. |
+| Name                    | Type                | Example                      | Description                                                  |
+| ----------------------- | ------------------- | ---------------------------- | ------------------------------------------------------------ |
+| themeMode               | CPDFThemeMode       | light                        | Set the view theme style, support `light`, `dark`, `system`, the default is `light` theme<br />**ComPDFKit SDK for Flutter:** => 2.0.2<br />Only Android Platform. |
+| fileSaveExtraFontSubset | boolean             | true                         | When saving a document, whether to save the used font set together with the document. |
+| watermark               | CPDFWatermarkConfig | {   "saveAsNewFile" : true } | The user can configure the watermark addition popup, allowing them to choose whether to save the watermark directly to the current document or save it to a different directory.<br>**true**: Save to a different directory<br>**false**: Add to the current document directly |
 
 ##### themeMode Constants
 
@@ -1066,7 +1067,10 @@ This section is used to configure the types of forms enabled in the view's botto
   },
   "global" : {
     "themeMode" : "system",
-    "fileSaveExtraFontSubset" : true
+    "fileSaveExtraFontSubset" : true,
+    "watermark": {
+      "saveAsNewFile" : true
+    }
   }
 }
 ```

+ 4 - 4
README.md

@@ -115,8 +115,8 @@ open ios/Podfile
 ```diff
 target 'MyApp' do
     # ...
-+    pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.2.1.podspec'
-+  pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.2.1.podspec'
++    pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.2.2.podspec'
++  pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.2.2.podspec'
     # ...
 end
 ```
@@ -126,8 +126,8 @@ end
 ```diff
 target 'MyApp' do
     # ...
-+  pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.2.1'
-+  pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.2.1'
++  pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.2.2'
++  pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.2.2'
     # ...
 end
 ```

+ 1 - 1
android/build.gradle

@@ -86,7 +86,7 @@ dependencies {
   compileOnly fileTree(include: ['*.jar','*.aar'], dir: 'libs')
   implementation "com.facebook.react:react-native:+"
 
-  api "com.compdf:compdfkit-tools:2.2.1"
+  api "com.compdf:compdfkit-tools:2.2.2"
   api 'com.github.bumptech.glide:glide:4.15.1'
   annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
   api 'androidx.documentfile:documentfile:1.0.1'

+ 2 - 2
android/src/main/java/com/compdfkitpdf/reactnative/modules/CPDFViewModule.java

@@ -322,9 +322,9 @@ public class CPDFViewModule extends ReactContextBaseJavaModule {
   }
 
   @ReactMethod
-  public void showAddWatermarkView(int tag){
+  public void showAddWatermarkView(int tag, boolean saveAsNewFile){
     uiBlock(nativeViewHierarchyManager -> {
-      mPDFViewInstance.showAddWatermarkView(tag);
+      mPDFViewInstance.showAddWatermarkView(tag, saveAsNewFile);
     });
   }
 

+ 9 - 8
android/src/main/java/com/compdfkitpdf/reactnative/viewmanager/CPDFViewManager.java

@@ -34,6 +34,7 @@ import com.compdfkit.core.document.CPDFDocumentPermissionInfo;
 import com.compdfkit.tools.common.pdf.CPDFConfigurationUtils;
 import com.compdfkit.tools.common.pdf.config.CPDFConfiguration;
 import com.compdfkit.tools.common.utils.CFileUtils;
+import com.compdfkit.tools.common.utils.print.CPDFPrintUtils;
 import com.compdfkit.tools.common.utils.threadpools.CThreadPoolUtils;
 import com.compdfkit.tools.common.utils.viewutils.CViewUtils;
 import com.compdfkit.tools.common.views.pdfview.CPDFViewCtrl;
@@ -45,6 +46,7 @@ import com.compdfkitpdf.reactnative.util.CPDFDocumentUtil;
 import com.compdfkitpdf.reactnative.view.CPDFView;
 import com.facebook.react.bridge.Promise;
 import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReactMethod;
 import com.facebook.react.uimanager.ThemedReactContext;
 import com.facebook.react.uimanager.ViewGroupManager;
 import com.facebook.react.uimanager.annotations.ReactProp;
@@ -367,9 +369,9 @@ public class CPDFViewManager extends ViewGroupManager<CPDFView> {
     pdfView.documentFragment.showBOTA();
   }
 
-  public void showAddWatermarkView(int tag) {
+  public void showAddWatermarkView(int tag, boolean saveAsNewFile) {
     CPDFView pdfView = mDocumentViews.get(tag);
-    pdfView.documentFragment.showAddWatermarkDialog();
+    pdfView.documentFragment.showAddWatermarkDialog(saveAsNewFile);
   }
 
   public void showSecurityView(int tag) {
@@ -476,11 +478,11 @@ public class CPDFViewManager extends ViewGroupManager<CPDFView> {
   }
 
   public void print(int tag) {
-    CPDFView pdfView = mDocumentViews.get(tag);
-    CPDFReaderView readerView = pdfView.getCPDFReaderView();
-    String path = readerView.getPDFDocument().getAbsolutePath();
-    Uri uri = readerView.getPDFDocument().getUri();
-    CFileUtils.startPrint(reactContext, path, uri);
+    if (reactContext.getCurrentActivity() != null) {
+      CPDFView pdfView = mDocumentViews.get(tag);
+      CPDFReaderView readerView = pdfView.getCPDFReaderView();
+      CPDFPrintUtils.printCurrentDocument(reactContext.getCurrentActivity(), readerView.getPDFDocument());
+    }
   }
 
   public void removePassword(int tag, Promise promise) {
@@ -510,7 +512,6 @@ public class CPDFViewManager extends ViewGroupManager<CPDFView> {
     Promise promise) {
     CPDFView pdfView = mDocumentViews.get(tag);
     CPDFDocument document = pdfView.getCPDFReaderView().getPDFDocument();
-    ;
     CThreadPoolUtils.getInstance().executeIO(() -> {
       try {
         if (!TextUtils.isEmpty(userPassword)) {

+ 82 - 80
example/android/app/build.gradle

@@ -1,4 +1,5 @@
 import groovy.json.JsonSlurper
+
 apply plugin: "com.android.application"
 apply plugin: "org.jetbrains.kotlin.android"
 apply plugin: "com.facebook.react"
@@ -8,48 +9,48 @@ apply plugin: "com.facebook.react"
  * By default you don't need to apply any configuration, just uncomment the lines you need.
  */
 react {
-    /* Folders */
-    //   The root of your project, i.e. where "package.json" lives. Default is '..'
-    // root = file("../")
-    //   The folder where the react-native NPM package is. Default is ../node_modules/react-native
-    // reactNativeDir = file("../node_modules/react-native")
-    //   The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
-    // codegenDir = file("../node_modules/@react-native/codegen")
-    //   The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
-    // cliFile = file("../node_modules/react-native/cli.js")
-
-    /* Variants */
-    //   The list of variants to that are debuggable. For those we're going to
-    //   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
-    //   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
-    // debuggableVariants = ["liteDebug", "prodDebug"]
-
-    /* Bundling */
-    //   A list containing the node command and its flags. Default is just 'node'.
-    // nodeExecutableAndArgs = ["node"]
-    //
-    //   The command to run when bundling. By default is 'bundle'
-    // bundleCommand = "ram-bundle"
-    //
-    //   The path to the CLI configuration file. Default is empty.
-    // bundleConfig = file(../rn-cli.config.js)
-    //
-    //   The name of the generated asset file containing your JS bundle
-    // bundleAssetName = "MyApplication.android.bundle"
-    //
-    //   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
-    // entryFile = file("../js/MyApplication.android.js")
-    //
-    //   A list of extra flags to pass to the 'bundle' commands.
-    //   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
-    // extraPackagerArgs = []
-
-    /* Hermes Commands */
-    //   The hermes compiler command to run. By default it is 'hermesc'
-    // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
-    //
-    //   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
-    // hermesFlags = ["-O", "-output-source-map"]
+  /* Folders */
+  //   The root of your project, i.e. where "package.json" lives. Default is '..'
+  // root = file("../")
+  //   The folder where the react-native NPM package is. Default is ../node_modules/react-native
+  // reactNativeDir = file("../node_modules/react-native")
+  //   The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
+  // codegenDir = file("../node_modules/@react-native/codegen")
+  //   The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
+  // cliFile = file("../node_modules/react-native/cli.js")
+
+  /* Variants */
+  //   The list of variants to that are debuggable. For those we're going to
+  //   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
+  //   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
+  // debuggableVariants = ["liteDebug", "prodDebug"]
+
+  /* Bundling */
+  //   A list containing the node command and its flags. Default is just 'node'.
+  // nodeExecutableAndArgs = ["node"]
+  //
+  //   The command to run when bundling. By default is 'bundle'
+  // bundleCommand = "ram-bundle"
+  //
+  //   The path to the CLI configuration file. Default is empty.
+  // bundleConfig = file(../rn-cli.config.js)
+  //
+  //   The name of the generated asset file containing your JS bundle
+  // bundleAssetName = "MyApplication.android.bundle"
+  //
+  //   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
+  // entryFile = file("../js/MyApplication.android.js")
+  //
+  //   A list of extra flags to pass to the 'bundle' commands.
+  //   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
+  // extraPackagerArgs = []
+
+  /* Hermes Commands */
+  //   The hermes compiler command to run. By default it is 'hermesc'
+  // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
+  //
+  //   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
+  // hermesFlags = ["-O", "-output-source-map"]
 }
 
 /**
@@ -87,52 +88,53 @@ def appVersionName = getAppVersionName()
 def appVersionCode = getAppVersionCode()
 
 android {
-    ndkVersion rootProject.ext.ndkVersion
-    buildToolsVersion rootProject.ext.buildToolsVersion
-    compileSdk rootProject.ext.compileSdkVersion
-
-    namespace "com.compdfkit.reactnative.example"
-    defaultConfig {
-        applicationId "com.compdfkit.reactnative.example"
-        minSdkVersion rootProject.ext.minSdkVersion
-        targetSdkVersion rootProject.ext.targetSdkVersion
-        versionCode appVersionCode
-        versionName appVersionName
+  ndkVersion rootProject.ext.ndkVersion
+  buildToolsVersion rootProject.ext.buildToolsVersion
+  compileSdk rootProject.ext.compileSdkVersion
+
+  namespace "com.compdfkit.reactnative.example"
+  defaultConfig {
+    applicationId "com.compdfkit.reactnative.example"
+    minSdkVersion rootProject.ext.minSdkVersion
+    targetSdkVersion rootProject.ext.targetSdkVersion
+    versionCode appVersionCode
+    versionName appVersionName
+  }
+  signingConfigs {
+    debug {
+      storeFile file('debug.keystore')
+      storePassword 'android'
+      keyAlias 'androiddebugkey'
+      keyPassword 'android'
     }
-    signingConfigs {
-        debug {
-            storeFile file('debug.keystore')
-            storePassword 'android'
-            keyAlias 'androiddebugkey'
-            keyPassword 'android'
-        }
+  }
+  buildTypes {
+    debug {
+      signingConfig signingConfigs.debug
     }
-    buildTypes {
-        debug {
-            signingConfig signingConfigs.debug
-        }
-        release {
-            // Caution! In production, you need to generate your own keystore file.
-            // see https://reactnative.dev/docs/signed-apk-android.
-            signingConfig signingConfigs.debug
-            minifyEnabled enableProguardInReleaseBuilds
-            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
-        }
+    release {
+      minifyEnabled true
+      // Caution! In production, you need to generate your own keystore file.
+      // see https://reactnative.dev/docs/signed-apk-android.
+      signingConfig signingConfigs.debug
+      minifyEnabled enableProguardInReleaseBuilds
+      proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
     }
+  }
 }
 
 dependencies {
-  implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
+  implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
 
-    // The version of react-native is set by the React Native Gradle Plugin
-    implementation("com.facebook.react:react-android")
-    implementation 'com.google.android.material:material:1.8.0'
+  // The version of react-native is set by the React Native Gradle Plugin
+  implementation("com.facebook.react:react-android")
+  implementation 'com.google.android.material:material:1.8.0'
 
-    if (hermesEnabled.toBoolean()) {
-        implementation("com.facebook.react:hermes-android")
-    } else {
-        implementation jscFlavor
-    }
+  if (hermesEnabled.toBoolean()) {
+    implementation("com.facebook.react:hermes-android")
+  } else {
+    implementation jscFlavor
+  }
 }
 
 apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

+ 2 - 2
example/ios/CompdfkitPdfExample.xcodeproj/project.pbxproj

@@ -510,7 +510,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 2.2.1;
+				MARKETING_VERSION = 2.2.2;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
@@ -547,7 +547,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 2.2.1;
+				MARKETING_VERSION = 2.2.2;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = (
 					"$(inherited)",

+ 2 - 2
example/ios/Podfile

@@ -16,8 +16,8 @@ end
 
 target 'CompdfkitPdfExample' do
   config = use_native_modules!
-  pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.2.1.podspec'
-  pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.2.1.podspec'
+  pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.2.2.podspec'
+  pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.2.2.podspec'
 
 
   use_react_native!(

+ 2 - 2
example/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@compdfkit_pdf_sdk/react_native-example",
-  "version": "2.2.1",
-  "versionCode": "13",
+  "version": "2.2.2",
+  "versionCode": "14",
   "private": true,
   "scripts": {
     "android": "react-native run-android",

+ 1 - 1
example/src/CPDFReaderViewControllerExample.tsx

@@ -122,7 +122,7 @@ const CPDFReaderViewControllerExampleScreen = () => {
                 await pdfReaderRef.current?.showBotaView();
                 break;
             case 'showAddWatermarkView':
-                await pdfReaderRef.current?.showAddWatermarkView();
+                await pdfReaderRef.current?.showAddWatermarkView(false);
                 break;
             case 'showSecurityView':
                 await pdfReaderRef.current?.showSecurityView();

+ 2 - 2
ios/RCTCPDFView.swift

@@ -394,8 +394,8 @@ class RCTCPDFView: UIView, CPDFViewBaseControllerDelete {
         self.pdfViewController?.buttonItemClicked_Bota(UIButton(frame: .zero))
     }
     
-    func showAddWatermarkView() {
-        self.pdfViewController?.enterPDFWatermark()
+  func showAddWatermarkView(saveAsNewFile : Bool) {
+    self.pdfViewController?.enterPDFWatermark(isSaveAs: saveAsNewFile)
     }
     
     func showSecurityView() {

+ 2 - 2
ios/RCTCPDFViewManager.swift

@@ -214,9 +214,9 @@ class RCTCPDFReaderView: RCTViewManager, RCTCPDFViewDelegate {
         rtcCPDFView?.showBotaView()
     }
     
-    func showAddWatermarkView(forCPDFViewTag tag : Int) {
+  func showAddWatermarkView(forCPDFViewTag tag : Int, saveAsNewFile : Bool) {
         let rtcCPDFView = cpdfViews[tag]
-        rtcCPDFView?.showAddWatermarkView()
+    rtcCPDFView?.showAddWatermarkView(saveAsNewFile: saveAsNewFile)
     }
     
     func showSecurityView(forCPDFViewTag tag : Int) {

+ 2 - 1
ios/RCTDocumentManager.m

@@ -116,7 +116,8 @@ RCT_EXTERN_METHOD(showThumbnailView:(NSInteger *)tag
 
 RCT_EXTERN_METHOD(showBotaView:(NSInteger *)tag)
 
-RCT_EXTERN_METHOD(showAddWatermarkView:(NSInteger *)tag)
+RCT_EXTERN_METHOD(showAddWatermarkView:(NSInteger *)tag
+                  withSaveAsNewFile: (BOOL) saveAsNewFile)
 
 RCT_EXTERN_METHOD(showSecurityView:(NSInteger *)tag)
 

+ 3 - 3
ios/RCTDocumentManager.swift

@@ -313,11 +313,11 @@ class RCTDocumentManager: NSObject, RCTBridgeModule {
         }
     }
     
-    @objc(showAddWatermarkView:)
-    func showAddWatermarkView(forCPDFViewTag tag : Int) {
+    @objc(showAddWatermarkView:withSaveAsNewFile:)
+    func showAddWatermarkView(forCPDFViewTag tag : Int, saveAsNewFile : Bool) {
         DispatchQueue.main.async {
             let reader = self.readerView()
-            reader.showAddWatermarkView(forCPDFViewTag: tag)
+          reader.showAddWatermarkView(forCPDFViewTag: tag, saveAsNewFile: saveAsNewFile)
         }
     }
     

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@compdfkit_pdf_sdk/react_native",
-  "version": "2.2.1",
+  "version": "2.2.2",
   "description": "ComPDFKit for React Native is a comprehensive SDK that allows you to quickly add PDF functionality to Android, iOS, and React Native applications.",
   "main": "./src/index.tsx",
   "source": "src/index",

+ 4 - 1
src/configuration/CPDFConfiguration.ts

@@ -436,7 +436,10 @@ export class CPDFConfiguration {
 
     global? : {
         themeMode?: CPDFThemeMode,
-        fileSaveExtraFontSubset?: boolean
+        fileSaveExtraFontSubset?: boolean,
+        watermark?: {
+          saveAsNewFile?: boolean
+        }
     }
 };
 

+ 4 - 1
src/index.tsx

@@ -467,7 +467,10 @@ function getDefaultConfig(overrides : Partial<CPDFConfiguration> = {}) : string
     },
     global: {
       themeMode: CPDFThemeMode.SYSTEM,
-      fileSaveExtraFontSubset: true
+      fileSaveExtraFontSubset: true,
+      watermark: {
+        saveAsNewFile: true
+      }
     }
   }
   return JSON.stringify(mergeDeep(defaultConfig, overrides), null, 2);

+ 2 - 2
src/view/CPDFReaderView.tsx

@@ -724,10 +724,10 @@ export class CPDFReaderView extends PureComponent<CPDFReaderViewProps, any> {
    *
    * @returns
    */
-  showAddWatermarkView = () : Promise<void> => {
+  showAddWatermarkView = (saveAsNewFile : boolean = true) : Promise<void> => {
     const tag = findNodeHandle(this._viewerRef);
     if(tag != null){
-      return CPDFViewManager.showAddWatermarkView(tag);
+      return CPDFViewManager.showAddWatermarkView(tag, saveAsNewFile);
     }
     return Promise.resolve();
   }