Skip to content

Commit 68441e0

Browse files
committed
compdfkit_flutter 2.0.0
1 parent 1bbf51c commit 68441e0

File tree

18 files changed

+193
-112
lines changed

18 files changed

+193
-112
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.0
2+
* Added the features support for ComPDFKit PDF SDK for iOS V2.0.0.
3+
* Added the features support for ComPDFKit PDF SDK for Android V2.0.0.
4+
15
## 1.13.0
26

37
* Added the features support for ComPDFKit PDF SDK for iOS V1.13.0.

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ cd example
8989
<!-- Required to read and write documents from device storage -->
9090
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
9191
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
92+
93+
<!-- Optional settings -->
9294
+ <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
9395

9496

95-
9697
<application
9798
+ android:requestLegacyExternalStorage="true">
9899

@@ -124,7 +125,7 @@ open android/app/build.gradle
124125
dependencies:
125126
flutter:
126127
sdk: flutter
127-
+ compdfkit_flutter: ^1.13.0
128+
+ compdfkit_flutter: ^2.0.0
128129
```
129130

130131
7. From the terminal app, run the following command to get all the packages:
@@ -143,7 +144,7 @@ import 'package:compdfkit_flutter/cpdf_configuration.dart';
143144
144145
import 'package:flutter/material.dart';
145146
146-
const String DOCUMENT_PATH = 'pdfs/PDF_Document.pdf';
147+
const String _documentPath = 'pdfs/PDF_Document.pdf';
147148
148149
void main() {
149150
runApp(const MyApp());
@@ -190,13 +191,13 @@ class _MyAppState extends State<MyApp> {
190191
}
191192
192193
void showDocument(BuildContext context) async {
193-
final bytes = await DefaultAssetBundle.of(context).load(DOCUMENT_PATH);
194+
final bytes = await DefaultAssetBundle.of(context).load(_documentPath);
194195
final list = bytes.buffer.asUint8List();
195196
final tempDir = await ComPDFKit.getTemporaryDirectory();
196197
var pdfsDir = Directory('${tempDir.path}/pdfs');
197198
pdfsDir.createSync(recursive: true);
198199
199-
final tempDocumentPath = '${tempDir.path}/$DOCUMENT_PATH';
200+
final tempDocumentPath = '${tempDir.path}/$_documentPath';
200201
final file = File(tempDocumentPath);
201202
if (!file.existsSync()) {
202203
file.create(recursive: true);
@@ -280,7 +281,7 @@ cd example
280281
dependencies:
281282
flutter:
282283
sdk: flutter
283-
+ compdfkit_flutter: ^1.13.0
284+
+ compdfkit_flutter: ^2.0.0
284285
```
285286

286287
4. From the terminal app, run the following command to get all the packages:
@@ -309,8 +310,8 @@ open ios/Podfile
309310
use_modular_headers!`
310311

311312
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
312-
+ pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/1.13.0.podspec'
313-
+ pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/1.13.0.podspec'
313+
+ pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.0.0.podspec'
314+
+ pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.0.0.podspec'
314315

315316
end
316317
```
@@ -331,7 +332,7 @@ import 'package:compdfkit_flutter/cpdf_configuration.dart';
331332
332333
import 'package:flutter/material.dart';
333334
334-
const String DOCUMENT_PATH = 'pdfs/PDF_Document.pdf';
335+
const String _documentPath = 'pdfs/PDF_Document.pdf';
335336
336337
void main() {
337338
runApp(const MyApp());
@@ -378,13 +379,13 @@ class _MyAppState extends State<MyApp> {
378379
}
379380
380381
void showDocument(BuildContext context) async {
381-
final bytes = await DefaultAssetBundle.of(context).load(DOCUMENT_PATH);
382+
final bytes = await DefaultAssetBundle.of(context).load(_documentPath);
382383
final list = bytes.buffer.asUint8List();
383384
final tempDir = await ComPDFKit.getTemporaryDirectory();
384385
var pdfsDir = Directory('${tempDir.path}/pdfs');
385386
pdfsDir.createSync(recursive: true);
386387
387-
final tempDocumentPath = '${tempDir.path}/$DOCUMENT_PATH';
388+
final tempDocumentPath = '${tempDir.path}/$_documentPath';
388389
final file = File(tempDocumentPath);
389390
if (!file.existsSync()) {
390391
file.create(recursive: true);
@@ -474,8 +475,6 @@ flutter emulators --launch apple_ios_simulator
474475
flutter run
475476
```
476477

477-
478-
479478
#### Apply the License Key
480479

481480
ComPDFKit PDF SDK is a commercial SDK, which requires a license to grant developer permission to release their apps. Each license is only valid for one `bundle ID` or `applicationId` in development mode. Other flexible licensing options are also supported, please contact [our marketing team](mailto:[email protected]) to know more.
@@ -494,8 +493,6 @@ ComPDFKit.initialize(androidOnlineLicense : 'your compdfkit key', iosOnlineLicen
494493
ComPDFKit.init('your compdfkit key');
495494
```
496495

497-
498-
499496
#### Troubleshooting
500497

501498
1.SSL network request to download 'ComPDFKit' library failed when cocopods downloaded iOS third-party library
@@ -530,8 +527,8 @@ target 'PDFView_RN' do
530527
# Pods for testing
531528
end
532529

533-
+ pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '1.13.0'
534-
+ pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '1.13.0'
530+
+ pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.0.0'
531+
+ pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.0.0'
535532

536533
# Enables Flipper.
537534
#
@@ -546,8 +543,6 @@ target 'PDFView_RN' do
546543
end
547544
````
548545

549-
550-
551546
## UI Customization
552547

553548
In version **1.12.0**, we have expanded the options that can be defined in the [CPDFConfiguration](./lib/cpdf_configuration.dart) class. When using the `ComPDFKit.openDocument` method to open a PDF View, you can define this object to meet your product requirements. We will continue to enrich configuration options in the future to further enhance the flexibility of the product. Here are some examples of commonly used configuration options:

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ android {
4141
implementation 'com.google.android.material:material:1.8.0'
4242
implementation 'androidx.appcompat:appcompat:1.6.1'
4343
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
44-
api 'com.compdf:compdfkit:1.13.0'
45-
api 'com.compdf:compdfkit-ui:1.13.0'
46-
api ('com.compdf:compdfkit-tools:1.13.0')
44+
api 'com.compdf:compdfkit:2.0.0'
45+
api 'com.compdf:compdfkit-ui:2.0.0'
46+
api ('com.compdf:compdfkit-tools:2.0.0')
4747

4848
testImplementation 'junit:junit:4.13.2'
4949
testImplementation 'org.mockito:mockito-core:5.0.0'
@@ -63,5 +63,5 @@ android {
6363
}
6464
}
6565
// refresh snapshot implementation
66-
//configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' }
66+
configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' }
6767

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ android {
5555
applicationId "com.compdfkit.flutter.example"
5656
minSdkVersion 21
5757
targetSdkVersion 33
58-
versionCode 4
58+
versionCode 5
5959
versionName flutterVersionName
6060
}
6161

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1717
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1818
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
19+
C9A635542BC67581009F53FC /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C9A635522BC67581009F53FC /* Localizable.strings */; };
1920
/* End PBXBuildFile section */
2021

2122
/* Begin PBXContainerItemProxy section */
@@ -65,6 +66,10 @@
6566
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6667
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6768
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
69+
C9A635502BC67553009F53FC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
70+
C9A635512BC67553009F53FC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
71+
C9A635532BC67581009F53FC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
72+
C9A635552BC67595009F53FC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
6873
/* End PBXFileReference section */
6974

7075
/* Begin PBXFrameworksBuildPhase section */
@@ -147,6 +152,7 @@
147152
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
148153
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
149154
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
155+
C9A635522BC67581009F53FC /* Localizable.strings */,
150156
);
151157
path = Runner;
152158
sourceTree = "<group>";
@@ -215,7 +221,7 @@
215221
97C146E61CF9000F007C117D /* Project object */ = {
216222
isa = PBXProject;
217223
attributes = {
218-
LastUpgradeCheck = 1430;
224+
LastUpgradeCheck = 1510;
219225
ORGANIZATIONNAME = "";
220226
TargetAttributes = {
221227
331C8080294A63A400263BE5 = {
@@ -235,6 +241,7 @@
235241
knownRegions = (
236242
en,
237243
Base,
244+
"zh-Hans",
238245
);
239246
mainGroup = 97C146E51CF9000F007C117D;
240247
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
@@ -259,6 +266,7 @@
259266
isa = PBXResourcesBuildPhase;
260267
buildActionMask = 2147483647;
261268
files = (
269+
C9A635542BC67581009F53FC /* Localizable.strings in Resources */,
262270
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
263271
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
264272
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
@@ -396,6 +404,7 @@
396404
isa = PBXVariantGroup;
397405
children = (
398406
97C146FB1CF9000F007C117D /* Base */,
407+
C9A635502BC67553009F53FC /* zh-Hans */,
399408
);
400409
name = Main.storyboard;
401410
sourceTree = "<group>";
@@ -404,17 +413,28 @@
404413
isa = PBXVariantGroup;
405414
children = (
406415
97C147001CF9000F007C117D /* Base */,
416+
C9A635512BC67553009F53FC /* zh-Hans */,
407417
);
408418
name = LaunchScreen.storyboard;
409419
sourceTree = "<group>";
410420
};
421+
C9A635522BC67581009F53FC /* Localizable.strings */ = {
422+
isa = PBXVariantGroup;
423+
children = (
424+
C9A635532BC67581009F53FC /* en */,
425+
C9A635552BC67595009F53FC /* zh-Hans */,
426+
);
427+
name = Localizable.strings;
428+
sourceTree = "<group>";
429+
};
411430
/* End PBXVariantGroup section */
412431

413432
/* Begin XCBuildConfiguration section */
414433
249021D3217E4FDB00AE95B9 /* Profile */ = {
415434
isa = XCBuildConfiguration;
416435
buildSettings = {
417436
ALWAYS_SEARCH_USER_PATHS = NO;
437+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
418438
CLANG_ANALYZER_NONNULL = YES;
419439
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
420440
CLANG_CXX_LIBRARY = "libc++";
@@ -467,18 +487,21 @@
467487
buildSettings = {
468488
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
469489
CLANG_ENABLE_MODULES = YES;
490+
CODE_SIGN_IDENTITY = "Apple Development";
491+
CODE_SIGN_STYLE = Automatic;
470492
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
471493
DEVELOPMENT_TEAM = 4GGQPGRTSV;
472494
ENABLE_BITCODE = NO;
473-
FLUTTER_BUILD_NAME = 1.13.0;
474-
FLUTTER_BUILD_NUMBER = 1.13.0;
495+
FLUTTER_BUILD_NAME = 2.0.0;
496+
FLUTTER_BUILD_NUMBER = 2.0.0;
475497
INFOPLIST_FILE = Runner/Info.plist;
476498
LD_RUNPATH_SEARCH_PATHS = (
477499
"$(inherited)",
478500
"@executable_path/Frameworks",
479501
);
480502
PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.example;
481503
PRODUCT_NAME = "$(TARGET_NAME)";
504+
PROVISIONING_PROFILE_SPECIFIER = "";
482505
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
483506
SWIFT_VERSION = 5.0;
484507
VERSIONING_SYSTEM = "apple-generic";
@@ -492,6 +515,7 @@
492515
BUNDLE_LOADER = "$(TEST_HOST)";
493516
CODE_SIGN_STYLE = Automatic;
494517
CURRENT_PROJECT_VERSION = 1;
518+
DEVELOPMENT_TEAM = 4GGQPGRTSV;
495519
GENERATE_INFOPLIST_FILE = YES;
496520
MARKETING_VERSION = 1.0;
497521
PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.compdfkitFlutterExample.RunnerTests;
@@ -510,6 +534,7 @@
510534
BUNDLE_LOADER = "$(TEST_HOST)";
511535
CODE_SIGN_STYLE = Automatic;
512536
CURRENT_PROJECT_VERSION = 1;
537+
DEVELOPMENT_TEAM = 4GGQPGRTSV;
513538
GENERATE_INFOPLIST_FILE = YES;
514539
MARKETING_VERSION = 1.0;
515540
PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.compdfkitFlutterExample.RunnerTests;
@@ -526,6 +551,7 @@
526551
BUNDLE_LOADER = "$(TEST_HOST)";
527552
CODE_SIGN_STYLE = Automatic;
528553
CURRENT_PROJECT_VERSION = 1;
554+
DEVELOPMENT_TEAM = 4GGQPGRTSV;
529555
GENERATE_INFOPLIST_FILE = YES;
530556
MARKETING_VERSION = 1.0;
531557
PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.compdfkitFlutterExample.RunnerTests;
@@ -539,6 +565,7 @@
539565
isa = XCBuildConfiguration;
540566
buildSettings = {
541567
ALWAYS_SEARCH_USER_PATHS = NO;
568+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
542569
CLANG_ANALYZER_NONNULL = YES;
543570
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
544571
CLANG_CXX_LIBRARY = "libc++";
@@ -594,6 +621,7 @@
594621
isa = XCBuildConfiguration;
595622
buildSettings = {
596623
ALWAYS_SEARCH_USER_PATHS = NO;
624+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
597625
CLANG_ANALYZER_NONNULL = YES;
598626
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
599627
CLANG_CXX_LIBRARY = "libc++";
@@ -648,18 +676,21 @@
648676
buildSettings = {
649677
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
650678
CLANG_ENABLE_MODULES = YES;
679+
CODE_SIGN_IDENTITY = "Apple Development";
680+
CODE_SIGN_STYLE = Automatic;
651681
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
652682
DEVELOPMENT_TEAM = 4GGQPGRTSV;
653683
ENABLE_BITCODE = NO;
654-
FLUTTER_BUILD_NAME = 1.13.0;
655-
FLUTTER_BUILD_NUMBER = 1.13.0;
684+
FLUTTER_BUILD_NAME = 2.0.0;
685+
FLUTTER_BUILD_NUMBER = 2.0.0;
656686
INFOPLIST_FILE = Runner/Info.plist;
657687
LD_RUNPATH_SEARCH_PATHS = (
658688
"$(inherited)",
659689
"@executable_path/Frameworks",
660690
);
661691
PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.example;
662692
PRODUCT_NAME = "$(TARGET_NAME)";
693+
PROVISIONING_PROFILE_SPECIFIER = "";
663694
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
664695
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
665696
SWIFT_VERSION = 5.0;
@@ -673,18 +704,21 @@
673704
buildSettings = {
674705
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
675706
CLANG_ENABLE_MODULES = YES;
707+
CODE_SIGN_IDENTITY = "Apple Development";
708+
CODE_SIGN_STYLE = Automatic;
676709
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
677710
DEVELOPMENT_TEAM = 4GGQPGRTSV;
678711
ENABLE_BITCODE = NO;
679-
FLUTTER_BUILD_NAME = 1.13.0;
680-
FLUTTER_BUILD_NUMBER = 1.13.0;
712+
FLUTTER_BUILD_NAME = 2.0.0;
713+
FLUTTER_BUILD_NUMBER = 2.0.0;
681714
INFOPLIST_FILE = Runner/Info.plist;
682715
LD_RUNPATH_SEARCH_PATHS = (
683716
"$(inherited)",
684717
"@executable_path/Frameworks",
685718
);
686719
PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.flutter.example;
687720
PRODUCT_NAME = "$(TARGET_NAME)";
721+
PROVISIONING_PROFILE_SPECIFIER = "";
688722
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
689723
SWIFT_VERSION = 5.0;
690724
VERSIONING_SYSTEM = "apple-generic";

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)