Creating a New Project 
Android 
- Create a Flutter project called examplewith theflutterCLI:
bash
flutter create --org com.compdfkit.flutter example- In the terminal app, change the location of the current working directory to your project:
bash
cd example- open example/android/app/src/main/AndroidManifest.xml, addInternet PermissionandStorage Permission:
diff
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.compdfkit.flutter.example">
  
+    <uses-permission android:name="android.permission.INTERNET"/>
    <!-- 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">
    
    </application>   
</manifest>- Open the app's Gradle build file, android/app/build.gradle:
bash
open android/app/build.gradle- Modify the minimum SDK version, All this is done inside the androidsection:
diff
 android {
     defaultConfig {
-        minSdkVersion flutter.minSdkVersion
+        minSdkVersion 21
         ...
     }
 }- Open the project’s main activity class, android/app/src/main/java/com/example/compdfkit/flutter/example/MainActivity.java, Change the baseActivityto extendFlutterFragmentActivity:
diff
- import io.flutter.embedding.android.FlutterActivity;
+ import io.flutter.embedding.android.FlutterFragmentActivity;
- public class MainActivity extends FlutterActivity {
+ public class MainActivity extends FlutterFragmentActivity {
}Alternatively you can update the AndroidManifest.xml file to use FlutterFragmentActivity as the launcher activity:
diff
<activity
-     android:name=".MainActivity" 
+     android:name="io.flutter.embedding.android.FlutterFragmentActivity"
      android:exported="true"
      android:hardwareAccelerated="true"
      android:launchMode="singleTop"
      android:theme="@style/LaunchTheme"
      android:windowSoftInputMode="adjustPan">Note:
FlutterFragmentActivityis not an official part of the Flutter SDK. If you need to useCPDFReaderWidgetin ComPDFKit for Flutter, you need to use this part of the code. You can skip this step if you don't need to use.
- Add the ComPDFKit dependency in pubspec.yaml
diff
 dependencies:
   flutter:
     sdk: flutter
+  compdfkit_flutter: ^2.5.0- From the terminal app, run the following command to get all the packages:
bash
flutter pub getiOS 
- Create a Flutter project called examplewith theflutterCLI:
bash
flutter create --org com.compdfkit.flutter example- In the terminal app, change the location of the current working directory to your project:
bash
cd example- Add the ComPDFKit dependency in pubspec.yaml
diff
 dependencies:
   flutter:
     sdk: flutter
+  compdfkit_flutter: ^2.5.0- From the terminal app, run the following command to get all the packages:
bash
flutter pub get- Open your project's Podfile in a text editor:
bash
open ios/Podfile- Update the platform to iOS 12 and add the ComPDFKit Podspec:
diff
- platform :ios, '9.0'
+ platform :ios, '12.0' 
 ...
 target 'Runner' do
   use_frameworks!
   use_modular_headers!`
   flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+  pod "ComPDFKit", podspec:'https://file.compdf.com/cocoapods/ios/compdfkit_pdf_sdk/2.5.0/ComPDFKit.podspec'
+  pod "ComPDFKit_Tools", podspec:'https://file.compdf.com/cocoapods/ios/compdfkit_pdf_sdk/2.5.0/ComPDFKit_Tools.podspec'
 end- Go to the example/iosfolder and run thepod installcommand:
bash
pod installNote: If SSL network requests fail to download the ComPDFKit library when you run pod install, you can see the processing method in Troubleshooting.
- To protect user privacy,
To protect user privacy, before accessing the sensitive privacy data, you need to find the "*Info*" configuration in your iOS 10.0 or higher iOS project and configure the relevant privacy terms as shown in the following picture.

objective-c
<key>NSCameraUsageDescription</key>
<string>Your consent is required before you could access the function.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your consent is required before you could access the function.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Your consent is required before you could access the function.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Your consent is required before you could access the function.</string>
 
<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
	</dict>