Skip to content

Commit df16c0c

Browse files
committed
compdfkit_flutter 2.1.3
1 parent 31ffb8d commit df16c0c

File tree

11 files changed

+61
-25
lines changed

11 files changed

+61
-25
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 2.1.3
2+
* Added the features support for ComPDFKit PDF SDK for iOS V2.1.3.
3+
* Added the features support for ComPDFKit PDF SDK for Android V2.1.3.
4+
* Android:
5+
* Fixed crash issue when opening certain documents.
6+
* Fixed crash issue when adding mark annotations to some documents.
7+
* Fixed potential crash during SDK initialization.
8+
* Fixed incomplete display of underline annotations.
9+
* Fixed abnormal annotation display after rotating the page.
10+
* Fixed crash when releasing watermarks.
11+
* Fixed memory leak in the property window of the ComPDFKit_Tools module.
12+
* iOS:
13+
* iOS annotation toolbar image button adaptation for iPad.
14+
* RN iOS sandbox structure modification.
15+
116
## 2.1.2
217

318
* Added the features support for ComPDFKit PDF SDK for iOS V2.1.2.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Alternatively you can update the `AndroidManifest.xml` file to use `FlutterFragm
151151
dependencies:
152152
flutter:
153153
sdk: flutter
154-
+ compdfkit_flutter: ^2.1.2
154+
+ compdfkit_flutter: ^2.1.3
155155
```
156156

157157
8. Add the PDF documents you want to display in the project
@@ -197,7 +197,7 @@ cd example
197197
dependencies:
198198
flutter:
199199
sdk: flutter
200-
+ compdfkit_flutter: ^2.1.2
200+
+ compdfkit_flutter: ^2.1.3
201201
```
202202

203203
4. Open your project's Podfile in a text editor:
@@ -220,8 +220,8 @@ open ios/Podfile
220220
use_modular_headers!`
221221

222222
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
223-
+ pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.2.podspec'
224-
+ pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.2.podspec'
223+
+ pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.3.podspec'
224+
+ pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.3.podspec'
225225

226226
end
227227
```
@@ -557,8 +557,8 @@ target 'PDFView_RN' do
557557
# Pods for testing
558558
end
559559

560-
+ pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.2'
561-
+ pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.2'
560+
+ pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.3'
561+
+ pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.3'
562562

563563
# Enables Flipper.
564564
#

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ android {
4040
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
4141

4242
// dependencies compdfkit pdf sdk
43-
api 'com.compdf:compdfkit-tools:2.1.2'
43+
api 'com.compdf:compdfkit-tools:2.1.3'
4444

4545
testImplementation 'junit:junit:4.13.2'
4646
testImplementation 'org.mockito:mockito-core:5.0.0'

example/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Please install the following required packages:
2020

2121
Operating Environment Requirements:
2222

23-
* A minSdkVersion of `19` or higher.
24-
* A `compileSdkVersion` of `30` or higher.
25-
* A `targetSdkVersion` of `30` or higher.
23+
* A minSdkVersion of `21` or higher.
24+
* A `compileSdkVersion` of `33` or higher.
25+
* A `targetSdkVersion` of `33` or higher.
2626
* Android ABI(s): x86, x86_64, armeabi-v7a, arm64-v8a.
2727

2828

example/ios/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ target 'Runner' do
3131
use_frameworks!
3232
use_modular_headers!
3333

34-
pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.2.podspec'
35-
pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.2.podspec'
34+
pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.3.podspec'
35+
pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.3.podspec'
3636
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3737
target 'RunnerTests' do
3838
inherit! :search_paths

example/lib/main.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ class _HomePageState extends State<HomePage> {
4949
}
5050

5151
void _init() async {
52-
// online license auth
53-
// Please replace it with your ComPDFKit license
54-
// ComPDFKit.initialize(androidOnlineLicense: 'IVTAsbJCW0X45qIy5cTEuzxZzKpYIpJe6WPY7uCPIiI=',iosOnlineLicense: 'lkw3Gr0HuD5pV1/+DVRSxp7qBlvK+Izo3mOKyAEHXz4=');
55-
5652
// offline license auth
5753
if(Platform.isAndroid){
5854
ComPDFKit.init('m1bIAk/3mPQu+j6vJAMeauodNbxWBKE5DsdcvD+/dixxtZP2sLsLi4V9Cqj7mLP1hPTTYkfKrKTjpMqf06+f1ySt18aLuYh9IbHZpbhldGb4Vi8NG8rB/N/B6Dl4kqL80a7wlswqzKj/5OuTcbnVgOgC892udbsjcuh1/RVdujWYZn+eEgOyiWCyyOB1I7h0KkvqU+Uhjs1hI4UUOl5Zf43EZKcj7WkbI91UCGL4FpBs5QX1Gxt+9agdNGWTedmShLYyLw/50nOkO7VdvFScVoArkE7w02WT1dtzbrAePMNEzKFco58L5kCTkJKXdlLft12zv5kUhw2TZkrDuIiJWmu0lH1oY17eVN2TRW5amzrVRSqpTOyx2LGvW1Ilra90nzlp2dEBHH+rU3Jo93jy94eWecFWMwgKBD5sABvhJFteiZTpP6NufkmmJm5UhS1bbWwQ3416ecpKs8D9TAlLLO+rbIocuxdoPE2dxWFYLq6zF8kJV3z7dKYtAwQKdoQiS08ryGXVZybCx2GjZp97I7zNemiorRWKQUrxpNk0vCLwL1yz7NzjlB6YQ8UxvmTkX/GU7T7Ubg9LoyZuVo4tLHLplMSlHIcA4guqZL7JbQ6/jomhcJGFpGo+X7tbrCvMTnbvjZoxJRlcNN1+9x100WEfF4A2XbJZEjcpxV9tk1rTt+jS8dkX803ij16yHI1THSycP2aKkWjgDAsAUt98KCUHLaZi4F73ifo4l7JQoj0MxqN2wuiDb2PRCz4539YtkdVIZEXZTwWHfrGGmBtk3dx1799HZhql3JBz0M8qWu0orf8D8MSMhoXp8+4gqXbcjQenhtwoj/Djoo004nn6imYxyhOvWz1Gr+RnmewvsMekW5tRLYGyh4Wzm8iz7FfbeUBBSnACmDjQJakv7XZbEC+8aL7krtxm/FHFSIEQ16OXVquY+uWr1r5qGwfIX5PeVDJnm/N/Wr1SQL0aw1U39cth85eJcdDrrSE+Qsa+ZM5dJ3Wz5uqSZb/edA4VQTm9v11EslX6/qIaDIY9MV63ZN5xLwpFEG1t+aAFBUxaz4xBYu66dXNz1mZ12KGm03c/VbZB9RRCWzag8ple8Qp54b33fhHNpH59zJUfLY80vUJhiyZlMVDKJ5nvFgOcnq+c+5t6xDPfO1JnRjw3rWXr5Q==');

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ packages:
5555
path: ".."
5656
relative: true
5757
source: path
58-
version: "2.1.2"
58+
version: "2.1.3"
5959
cross_file:
6060
dependency: transitive
6161
description:

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: compdfkit_flutter_example
22
description: Demonstrates how to use the compdfkit_flutter plugin.
3-
version: 2.1.2
3+
version: 2.1.3
44
homepage: https://www.compdf.com
55
repository: https://github.com/ComPDFKit/compdfkit-pdf-sdk-flutter
66
issue_tracker: https://www.compdf.com/support

ios/Classes/CompdfkitFlutterPlugin.swift

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class CompdfkitFlutterPlugin: NSObject, FlutterPlugin, CPDFViewBaseContro
1212
let factory = CPDFViewCtrlFactory(messenger: registrar.messenger())
1313
registrar.register(factory, withId: "com.compdfkit.flutter.ui.pdfviewer")
1414
}
15-
15+
1616
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
1717
switch call.method {
1818
case "sdk_version_code":
@@ -35,17 +35,29 @@ public class CompdfkitFlutterPlugin: NSObject, FlutterPlugin, CPDFViewBaseContro
3535
let jsonString = initInfo?["configuration"] ?? ""
3636
_ = initInfo?["password"] ?? ""
3737
let path = initInfo?["document"] as? String ?? ""
38+
let document = NSURL(fileURLWithPath: path)
39+
40+
let fileManager = FileManager.default
41+
let samplesFilePath = NSHomeDirectory().appending("/Documents/Files")
42+
let fileName = document.lastPathComponent ?? ""
43+
let docsFilePath = samplesFilePath + "/" + fileName
44+
45+
if !fileManager.fileExists(atPath: samplesFilePath) {
46+
try? FileManager.default.createDirectory(atPath: samplesFilePath, withIntermediateDirectories: true, attributes: nil)
47+
}
48+
49+
try? FileManager.default.copyItem(atPath: document.path ?? "", toPath: docsFilePath)
3850

3951
let jsonDataParse = CPDFJSONDataParse(String: jsonString as! String)
4052
guard let configuration = jsonDataParse.configuration else { return }
4153
if let rootViewControl = UIApplication.shared.keyWindow?.rootViewController {
4254
var tRootViewControl = rootViewControl
43-
55+
4456
if let presentedViewController = rootViewControl.presentedViewController {
4557
tRootViewControl = presentedViewController
4658
}
47-
48-
let pdfViewController = CPDFViewController(filePath: path, password: nil, configuration: configuration)
59+
60+
let pdfViewController = CPDFViewController(filePath: docsFilePath, password: nil, configuration: configuration)
4961
let navController = CNavigationController(rootViewController: pdfViewController)
5062
pdfViewController.delegate = self
5163
navController.modalPresentationStyle = .fullScreen

ios/Classes/reader/CPDFViewCtrlFactory.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,24 @@ class CPDFViewCtrlFlutter: NSObject, FlutterPlatformView, CPDFViewBaseController
5858
let password = initInfo?["password"] ?? ""
5959
let path = initInfo?["document"] as? String ?? ""
6060

61+
let document = NSURL(fileURLWithPath: path)
62+
63+
let fileManager = FileManager.default
64+
let samplesFilePath = NSHomeDirectory().appending("/Documents/Files")
65+
let fileName = document.lastPathComponent ?? ""
66+
let docsFilePath = samplesFilePath + "/" + fileName
67+
68+
if !fileManager.fileExists(atPath: samplesFilePath) {
69+
try? FileManager.default.createDirectory(atPath: samplesFilePath, withIntermediateDirectories: true, attributes: nil)
70+
}
71+
72+
try? FileManager.default.copyItem(atPath: document.path ?? "", toPath: docsFilePath)
73+
6174
let jsonDataParse = CPDFJSONDataParse(String: jsonString as! String)
6275
let configuration = jsonDataParse.configuration
63-
76+
6477
// Create the pdfview controller view
65-
pdfViewController = CPDFViewController(filePath: path, password: password as? String, configuration: configuration!)
78+
pdfViewController = CPDFViewController(filePath: docsFilePath, password: password as? String, configuration: configuration!)
6679

6780
navigationController = CNavigationController(rootViewController: pdfViewController)
6881
navigationController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: compdfkit_flutter
22
description: ComPDFKit for Flutter is a comprehensive SDK that allows you to quickly add PDF functionality to Android and iOS Flutter applications.
3-
version: 2.1.2
3+
version: 2.1.3
44
homepage: https://www.compdf.com
55
repository: https://github.com/ComPDFKit/compdfkit-pdf-sdk-flutter
66
issue_tracker: https://www.compdf.com/support

0 commit comments

Comments
 (0)