Explorar el Código

ComPDFKit(flutter) - v2.1.3

liuxiaolong hace 2 semanas
padre
commit
ff3ab3b90d

+ 15 - 0
CHANGELOG.md

@@ -1,3 +1,18 @@
+## 2.1.3
+* Added the features support for ComPDFKit PDF SDK for iOS V2.1.3.
+* Added the features support for ComPDFKit PDF SDK for Android V2.1.3.
+* Android:
+  * Fixed crash issue when opening certain documents.
+  * Fixed crash issue when adding mark annotations to some documents.
+  * Fixed potential crash during SDK initialization.
+  * Fixed incomplete display of underline annotations.
+  * Fixed abnormal annotation display after rotating the page.
+  * Fixed crash when releasing watermarks.
+  * Fixed memory leak in the property window of the ComPDFKit_Tools module.
+* iOS:
+  * iOS annotation toolbar image button adaptation for iPad.
+  * RN iOS sandbox structure modification.
+
 ## 2.1.2
 
 * Added the features support for ComPDFKit PDF SDK for iOS V2.1.2.

+ 6 - 6
README.md

@@ -151,7 +151,7 @@ Alternatively you can update the `AndroidManifest.xml` file to use `FlutterFragm
  dependencies:
    flutter:
      sdk: flutter
-+  compdfkit_flutter: ^2.1.2
++  compdfkit_flutter: ^2.1.3
 ```
 
 8. Add the PDF documents you want to display in the project
@@ -197,7 +197,7 @@ cd example
  dependencies:
    flutter:
      sdk: flutter
-+  compdfkit_flutter: ^2.1.2
++  compdfkit_flutter: ^2.1.3
 ```
 
 4. Open your project's Podfile in a text editor:
@@ -220,8 +220,8 @@ open ios/Podfile
    use_modular_headers!`
 
    flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
-+  pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.2.podspec'
-+  pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.2.podspec'
++  pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.3.podspec'
++  pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.3.podspec'
 
  end
 ```
@@ -557,8 +557,8 @@ target 'PDFView_RN' do
     # Pods for testing
   end
 
-+  pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.2'
-+  pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.2'
++  pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.3'
++  pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.3'
 
   # Enables Flipper.
   #

+ 1 - 1
android/build.gradle

@@ -40,7 +40,7 @@ android {
         implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
 
         // dependencies compdfkit pdf sdk
-        api 'com.compdf:compdfkit-tools:2.1.2'
+        api 'com.compdf:compdfkit-tools:2.1.3'
 
         testImplementation 'junit:junit:4.13.2'
         testImplementation 'org.mockito:mockito-core:5.0.0'

+ 3 - 3
example/README.md

@@ -20,9 +20,9 @@ Please install the following required packages:
 
 Operating Environment Requirements:
 
-* A minSdkVersion of `19` or higher.
-* A `compileSdkVersion` of `30` or higher.
-* A `targetSdkVersion` of `30` or higher.
+* A minSdkVersion of `21` or higher.
+* A `compileSdkVersion` of `33` or higher.
+* A `targetSdkVersion` of `33` or higher.
 * Android ABI(s): x86, x86_64, armeabi-v7a, arm64-v8a.
 
 

+ 2 - 2
example/ios/Podfile

@@ -31,8 +31,8 @@ target 'Runner' do
   use_frameworks!
   use_modular_headers!
 
-  pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.2.podspec'
-  pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.2.podspec'
+  pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.3.podspec'
+  pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.3.podspec'
   flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
   target 'RunnerTests' do
     inherit! :search_paths

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

@@ -490,7 +490,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
-				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				DEVELOPMENT_TEAM = 59AC9PMNH2;
 				ENABLE_BITCODE = NO;
 				FLUTTER_BUILD_NAME = 2.1.2;
 				FLUTTER_BUILD_NUMBER = 2.1.2;
@@ -680,7 +680,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
-				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				DEVELOPMENT_TEAM = 59AC9PMNH2;
 				ENABLE_BITCODE = NO;
 				FLUTTER_BUILD_NAME = 2.1.2;
 				FLUTTER_BUILD_NUMBER = 2.1.2;
@@ -709,7 +709,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
-				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				DEVELOPMENT_TEAM = 59AC9PMNH2;
 				ENABLE_BITCODE = NO;
 				FLUTTER_BUILD_NAME = 2.1.2;
 				FLUTTER_BUILD_NUMBER = 2.1.2;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 7 - 1
example/lib/main.dart


+ 1 - 1
example/pubspec.lock

@@ -55,7 +55,7 @@ packages:
       path: ".."
       relative: true
     source: path
-    version: "2.1.2"
+    version: "2.1.3"
   cross_file:
     dependency: transitive
     description:

+ 1 - 1
example/pubspec.yaml

@@ -1,6 +1,6 @@
 name: compdfkit_flutter_example
 description: Demonstrates how to use the compdfkit_flutter plugin.
-version: 2.1.2
+version: 2.1.3
 homepage: https://www.compdf.com
 repository: https://github.com/ComPDFKit/compdfkit-pdf-sdk-flutter
 issue_tracker: https://www.compdf.com/support

+ 15 - 3
ios/Classes/CompdfkitFlutterPlugin.swift

@@ -8,7 +8,7 @@ public class CompdfkitFlutterPlugin: NSObject, FlutterPlugin, CPDFViewBaseContro
         let channel = FlutterMethodChannel(name: "com.compdfkit.flutter.plugin", binaryMessenger: registrar.messenger())
         let instance = CompdfkitFlutterPlugin()
         registrar.addMethodCallDelegate(instance, channel: channel)
-
+        
         let factory = CPDFViewCtrlFactory(messenger: registrar.messenger())
         registrar.register(factory, withId: "com.compdfkit.flutter.ui.pdfviewer")
     }
@@ -35,7 +35,19 @@ public class CompdfkitFlutterPlugin: NSObject, FlutterPlugin, CPDFViewBaseContro
             let jsonString = initInfo?["configuration"] ?? ""
             _ = initInfo?["password"] ?? ""
             let path = initInfo?["document"] as? String ?? ""
-
+            let document = NSURL(fileURLWithPath: path)
+            
+            let fileManager = FileManager.default
+            let samplesFilePath = NSHomeDirectory().appending("/Documents/Files")
+            let fileName = document.lastPathComponent ?? ""
+            let docsFilePath = samplesFilePath + "/" + fileName
+            
+            if !fileManager.fileExists(atPath: samplesFilePath) {
+                try? FileManager.default.createDirectory(atPath: samplesFilePath, withIntermediateDirectories: true, attributes: nil)
+            }
+            
+            try? FileManager.default.copyItem(atPath: document.path ?? "", toPath: docsFilePath)
+            
             let jsonDataParse = CPDFJSONDataParse(String: jsonString as! String)
             guard let configuration = jsonDataParse.configuration else { return }
             if let rootViewControl = UIApplication.shared.keyWindow?.rootViewController {
@@ -45,7 +57,7 @@ public class CompdfkitFlutterPlugin: NSObject, FlutterPlugin, CPDFViewBaseContro
                     tRootViewControl = presentedViewController
                 }
                 
-                let pdfViewController = CPDFViewController(filePath: path, password: nil, configuration: configuration)
+                let pdfViewController = CPDFViewController(filePath: docsFilePath, password: nil, configuration: configuration)
                 let navController = CNavigationController(rootViewController: pdfViewController)
                 pdfViewController.delegate = self
                 navController.modalPresentationStyle = .fullScreen

+ 14 - 1
ios/Classes/reader/CPDFViewCtrlFactory.swift

@@ -58,11 +58,24 @@ class CPDFViewCtrlFlutter: NSObject, FlutterPlatformView, CPDFViewBaseController
         let password = initInfo?["password"] ?? ""
         let path = initInfo?["document"] as? String ?? ""
         
+        let document = NSURL(fileURLWithPath: path)
+        
+        let fileManager = FileManager.default
+        let samplesFilePath = NSHomeDirectory().appending("/Documents/Files")
+        let fileName = document.lastPathComponent ?? ""
+        let docsFilePath = samplesFilePath + "/" + fileName
+        
+        if !fileManager.fileExists(atPath: samplesFilePath) {
+            try? FileManager.default.createDirectory(atPath: samplesFilePath, withIntermediateDirectories: true, attributes: nil)
+        }
+        
+        try? FileManager.default.copyItem(atPath: document.path ?? "", toPath: docsFilePath)
+        
         let jsonDataParse = CPDFJSONDataParse(String: jsonString as! String)
         let configuration = jsonDataParse.configuration
         
         // Create the pdfview controller view
-        pdfViewController = CPDFViewController(filePath: path, password: password as? String, configuration: configuration!)
+        pdfViewController = CPDFViewController(filePath: docsFilePath, password: password as? String, configuration: configuration!)
         
         navigationController = CNavigationController(rootViewController: pdfViewController)
         navigationController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]

+ 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: 2.1.2
+version: 2.1.3
 homepage: https://www.compdf.com
 repository: https://github.com/ComPDFKit/compdfkit-pdf-sdk-flutter
 issue_tracker: https://www.compdf.com/support