Browse Source

ComPDFKit(flutter) - compdfkit_flutter 1.13.0-dev.2

liuxiaolong 1 year ago
parent
commit
ef90621db3

+ 13 - 6
CHANGELOG.md

@@ -1,12 +1,19 @@
-## 1.13.0
+## 1.13.0-dev.2
+* Added Android platform support for back button configuration in the configuration function
+```dart
+var configuration = CPDFConfiguration(
+        toolbarConfig: const ToolbarConfig(androidAvailableActions: [
+          ToolbarAction.back
+        ]),);
+```
+* Added setting page equal width configuration in the configuration function
+```dart
+var configuration = CPDFConfiguration(
+        readerViewConfig: const ReaderViewConfig(pageSameWidth: true));
+```
 
-* Added the features support for ComPDFKit PDF SDK for iOS V1.13.0.
-* Added the features support for ComPDFKit PDF SDK for Android V1.13.0.
-* Added support for online license verification function. 
-* Added `ComPDFKit.initialize(androidOnlineLicense : String, iosOnlineLicense : String)` method.
 
 ## 1.13.0-dev.1
-
 * Added the features support for ComPDFKit PDF SDK for iOS V1.13.0-beta.
 * Added the features support for ComPDFKit PDF SDK for Android V1.13.0-SNAPSHOT.
 * Deprecated ~~`ComPDFKit.init`~~ method, please use `ComPDFKit.initialize(String key, {bool offline})` method.

+ 4 - 3
README.md

@@ -89,10 +89,11 @@ cd example
     <!-- Required to read and write documents from device storage -->
 +    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
 +    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+  
+    <!-- Optional settings -->
 +    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
 
 
-
     <application
 +      android:requestLegacyExternalStorage="true">
   
@@ -124,7 +125,7 @@ open android/app/build.gradle
  dependencies:
    flutter:
      sdk: flutter
-+  compdfkit_flutter: ^1.13.0
++  compdfkit_flutter: ^1.13.0-dev.2
 ```
 
 7. From the terminal app, run the following command to get all the packages:
@@ -280,7 +281,7 @@ cd example
  dependencies:
    flutter:
      sdk: flutter
-+  compdfkit_flutter: ^1.13.0
++  compdfkit_flutter: ^1.13.0-dev.2
 ```
 
 4. From the terminal app, run the following command to get all the packages:

+ 4 - 4
android/build.gradle

@@ -41,9 +41,9 @@ android {
         implementation 'com.google.android.material:material:1.8.0'
         implementation 'androidx.appcompat:appcompat:1.6.1'
         implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
-        api 'com.compdf:compdfkit:1.13.0'
-        api 'com.compdf:compdfkit-ui:1.13.0'
-        api ('com.compdf:compdfkit-tools:1.13.0')
+        api 'com.compdf:compdfkit:1.13.0-SNAPSHOT'
+        api 'com.compdf:compdfkit-ui:1.13.0-SNAPSHOT'
+        api ('com.compdf:compdfkit-tools:1.13.0-SNAPSHOT')
 
         testImplementation 'junit:junit:4.13.2'
         testImplementation 'org.mockito:mockito-core:5.0.0'
@@ -63,5 +63,5 @@ android {
     }
 }
 // refresh snapshot implementation
-//configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' }
+configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' }
 

+ 3 - 3
example/ios/Runner.xcodeproj/project.pbxproj

@@ -477,7 +477,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.example;
+				PRODUCT_BUNDLE_IDENTIFIER = com.mybrandzx.app;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
@@ -658,7 +658,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.example;
+				PRODUCT_BUNDLE_IDENTIFIER = com.mybrandzx.app;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -683,7 +683,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.example;
+				PRODUCT_BUNDLE_IDENTIFIER = com.mybrandzx.app;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;

+ 40 - 3
example/pubspec.lock

@@ -47,7 +47,7 @@ packages:
       path: ".."
       relative: true
     source: path
-    version: "1.13.0"
+    version: "1.13.0-dev.2"
   cupertino_icons:
     dependency: "direct main"
     description:
@@ -64,6 +64,14 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "1.3.1"
+  ffi:
+    dependency: transitive
+    description:
+      name: ffi
+      sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.0"
   file:
     dependency: transitive
     description:
@@ -72,6 +80,14 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "6.1.4"
+  file_picker:
+    dependency: "direct main"
+    description:
+      name: file_picker
+      sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6"
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.1.1"
   flutter:
     dependency: "direct main"
     description: flutter
@@ -90,11 +106,24 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "2.0.3"
+  flutter_plugin_android_lifecycle:
+    dependency: transitive
+    description:
+      name: flutter_plugin_android_lifecycle
+      sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.0.17"
   flutter_test:
     dependency: "direct dev"
     description: flutter
     source: sdk
     version: "0.0.0"
+  flutter_web_plugins:
+    dependency: transitive
+    description: flutter
+    source: sdk
+    version: "0.0.0"
   fuchsia_remote_debug_protocol:
     dependency: transitive
     description: flutter
@@ -262,6 +291,14 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "3.0.2"
+  win32:
+    dependency: transitive
+    description:
+      name: win32
+      sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
+      url: "https://pub.dev"
+    source: hosted
+    version: "5.2.0"
 sdks:
-  dart: ">=3.2.0-194.0.dev <4.0.0"
-  flutter: ">=3.3.0"
+  dart: ">=3.2.0 <4.0.0"
+  flutter: ">=3.7.0"

+ 3 - 1
example/pubspec.yaml

@@ -1,6 +1,6 @@
 name: compdfkit_flutter_example
 description: Demonstrates how to use the compdfkit_flutter plugin.
-version: 1.13.0
+version: 1.13.0-dev.2
 homepage: https://www.compdf.com
 repository: https://github.com/ComPDFKit/compdfkit-pdf-sdk-flutter
 issue_tracker: https://www.compdf.com/support
@@ -30,6 +30,8 @@ dependencies:
   # The following adds the Cupertino Icons font to your application.
   # Use with the CupertinoIcons class for iOS style icons.
   cupertino_icons: ^1.0.2
+  file_picker: ^6.1.1
+
 
 dev_dependencies:
   integration_test:

+ 2 - 1
ios/Classes/CompdfkitFlutterPlugin.swift

@@ -17,7 +17,8 @@ public class CompdfkitFlutterPlugin: NSObject, FlutterPlugin, CPDFViewBaseContro
         case "init_sdk":
             let initInfo = call.arguments as? [String: Any]
             let key = initInfo?["key"] ?? ""
-            CPDFKit.verify(withKey: key as? String)
+            let code = CPDFKit.verify(withKey: key as? String)
+            print("Code \(code)")
         case "init_sdk_keys":
             let initInfo = call.arguments as? [String: Any]
             let key = initInfo?["iosOnlineLicense"] ?? ""

+ 7 - 2
lib/cpdf_configuration.dart

@@ -148,6 +148,9 @@ class ReaderViewConfig {
 
   final double pageScale;
 
+  /// only android platform
+  final bool pageSameWidth;
+
   const ReaderViewConfig(
       {this.linkHighlight = true,
       this.formFieldHighlight = true,
@@ -159,7 +162,8 @@ class ReaderViewConfig {
       this.enableSliderBar = true,
       this.enablePageIndicator = true,
       this.pageSpacing = 10,
-      this.pageScale = 1.0});
+      this.pageScale = 1.0,
+      this.pageSameWidth = true});
 
   Map<String, dynamic> toJson() => {
         'linkHighlight': linkHighlight,
@@ -172,7 +176,8 @@ class ReaderViewConfig {
         'enableSliderBar': enableSliderBar,
         'enablePageIndicator': enablePageIndicator,
         'pageSpacing': pageSpacing,
-        'pageScale': pageScale
+        'pageScale': pageScale,
+        'pageSameWidth': pageSameWidth
       };
 }
 

+ 1 - 0
lib/cpdf_options.dart

@@ -7,6 +7,7 @@
 
 enum CPreviewMode { viewer, annotations, contentEditor, forms, signatures }
 
+/// The [ToolbarAction.back] button will only be displayed on the leftmost side of the top toolbar on the Android platform
 enum ToolbarAction { back, thumbnail, search, bota, menu }
 
 enum ToolbarMenuAction {

+ 1 - 1
pubspec.yaml

@@ -1,6 +1,6 @@
 name: compdfkit_flutter
 description: ComPDFKit for Flutter is a comprehensive SDK that allows you to quickly add PDF functionality to Android and iOS Flutter applications.
-version: 1.13.0
+version: 1.13.0-dev.2
 homepage: https://www.compdf.com
 repository: https://github.com/ComPDFKit/compdfkit-pdf-sdk-flutter
 issue_tracker: https://www.compdf.com/support