浏览代码

【代码优化】 1.重构工程代码结构,修改为插件化(仅Android部分)

liuxiaolong 1 年之前
父节点
当前提交
ab7ccc1283
共有 100 个文件被更改,包括 1053 次插入1081 次删除
  1. 3 19
      .gitignore
  2. 8 20
      .metadata
  3. 3 0
      CHANGELOG.md
  4. 1 0
      LICENSE
  5. 10 479
      README.md
  6. 0 25
      analysis_options.yaml
  7. 8 12
      android/.gitignore
  8. 0 65
      android/app/src/main/AndroidManifest.xml
  9. 0 51
      android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/ConversionSDKFlutterPlugin.kt
  10. 0 111
      android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/ConvertFlutterPlugin.kt
  11. 0 27
      android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/MainActivity.kt
  12. 36 8
      android/build.gradle
  13. 0 0
      android/libs/ComPDFKitConversion.aar
  14. 1 11
      android/settings.gradle
  15. 3 0
      android/src/main/AndroidManifest.xml
  16. 52 0
      android/src/main/kotlin/com/compdfkit/conversion/flutter/plugin/ConversionSDKFlutterPlugin.kt
  17. 158 0
      android/src/main/kotlin/com/compdfkit/conversion/flutter/plugin/ConvertFlutterPlugin.kt
  18. 0 0
      android/src/main/kotlin/com/compdfkit/conversion/flutter/plugin/ConvertType.kt
  19. 23 18
      android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/utils/ConvertUtils.kt
  20. 1 1
      android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/utils/FileUtils.kt
  21. 二进制
      doc/ios_add_framework.png
  22. 二进制
      doc/ios_confirm_dialog.png
  23. 二进制
      doc/ios_embed.png
  24. 44 0
      example/.gitignore
  25. 16 0
      example/README.md
  26. 29 0
      example/analysis_options.yaml
  27. 13 0
      example/android/.gitignore
  28. 0 11
      android/app/build.gradle
  29. 1 1
      android/app/src/profile/AndroidManifest.xml
  30. 53 0
      example/android/app/src/main/AndroidManifest.xml
  31. 6 0
      example/android/app/src/main/kotlin/com/compdfkit/conversion/flutter/example/MainActivity.kt
  32. 0 0
      example/android/app/src/main/res/drawable-v21/launch_background.xml
  33. 0 0
      example/android/app/src/main/res/drawable/launch_background.xml
  34. 0 0
      example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  35. 0 0
      example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  36. 0 0
      example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  37. 0 0
      example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  38. 0 0
      example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  39. 0 0
      example/android/app/src/main/res/values-night/styles.xml
  40. 0 0
      example/android/app/src/main/res/values/styles.xml
  41. 0 0
      example/android/app/src/main/res/xml/provider_paths.xml
  42. 1 1
      android/app/src/debug/AndroidManifest.xml
  43. 31 0
      example/android/build.gradle
  44. 0 0
      example/android/gradle.properties
  45. 0 0
      example/android/gradle/wrapper/gradle-wrapper.properties
  46. 11 0
      example/android/settings.gradle
  47. 34 0
      example/ios/.gitignore
  48. 0 0
      example/ios/Flutter/AppFrameworkInfo.plist
  49. 0 0
      example/ios/Flutter/Debug.xcconfig
  50. 0 0
      example/ios/Flutter/Release.xcconfig
  51. 41 0
      example/ios/Podfile
  52. 50 103
      ios/Runner.xcodeproj/project.pbxproj
  53. 0 0
      example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  54. 0 0
      example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  55. 0 0
      example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  56. 0 0
      example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  57. 0 0
      example/ios/Runner.xcworkspace/contents.xcworkspacedata
  58. 0 0
      example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  59. 0 0
      example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  60. 13 0
      example/ios/Runner/AppDelegate.swift
  61. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
  62. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
  63. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
  64. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
  65. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
  66. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
  67. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
  68. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
  69. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
  70. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
  71. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
  72. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
  73. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
  74. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
  75. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
  76. 0 0
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
  77. 0 0
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
  78. 0 0
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
  79. 0 0
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
  80. 0 0
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
  81. 0 0
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
  82. 0 0
      example/ios/Runner/Base.lproj/LaunchScreen.storyboard
  83. 3 3
      ios/Runner/Base.lproj/Main.storyboard
  84. 11 11
      ios/Runner/Info.plist
  85. 1 0
      example/ios/Runner/Runner-Bridging-Header.h
  86. 9 8
      lib/main.dart
  87. 45 0
      example/lib/models/convert_task.dart
  88. 34 30
      lib/states/convert_options_provider.dart
  89. 113 0
      example/lib/states/convert_provider.dart
  90. 13 5
      lib/widgets/conversion_sdk_info_widget.dart
  91. 105 0
      example/lib/widgets/convert_list_widget.dart
  92. 26 24
      lib/widgets/convert_config.dart
  93. 3 2
      lib/widgets/options/convert_csv_options_widget.dart
  94. 16 15
      lib/widgets/options/convert_excel_options_widget.dart
  95. 9 8
      lib/widgets/options/convert_html_options_widget.dart
  96. 6 6
      lib/widgets/options/convert_image_options_widget.dart
  97. 3 2
      lib/widgets/options/convert_ppt_options_widget.dart
  98. 3 2
      lib/widgets/options/convert_rtf_options_widget.dart
  99. 3 2
      lib/widgets/options/convert_word_options_widget.dart
  100. 0 0
      example/pubspec.lock

+ 3 - 19
.gitignore

@@ -22,25 +22,9 @@ migrate_working_dir/
 #.vscode/
 
 # Flutter/Dart/Pub related
+# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
+/pubspec.lock
 **/doc/api/
-**/ios/Flutter/.last_build_id
 .dart_tool/
-.flutter-plugins
-.flutter-plugins-dependencies
 .packages
-.pub-cache/
-.pub/
-/build/
-
-# Symbolication related
-app.*.symbols
-
-# Obfuscation related
-app.*.map.json
-
-# Android Studio will place build artifacts here
-/android/app/debug
-/android/app/profile
-/android/app/release
-/ios/Podfile
-/ios/Podfile.lock
+build/

+ 8 - 20
.metadata

@@ -4,35 +4,23 @@
 # This file should be version controlled.
 
 version:
-  revision: 7048ed95a5ad3e43d697e0c397464193991fc230
+  revision: 62bd79521d8d007524e351747471ba66696fc2d4
   channel: stable
 
-project_type: app
+project_type: plugin
 
 # Tracks metadata for the flutter migrate command
 migration:
   platforms:
     - platform: root
-      create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-      base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
+      create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
+      base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
     - platform: android
-      create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-      base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
+      create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
+      base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
     - platform: ios
-      create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-      base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-    - platform: linux
-      create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-      base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-    - platform: macos
-      create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-      base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-    - platform: web
-      create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-      base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-    - platform: windows
-      create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
-      base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
+      create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
+      base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
 
   # User provided section
 

+ 3 - 0
CHANGELOG.md

@@ -0,0 +1,3 @@
+## 0.0.1
+
+* TODO: Describe initial release.

+ 1 - 0
LICENSE

@@ -0,0 +1 @@
+TODO: Add your license here.

+ 10 - 479
README.md

@@ -1,484 +1,15 @@
-# ComPDFKitConversion SDK Flutter Platform Usage Guide
-ComPDFKitConversion SDK is a powerful file conversion tool that can convert files between various formats on Android,iOS,Mac,Windows,Linux and Web platforms. This article will teach you how to use it on Flutter platform to make your application more flexible and efficient.
+# kmpdfkit_conversion_flutter
 
-## Supported Conversion Formats
-Conversion SDK supports converting PDF files to the following formats
-- Convert PDF documents to Word documents.
-    - Reconstruct content from PDF files into reusable data.
-    - Reconstruction (recover page layout, columns, formatting, graphics, and preserve text flow).
-    - Support mapping conversion to split-column function.
-    - Support the function of combining letters into a string of text.
-    - Support floating insertion such as picture rotation cutting.
-    - Support converting partial Math or Chemistry function.
-    - Support font size, color, bold, italic, and underline recognition.
-- Convert PDF documents to Excel documents.
-    - Support data mapping to Excel cells.
-    - Support recognition of a small number, currency, and other formats.
-    - Support multiple cells merge function.
-    - Support different types of content, including text, table, or all content in PDF.
-    - Support multiple Worksheet options, including converting one table to one sheet, all tables on one page to one sheet, or all tables in the entire document to one sheet.
-- Convert PDF documents to PPT documents.
-    - Convert each page to an editable slide.
-    - Support converting text to a PowerPoint text box.
-    - Support picture rotation cutting and other floating insertion.
-    - Support converting partial Math or Chemistry function.
-- Convert PDF documents to TXT documents.
-- Convert PDF documents to CSV documents.
-    - Support extracting only tables from PDF accurately and converting them to CSV, and one table is
-      converted to one CSV file.
-- Convert PDF documents to Image documents.
-    - Support converting PDF to high-quality image formats, including PNG and JPEG. All image quality
-      and resolution will remain intact.
-- Convert PDF documents to RTF documents.
-    - Support converting PDF to Rich Text Format documents, including text and images.
-- Convert PDF documents to HTML documents.
-    - Support converting PDF to HTML, including single-page and multiple-page.
+A new Flutter plugin project.
 
-## OS Support
-### Android
-ComPDFKit Conversion SDK is supported on Android devices running API level 21 or newer and targeting the latest stable Android version 5.0 (API 30) or higher. Furthermore, ComPDFKit Conversion SDK requires apps to enable Java 11 language features to build.
-> - Android Studio Arctic Fox or newer (support AndroidX).
-> - Project specifications.
->   - A minSdkVersion of 21 (KitKat) or higher.
->   - A compileSdkVersion of 30 or higher.
->   - A targetSdkVersion of 30 or higher.
->   - Android ABI(s): x86, x86_64, armeabi-v7a, arm64-v8a.
+## Getting Started
 
-### iOS
-ComPDFKit Conversion SDK requires the latest stable version of Xcode available at the time the release was made. This is a hard requirement, as each version of Xcode is bundled with a specific version of the iOS or macOS Base SDK.
-> - iOS 10.0 or higher.
-> - macOS 10.10 or higher.
-> - Xcode 12.0 or newer for Objective-C.
+This project is a starting point for a Flutter
+[plug-in package](https://flutter.dev/developing-packages/),
+a specialized package that includes platform-specific implementation code for
+Android and/or iOS.
 
+For help getting started with Flutter development, view the
+[online documentation](https://flutter.dev/docs), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.
 
-### How to Run a Demo
-You can open this project with Android studio. You can find them in the "ComPDFKit_Conversion_Flutter_Demo" folder. In this guide, it takes the "Flutter" demo as an example to show how to run it in Android and iOS.
-
-> 1. Import the "ComPDFKit_Conversion_Flutter_Demo” project on Android Studio.
-> 2. In the toolbar, select "ComPDFKit_Conversion_Flutter_Demo" from the run configurations drop-down menu.
-> 3. From the target device drop-down menu, select the device that you want to run
-     "ComPDFKit_Conversion_Flutter_Demo" on.
-> 4. Click "Run".
-
-**If you don't have any devices configured, then you need to either connect a device via USB or create an AVD to use the Android Emulator.**
-**If you need to run on the ios simulator, please install Xcode**
-
-# How to integrate ComPDFKit Conversion SDK in the Flutter?
-If you want to run the **ComPDFKit Conversion SDK** on the **Flutter** platform and integrate it on **Android** and **iOS**, you need to integrate the **ComPDFKitConversion.aar** on the **Android** side and reference the **ComPDFKitConversion.framework** on the **iOS** side. Use the **Flutter EventChannel** to communicate and thus implement the use of the **ComPDFKit Conversion SDK in Flutter**.
-
-## Integration on Android platform.
-1. Use Android Studio to create a Phone & Tablet project in Kotlin.
-2. Copy ComPDFkitConversion.aar to the Lib directory of the app.
-3. Add the following code into the app’s build.gradle file.
-
-```kotlin
-android{ 
-    ...
-  defaultConfig {
-      ...
-      ndk {
-          abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
-        } 
-    }
-    ...
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
-    kotlinOptions {
-        jvmTarget = '1.8'
-    }
-    buildFeatures {
-        viewBinding true
-    }
-    repositories {
-        flatDir {
-            dirs 'libs'
-        } 
-    }
-}
-
-dependencies {
-  implementation(name: 'ComPDFKitConversion', ext: 'aar')
-  ...
-}
-```
-4. Apply for read and write permissions in AndroidManifest.xml.
-```xml
-<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
-```
-5. Add the following code into the app’s build.gradle file.
-   Add this license in the AndroidManifest.xml of the main module.
-```xml
-<meta-data
-  android:name="CPDFConverter_key"
-  android:value="YOUR_LICENSE_KEY_GOES_HERE" />
-<meta-data
-  android:name="CPDFConverter_secret"
-  android:value="YOUR_LICENSE_SECRET_GOES_HERE" />
-```
-
-## Integration on iOS platform.
-To integrate the **ComPDFKit_Conversion.framework** into your Flutter iOS project, follow these steps:
-
-1.Open your Flutter iOS project using **Xcode** or other suitable IDE tool.
-2.Drag and drop the **ComPDFKit_Conversion.framework** file into your project, ensuring that they are placed correctly.
-![0368093e81dc08219a840fb9214750e8.png](doc/ios_add_framework.png)<br>
-3.Click **Finish** in the popup to complete the addition
-![9d0e89ccdbb770d5d729da41c9e1875e.png](doc/ios_confirm_dialog.png)<br>
-4.To embed the required frameworks and libraries into your project, you can open the **General** tab in the project configuration and locate the **Frameworks, Libraries, and Embedded Content** option. Within this tab, you can select **Embed & Sign** to embed and sign the necessary frameworks and libraries, which will ensure that your project compiles and runs smoothly.
-![e45f0d765d6c6aade15d2d08846c49f8.png](doc/ios_embed.png)
-5.Apply the License Key
-
-- Swift<br>
-```swift
-import UIKit
-import Flutter
-
-import ComPDFKit_Conversion
-
-@UIApplicationMain
-@objc class AppDelegate: FlutterAppDelegate {
-  override func application(
-    _ application: UIApplication,
-    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
-  ) -> Bool {
-      ComPDFKit_Conversion.CPDFConvertKit.setLicenseKey(
-      licenseKey: "YOUR_LICENSE_KEY_GOES_HERE", secret: "YOUR_LICENSE_SECRET_GOES_HERE")
-      ...
-    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
-  }
-}
-
-```
-
-- Objective-C<br>
-```objc
-#import "AppDelegate.h"
-#import "GeneratedPluginRegistrant.h"
-#import <ComPDFKit_Conversion/ComPDFKit_Conversion.h>
-
-@implementation AppDelegate
-
-- (BOOL)application:(UIApplication *)application
-    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-    [CPDFConvertKit setLicenseKey:@"YOUR_LICENSE_KEY_GOES_HERE" secret:@"YOUR_LICENSE_SECRET_GOES_HERE"];
-    
-  [GeneratedPluginRegistrant registerWithRegistry:self];
-  return [super application:application didFinishLaunchingWithOptions:launchOptions];
-}
-@end
-```
-
-## Flutter Platform Usage
-To demonstrate how to use it, we will take converting a PDF file to a PPT file as an example.
-
-The specific steps are as follows:
-
-First, you need to select a PDF file from your mobile storage. You can do this in your preferred way, or you can use the **file_picker** plugin to retrieve the file. Here, we will use the **file_picker** plugin as an example.
-1.Add the **file_picker** plugin in the **pubspec.yaml** file, and then click **Pub get** in the upper right corner to complete the plugin addition.
-```yaml
-dependencies:
-  flutter:
-    sdk: flutter
-
-  cupertino_icons: ^1.0.2
-  file_picker: ^5.2.5
-  ...
-```
-2.Get PDF file
-```dart
-    FilePickerResult? result = await FilePicker.platform.pickFiles(
-        type: FileType.custom, allowedExtensions: ['pdf'], allowMultiple: true);
-    if (result != null) {
-        List<String?> pdfFiles = result.paths;
-    }
-```
-3.Generate file conversion information and configure options to convert PDF to PPT.
-```dart
-Map<String, String> options = {
-      'dataTag' : tag,
-      'convertType' : "PPT",
-      'filePath' : pdfFilePath, //Selected pdf file path
-      'fileName' : fileName,
-      'containImages': true,
-      'containAnnotations': true,
-    };
-```
-
-2.Using EventChannel to enable communication between Flutter and the Native platform, thereby achieving file conversion functionality.
-> You can refer to the **convert_flutter.dart** class in Demo
-
-```dart
-ElevatedButton(onPressed: () {
-     ConvertFlutter().convert(context, pdfFilePath);
-},child: Text("convert"))
-
-
-
-class ConvertFlutter {
-  static const EventChannel _channel =
-      EventChannel('com.compdfkit.conversion.flutter.convert');
-
-  void convert(BuildContext context, String pdfFilePath) {
-    Map<String, String> options = {
-      'dataTag' : "tag",
-      'convertType' : "PPT",
-      'filePath' : pdfFilePath,
-      'fileName' : "fileName",
-      'containImages': "true",
-      'containAnnotations': "true",
-    };
-    _channel.receiveBroadcastStream(options).listen((event) {
-      Map<dynamic, dynamic> result = event;
-      String dataTag = result['dataTag'];
-      
-      //get convert file progress
-      int progress = result['progress'];
-      
-      //converting : 1
-      //convert_success : 2
-      //convert_fail : 3
-      int convertStatus = result['status'];
-      //If the file conversion is successful, you can obtain the saved file path of the converted file through the outputpath field.
-      String convertOutputPath = result['outputPath']
-      
-    }, onDone: () {}, onError: (object) {});
-  }
-}
-```
-## The native platform realizes the conversion function
-### Android platform
-1.On the Android platform, you need to use **EventChannel** to communicate with Flutter and retrieve the serialized data transmitted by Flutter in the **onListen** method.
-```kotlin
-class ConvertFlutterPlugin(var activity: MainActivity, flutterPlugin: FlutterEngine) : EventChannel.StreamHandler {
-    
-    private val channelName = "com.compdfkit.conversion.flutter.convert"
-    
-    private var channel : EventChannel
-    
-    init {
-        channel = EventChannel(flutterPlugin.dartExecutor.binaryMessenger, channelName)
-        channel.setStreamHandler(this)
-    }
-    
-    override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {   
-        val convertInfoMap = arguments as Map<String, String>
-        
-    }
-
-    override fun onCancel(arguments: Any?) {
-
-    }
-    
-}
-
-```
-2.You can use the **ComPDFKit Conversion SDK API** to perform file conversion operations within the **onListen()** method. The following demonstration shows you how to convert a PDF file to PPT format.
-```kotlin
-    override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {   
-        val convertInfoMap = arguments as Map<String, String>
-        val pdfFilePath = convertInfoMap["filePath"]
-        val convertType = convertInfoMap["convertType"]
-        val isContainImages = convertInfoMap["containImages"].toBoolean()
-        val isContainAnnotations = convertInfoMap["containAnnotations"].toBoolean()
-        
-        activity.lifecycleScope.launch(Dispatchers.IO){
-            val pptOptions = CPDFConvertPPTOptions().also {
-             it.isContainImages = isContainImages
-             it.isContainAnnotations = isContainAnnotation
-            }
-            //Please convert string type filePath to Uri type 
-            //If the pdf file is encrypted, please fill in the file password
-            var cPDFConvert = CPDFConverterPPT(context, fileUri, pdfPassword)
-            cPDFConvert.convert(outputDir = "outPutDir",
-                outputFilenameNoSuffix = "",
-                options = pptOptions,
-                pageArrays = null,
-                onHandle = {
-                    //convert start
-                }, onProgress = { current, total ->
-                    val progress = ((current / total.toFloat()) * 1000).toInt() / 10
-                    val resultData = mapOf(
-                        "progress" to progress,
-                        "dataTag" to dataTag,
-                        "status" to 1
-                    )
-                    
-                    activity.lifecycleScope.launch(Dispatchers.Main) {
-                        //Return the current conversion progress
-                        events?.success(resultData)
-                    }
-                
-                }, onPost = { code, outFilePath ->
-                
-                    when(code){
-                        ConvertError.ERR_SUCCESS->{
-                            //convert success
-                            val process = mapOf(
-                                "progress" to 100, 
-                                "dataTag" to dataTag, 
-                                "status" to CONVERT_SUCCESS, 
-                                "outputPath" to outFilePath
-                            )
-                            activity.lifecycleScope.launch(Dispatchers.Main) {
-                                //Return conversion completion information 
-                                events?.success(process)
-                            }
-                        }
-                        ConvertError.ERR_CONVERTING->{
-                            ...
-                        }
-                        else ->{
-                            ...
-                        }
-                }
-            })          
-        }  
-}
-```
-3.You need to call **ConvertFlutterPlugin.kt** in the **configureFlutterEngine** method of **MainActivity.kt**.
-```kotlin
-
-class MainActivity: FlutterActivity() {
-
-    override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
-        super.configureFlutterEngine(flutterEngine)
-        ConvertFlutterPlugin(this, flutterEngine)
-    }
-}
-```
-> **Congratulations, you have successfully integrated the ComPDFKit Conversion SDK into your Flutter application on Android, enabling PDF to PPT conversion.**
-
-### iOS platform
-1.On the iOS platform, you need to use **FlutterEventChannel** to communicate with Flutter and retrieve the serialized data transmitted by Flutter in the **onListen** method.
-#### Swift
-```swift
-class ConverFilePlugin{
-    
-        init(messenger : FlutterBinaryMessenger){
-            let channel = FlutterEventChannel(name: "com.compdfkit.conversion.flutter.convert", binaryMessenger: messenger)
-            channel.setStreamHandler(SwiftStreamHandler())
-        }
-        
-}
-
-
-class SwiftStreamHandler: NSObject, FlutterStreamHandler {
-    
-
-    
-    public func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? {
-        
-        var convertData = arguments as! [String: String];
-        var filePath = convertData["filePath"] ?? "";
-        let convertType = convertData["convertType"]!;
-        let dataTag = String(convertData["dataTag"]!);
-        let queue = DispatchQueue(label: "com.compdfkit.conversion.flutter")
-        queue.async {
-            
-            let util = ConvertUtil()
-            let options = util.getConvertOptions(withArguments: arguments)
-            util.convert(options: options, filePath: filePath, convertType: convertType)
-            
-        }
-            return nil
-        }
-
-        public func onCancel(withArguments arguments: Any?) -> FlutterError? {
-            return nil
-        }
-    
-}
-
-```
-#### Objective-C
-```swift
-
-
-```
-2.You can use the **ComPDFKit Conversion SDK API** to perform file conversion operations within the **onListen()** method. The following demonstration shows you how to convert a PDF file to PPT format.
-#### Swift
-```swift
-import Foundation
-import ComPDFKit_Conversion
-
- class ConvertUtil : NSObject, CPDFConverterDelegate{
-    
-    let params_convert_type = "convertType";
-    let params_file_path = "filePath";
-    let params_file_name = "file_name";
-    let params_data_tag = "dataTag";
-    let params_contain_images = "containImages";
-    let params_contain_annotations = "containAnnotations";
-    
-     var result: ((Int, Int, String?) -> Void)?
-    
-    func getConvertOptions(withArguments arguments: Any?) -> CPDFConvertOptions {
-        let convertData = arguments as! [String: String];
-        let isContainImages = Bool(convertData[params_contain_images] ?? "true") ?? true
-        let isContainAnnotation = Bool(convertData[params_contain_annotations] ?? "true") ?? true;
-        let filePath = convertData[params_file_path];
-        let fileName = convertData[params_file_name];
-
-        let pptOptions = CPDFConvertPPTOptions()
-            pptOptions.isContainImages = isContainImages
-            pptOptions.isContainAnnotations = isContainAnnotation
-        return pptOptions
-    
-    }
-    
-    
-     func convert(options :CPDFConvertOptions, filePath:String, convertType : String, onProgress : @escaping (_ progress : Int, _ status : Int, _ outputPath : String?) -> Void) {
-        
-        result = onProgress
-        
-        let outPutPath = NSHomeDirectory() + "/Documents/ConversionDemo"
-        
-        let fileURL = URL(string: filePath)
-        //If the pdf file is encrypted, please fill in the file password
-        let pdfConvert : CPDFConverter = CPDFConverterPPT(url: fileURL, password: "")
-        //Start converting pdf to ppt
-        pdfConvert.convert(toFilePath: outPutPath, pageIndexs: [Int](), options: options)
-        pdfConvert?.delegate = self
-    }
-
-    
-
-    func converter(_ converter: CPDFConverter!, didStartConvert error: Error!) {
-       //conversion started
-
-    }
-    
-    func converter(_ converter: CPDFConverter!, pageIndex index: UInt, pageCount count: UInt) {
-        //conversion in progress
-        let progress = Double(index) / Double(count)
-        result?(Int(progress*100), 1, nil)
-    }
-    
-    func converter(_ converter: CPDFConverter!, didEndConvert error: Error!) {
-        //end of conversion
-    }
-}
-
-
-```
-#### Objective-C
-```objc
-
-```
-
-## Support
-### Reporting Problems
-Thanks for your interest in ComPDFKit Conversion SDK, the only easy-to-use but powerful development solution. If you encounter any technical questions or bug issues when using ComPDFKit Conversion SDK for Android, please submit the problem report to the ComPDFKit team. More information as follows would help us to solve your problem:
-- ComPDFKit Conversion SDK product and version
-- Your Operating System and IDE version
-- Detailed description of the problem
-- Any other related information, such as error screenshot
-### Contact Information
-- Home link: [https://www.compdf.com](https://www.compdf.com)
-- Email: support@pdfreaderpro.com
-***
-Thanks,<br>
-The ComPDFKit Team

+ 0 - 25
analysis_options.yaml

@@ -1,29 +1,4 @@
-# This file configures the analyzer, which statically analyzes Dart code to
-# check for errors, warnings, and lints.
-#
-# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
-# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
-# invoked from the command line by running `flutter analyze`.
-
-# The following line activates a set of recommended lints for Flutter apps,
-# packages, and plugins designed to encourage good coding practices.
 include: package:flutter_lints/flutter.yaml
 
-linter:
-  # The lint rules applied to this project can be customized in the
-  # section below to disable rules from the `package:flutter_lints/flutter.yaml`
-  # included above or to enable additional rules. A list of all available lints
-  # and their documentation is published at
-  # https://dart-lang.github.io/linter/lints/index.html.
-  #
-  # Instead of disabling a lint rule for the entire project in the
-  # section below, it can also be suppressed for a single line of code
-  # or a specific dart file by using the `// ignore: name_of_lint` and
-  # `// ignore_for_file: name_of_lint` syntax on the line or in the file
-  # producing the lint.
-  rules:
-    # avoid_print: false  # Uncomment to disable the `avoid_print` rule
-    # prefer_single_quotes: true  # Uncomment to enable the `prefer_single_quotes` rule
-
 # Additional information about this file can be found at
 # https://dart.dev/guides/language/analysis-options

+ 8 - 12
android/.gitignore

@@ -1,13 +1,9 @@
-gradle-wrapper.jar
-/.gradle
-/captures/
-/gradlew
-/gradlew.bat
+*.iml
+.gradle
 /local.properties
-GeneratedPluginRegistrant.java
-
-# Remember to never publicly share your keystore.
-# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
-key.properties
-**/*.keystore
-**/*.jks
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.cxx

+ 0 - 65
android/app/src/main/AndroidManifest.xml

@@ -1,65 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.compdfkit.conversion.flutter.kmpdfkit_demo">
-
-    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
-    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
-    <queries>
-        <intent>
-            <action android:name="android.intent.action.GET_CONTENT" />
-            <data android:mimeType="*/*"/>
-        </intent>
-    </queries>
-    <application
-        android:label="kmpdfkit_demo"
-        android:name="${applicationName}"
-        android:icon="@mipmap/ic_launcher">
-        <activity
-            android:name=".MainActivity"
-            android:exported="true"
-            android:launchMode="singleTop"
-            android:theme="@style/LaunchTheme"
-            android:requestLegacyExternalStorage="true"
-            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
-            android:hardwareAccelerated="true"
-            android:windowSoftInputMode="adjustResize">
-            <!-- Specifies an Android theme to apply to this Activity as soon as
-                 the Android process has started. This theme is visible to the user
-                 while the Flutter UI initializes. After that, this theme continues
-                 to determine the Window background behind the Flutter UI. -->
-            <meta-data
-              android:name="io.flutter.embedding.android.NormalTheme"
-              android:resource="@style/NormalTheme"
-              />
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.LAUNCHER"/>
-            </intent-filter>
-        </activity>
-        <!-- Don't delete the meta-data below.
-             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
-        <meta-data
-            android:name="flutterEmbedding"
-            android:value="2" />
-
-        <provider
-            android:name="androidx.core.content.FileProvider"
-            android:authorities="${applicationId}.fileprovider"
-            android:exported="false"
-            android:grantUriPermissions="true">
-            <meta-data
-                android:name="android.support.FILE_PROVIDER_PATHS"
-                android:resource="@xml/provider_paths" />
-        </provider>
-
-        <meta-data
-            android:name="CPDFConverter_key"
-            android:value="V5ZIAt7B3n3/V82MVCuOW2fdPEnldbemWjaAaxz4Gf8G2xkO/OAXarjtstBgqJFjUhe5wWky9rqCQx+Hl8G1vLN9s+obgAMpwPYWrLotFut4F6b4OUMYTsoMT8Lf6iMmnNpU/jETLGibspsVDHRZ+HPRpClAB3sjbpnb24nhZiw=" />
-        <meta-data
-            android:name="CPDFConverter_secret"
-            android:value="mG0c3O3Mzeu5dkZJW3gpqiAYrD3HuVAh2a+2rjOsIRiPkXOBYdZofN07Z1Wrsqj+VrBm8+cjeMi4JbhDcdQ3xcSx+g9ESJiPZnXkiFC2786cM/fgvvcctF5rcqYAH1dpMv7C2jvq4o0q6sQtN3jR43QdIezW2vV5wIeyNjPTddUNBwTRKvRkQ75Y56jVVUcsWiExjnRPpqLnyppZAnYJ1tnsa41fJuMqWbPW2c3qJUemdtKP7E4eFYSl6tjgcetK" />
-
-
-
-    </application>
-</manifest>

+ 0 - 51
android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/ConversionSDKFlutterPlugin.kt

@@ -1,51 +0,0 @@
-package com.compdfkit.conversion.flutter.kmpdfkit_demo
-
-import android.content.Context
-import android.util.Log
-import com.compdfkit.conversion.CPDFConverter
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.utils.FileUtils
-import io.flutter.embedding.engine.FlutterEngine
-import io.flutter.plugin.common.MethodCall
-import io.flutter.plugin.common.MethodChannel
-import kotlinx.coroutines.GlobalScope
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.launch
-import java.lang.reflect.Method
-
-/**
- *  ConversionSDKFlutterPlugin.kt
- *
- *  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
- *
- *  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
- *  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
- *  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
- *  This notice may not be removed from this file.
- **/
-class ConversionSDKFlutterPlugin(var context: Context, flutterPlugin: FlutterEngine) : MethodChannel.MethodCallHandler {
-
-    val channelName = "com.compdfkit.conversion.flutter.convert.sdk.info"
-
-    private var channel: MethodChannel
-
-    init {
-        channel = MethodChannel(flutterPlugin.dartExecutor.binaryMessenger, channelName)
-        channel.setMethodCallHandler(this)
-    }
-
-
-    override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
-        when(call.method){
-            "request_convert_output_path"->{
-                result.success(FileUtils.getOutputFilePath(context))
-            }
-            "request_convert_sdk_version" ->{
-                // return conversion sdk build tag info
-                result.success(CPDFConverter.getSDKBuildTag())
-
-            }
-        }
-    }
-
-
-}

+ 0 - 111
android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/ConvertFlutterPlugin.kt

@@ -1,111 +0,0 @@
-package com.compdfkit.conversion.flutter.kmpdfkit_demo
-
-import android.util.Log
-import androidx.lifecycle.lifecycleScope
-import com.compdfkit.conversion.*
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.utils.ConvertUtils
-import io.flutter.embedding.engine.FlutterEngine
-import io.flutter.plugin.common.EventChannel
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.launch
-
-/**
- *  ConvertFlutterPlugin.kt
- *
- *  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
- *
- *  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
- *  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
- *  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
- *  This notice may not be removed from this file.
- **/
-class ConvertFlutterPlugin(var activity: MainActivity, flutterPlugin: FlutterEngine) : EventChannel.StreamHandler {
-
-    private val channelName = "com.compdfkit.conversion.flutter.convert"
-
-
-    companion object {
-
-        val PARAMS_CONVERT_TYPE = "convertType"
-        val PARAMS_FILE_PATH = "filePath"
-        val PARAMS_FILE_NAME = "fileName"
-        val PARAMS_DATA_TAG = "dataTag"
-        val PARAMS_CONTAIN_IMAGES = "containImages"
-        val PARAMS_CONTAIN_ANNOTATIONS = "containAnnotations"
-        val PARAMS_WORK_SHEET_OPTIONS = "workSheetOptions"
-        val PARAMS_CONTENTOPTIONS = "contentOptions"
-        val PARAMS_IMAGE_DPI = "imageDpi"
-        val PARAMS_IMAGE_PAGE_OPTIONS = "imagePageOptions"
-        val PARAMS_MERGE_CSV = "mergeCSV"
-        val PARAMS_HTML_PAGE_OPTIONS = "htmlPageOptions"
-
-        val CONVERTING = 1
-        val CONVERT_SUCCESS = 2
-        val CONVERT_FAIL = 3
-    }
-
-
-    private var channel: EventChannel
-
-    init {
-        channel = EventChannel(flutterPlugin.dartExecutor.binaryMessenger, channelName)
-        channel.setStreamHandler(this)
-    }
-
-
-    override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
-        Log.e("conversion", "arguments:${arguments}")
-        activity.lifecycleScope.launch(Dispatchers.IO) {
-            var convertInfoMap = arguments as Map<String, String>
-            val convertUtils = ConvertUtils()
-            val options = convertUtils.getConvertOptions(convertInfoMap[PARAMS_CONVERT_TYPE] ?: "", convertInfoMap)
-            val dataTag = convertInfoMap[PARAMS_DATA_TAG]
-
-            convertUtils.onConvert(context = activity,
-                filePath = convertInfoMap[PARAMS_FILE_PATH] ?: "",
-                convertType = convertInfoMap[PARAMS_CONVERT_TYPE] ?: "", pageArrays = null, params = options, onHandle = {
-
-                }, onProgress = { current, total ->
-                    val progress = ((current / total.toFloat()) * 1000).toInt() / 10
-                    val resultData = mapOf(
-                        "progress" to progress,
-                        "dataTag" to dataTag,
-                        "status" to CONVERTING
-                    )
-                    Log.e("conversion", "progress:${progress}, dataTag:${dataTag}")
-                    activity.lifecycleScope.launch(Dispatchers.Main) {
-                        events?.success(resultData)
-
-                    }
-                }, onPost = { code, outFilePath ->
-                    Log.e("conversion", "onPost, code:${code.name}, outputPath:${outFilePath}")
-                    when (code) {
-                        ConvertError.ERR_SUCCESS -> {
-                            val process = mapOf(
-                                "progress" to 100,
-                                "dataTag" to dataTag,
-                                "status" to CONVERT_SUCCESS,
-                                "outputPath" to outFilePath
-                            )
-                            activity.lifecycleScope.launch(Dispatchers.Main) {
-                                events?.success(process)
-                            }
-                        }
-                        else -> {
-                            val process = mapOf("progress" to 100, "dataTag" to dataTag, "status" to CONVERT_FAIL, "msg" to code.name)
-                            activity.lifecycleScope.launch(Dispatchers.Main) {
-                                events?.success(process)
-                            }
-                        }
-                    }
-                })
-        }
-
-    }
-
-    override fun onCancel(arguments: Any?) {
-
-    }
-
-
-}

+ 0 - 27
android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/MainActivity.kt

@@ -1,27 +0,0 @@
-package com.compdfkit.conversion.flutter.kmpdfkit_demo
-
-import io.flutter.embedding.android.FlutterActivity
-import io.flutter.embedding.engine.FlutterEngine
-
-
-/**
- *  MainActivity.kt
- *
- *  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
- *
- *  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
- *  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
- *  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
- *  This notice may not be removed from this file.
- **/
-class MainActivity: FlutterActivity() {
-
-
-    override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
-        super.configureFlutterEngine(flutterEngine)
-        ConvertFlutterPlugin(this, flutterEngine)
-        ConversionSDKFlutterPlugin(this, flutterEngine)
-    }
-
-
-}

+ 36 - 8
android/build.gradle

@@ -1,3 +1,6 @@
+group 'com.compdfkit.conversion.flutter.kmpdfkit_conversion_flutter'
+version '1.0-SNAPSHOT'
+
 buildscript {
     ext.kotlin_version = '1.7.10'
     repositories {
@@ -18,14 +21,39 @@ allprojects {
     }
 }
 
-rootProject.buildDir = '../build'
-subprojects {
-    project.buildDir = "${rootProject.buildDir}/${project.name}"
-}
-subprojects {
-    project.evaluationDependsOn(':app')
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+
+android {
+    compileSdkVersion 33
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+
+    kotlinOptions {
+        jvmTarget = '1.8'
+    }
+
+    sourceSets {
+        main.java.srcDirs += 'src/main/kotlin'
+    }
+
+    defaultConfig {
+        minSdkVersion 21
+    }
 }
 
-task clean(type: Delete) {
-    delete rootProject.buildDir
+rootProject.allprojects {
+    repositories {
+        flatDir {
+            dirs project(':kmpdfkit_conversion_flutter').file('libs')
+        }
+    }
 }
+
+dependencies {
+    api fileTree(include: ['*.jar'], dir: 'libs')
+    api(name:"ComPDFKitConversion", ext:"aar")
+}

android/app/libs/ComPDFKitConversion.aar → android/libs/ComPDFKitConversion.aar


+ 1 - 11
android/settings.gradle

@@ -1,11 +1 @@
-include ':app'
-
-def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
-def properties = new Properties()
-
-assert localPropertiesFile.exists()
-localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
-
-def flutterSdkPath = properties.getProperty("flutter.sdk")
-assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
-apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
+rootProject.name = 'kmpdfkit_conversion_flutter'

+ 3 - 0
android/src/main/AndroidManifest.xml

@@ -0,0 +1,3 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+  package="com.compdfkit.conversion.flutter.plugin">
+</manifest>

+ 52 - 0
android/src/main/kotlin/com/compdfkit/conversion/flutter/plugin/ConversionSDKFlutterPlugin.kt

@@ -0,0 +1,52 @@
+package com.compdfkit.conversion.flutter.plugin
+
+import android.content.Context
+import androidx.annotation.NonNull
+import com.compdfkit.conversion.CPDFConverter
+import com.compdfkit.conversion.flutter.plugin.utils.FileUtils
+
+import io.flutter.embedding.engine.plugins.FlutterPlugin
+import io.flutter.plugin.common.MethodCall
+import io.flutter.plugin.common.MethodChannel
+import io.flutter.plugin.common.MethodChannel.MethodCallHandler
+import io.flutter.plugin.common.MethodChannel.Result
+
+
+class ConversionSDKFlutterPlugin : FlutterPlugin, MethodCallHandler {
+
+    private lateinit var channel: MethodChannel
+
+    private var context: Context? = null
+
+    override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
+        context = flutterPluginBinding.applicationContext
+        channel = MethodChannel(flutterPluginBinding.binaryMessenger, "com.compdfkit.conversion.flutter.convert.sdk.info")
+        channel.setMethodCallHandler(this)
+        flutterPluginBinding.flutterEngine.plugins.add(ConvertFlutterPlugin())
+    }
+
+    override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
+        when (call.method) {
+            "conversion_init" ->{
+                result.success(true)
+            }
+            "request_convert_output_path" -> {
+                context?.let {
+                    result.success(FileUtils.getOutputFilePath(context = it))
+                }
+            }
+            "sdk_build_tag" -> {
+                // return conversion sdk build tag info
+                result.success(CPDFConverter.getSDKBuildTag())
+            }
+            "sdk_version" ->{
+                result.success(CPDFConverter.getSDKVersion())
+            }
+        }
+    }
+
+    override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
+        channel.setMethodCallHandler(null)
+        context = null
+    }
+}

+ 158 - 0
android/src/main/kotlin/com/compdfkit/conversion/flutter/plugin/ConvertFlutterPlugin.kt

@@ -0,0 +1,158 @@
+package com.compdfkit.conversion.flutter.plugin
+
+import android.content.Context
+import android.util.Log
+import com.compdfkit.conversion.ConvertError
+import com.compdfkit.conversion.flutter.plugin.utils.ConvertUtils
+import io.flutter.embedding.engine.plugins.FlutterPlugin
+import io.flutter.plugin.common.EventChannel
+import io.flutter.plugin.common.MethodChannel
+import kotlinx.coroutines.*
+
+/**
+ *  ConvertFlutterPlugin.kt
+ *
+ *  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+ *
+ *  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+ *  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+ *  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+ *  This notice may not be removed from this file.
+ **/
+class ConvertFlutterPlugin : FlutterPlugin, EventChannel.StreamHandler {
+
+    private val channelName = "com.compdfkit.conversion.flutter.convert"
+
+
+    companion object {
+
+        val PARAMS_CONVERT_TYPE = "convertType"
+        val PARAMS_FILE_PATH = "filePath"
+        val PARAMS_FILE_NAME = "fileName"
+        val PARAMS_TASK_ID = "taskId"
+        val PARAMS_CONTAIN_IMAGES = "containImages"
+        val PARAMS_CONTAIN_ANNOTATIONS = "containAnnotations"
+        val PARAMS_WORK_SHEET_OPTIONS = "workSheetOptions"
+        val PARAMS_CONTENTOPTIONS = "contentOptions"
+        val PARAMS_IMAGE_DPI = "imageDpi"
+        val PARAMS_IMAGE_PAGE_OPTIONS = "imagePageOptions"
+        val PARAMS_MERGE_CSV = "mergeCSV"
+        val PARAMS_HTML_PAGE_OPTIONS = "htmlPageOptions"
+
+        val TASK_STATUS_WAIT = 0
+        val TASK_STATUS_START = 1
+        val TASK_STATUS_CONVERTING = 2
+        val TASK_STATUS_SUCCESS = 3
+        val TASK_STATUS_FAIL = 4
+        val TASK_STATUS_CANCEL = 5
+
+    }
+
+    private var convertUtils = ConvertUtils()
+
+    private var context: Context? = null
+
+    override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
+        context = binding.applicationContext
+        val channel = EventChannel(binding.binaryMessenger, channelName)
+        channel.setStreamHandler(this)
+
+        val methodChannel = MethodChannel(binding.binaryMessenger, "com.compdfkit.conversion.flutter.convert.method")
+        methodChannel.setMethodCallHandler { call, result ->
+            when (call.method) {
+                "cancel_task" -> {
+                    convertUtils.cancel()
+                }
+                else -> {
+                    result.notImplemented()
+                }
+            }
+        }
+    }
+
+    override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
+
+    }
+
+    private var eventSink: EventChannel.EventSink? = null
+
+    override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
+        eventSink = events
+        print("CPDFConversion : Android端已收到转档任务,开始进行转档")
+        startTask(arguments)
+    }
+
+    override fun onCancel(arguments: Any?) {
+
+    }
+
+    private fun startTask(arguments: Any?) {
+        GlobalScope.launch(Dispatchers.IO) {
+            val convertInfoMap = arguments as Map<String, Any>
+            print("CPDFConversion : Android端已收到转档任务,开始进行转档")
+            print(convertInfoMap)
+            val options = convertUtils.getConvertOptions(convertInfoMap[PARAMS_CONVERT_TYPE]?.toString() ?: "", convertInfoMap)
+            val taskId = convertInfoMap[PARAMS_TASK_ID] as? String ?: ""
+            if (context == null) {
+                return@launch
+            }
+            val err = convertUtils.onConvert(context = context!!,
+                filePath = convertInfoMap[PARAMS_FILE_PATH]?.toString() ?: "",
+                convertType = convertInfoMap[PARAMS_CONVERT_TYPE]?.toString() ?: "", pageArrays = null, params = options,
+                onHandle = {
+                    updateTask(
+                        taskId = taskId,
+                        progress = 0,
+                        taskStatus = TASK_STATUS_START
+                    )
+                }, onProgress = { current, total ->
+                    val progress = ((current / total.toFloat()) * 1000).toInt() / 10
+                    Log.e("conversion", "progress:${progress}, taskId:${taskId}")
+                    updateTask(
+                        taskId = taskId,
+                        progress = progress,
+                        taskStatus = TASK_STATUS_CONVERTING
+                    )
+                }, onPost = { code, outFilePath ->
+                    Log.e("conversion", "onPost, code:${code.name}, outputPath:${outFilePath}")
+                    when (code) {
+                        ConvertError.ERR_SUCCESS -> {
+                            updateTask(
+                                taskId = taskId,
+                                progress = 100,
+                                taskStatus = TASK_STATUS_SUCCESS,
+                                outputPath = outFilePath
+                            )
+                        }
+                        ConvertError.ERR_INTERRUPT ->{
+                            updateTask(
+                                taskId = taskId,
+                                progress = 100,
+                                taskStatus = TASK_STATUS_CANCEL
+                            )
+                        }
+                        else -> {
+                            updateTask(
+                                taskId = taskId,
+                                progress = 100,
+                                taskStatus = TASK_STATUS_FAIL
+                            )
+                        }
+                    }
+                })
+        }
+    }
+
+    private fun updateTask(taskId: String, progress: Int = 0, taskStatus: Int, outputPath: String? = null) {
+        GlobalScope.launch(Dispatchers.Main) {
+            eventSink?.success(
+                mapOf(
+                    "progress" to progress,
+                    "taskId" to taskId,
+                    "status" to taskStatus,
+                    "outputPath" to outputPath
+                )
+            )
+        }
+    }
+}

android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/ConvertType.kt → android/src/main/kotlin/com/compdfkit/conversion/flutter/plugin/ConvertType.kt


+ 23 - 18
android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/utils/ConvertUtils.kt

@@ -1,15 +1,15 @@
-package com.compdfkit.conversion.flutter.kmpdfkit_demo.utils
+package com.compdfkit.conversion.flutter.plugin.utils
 
 import android.content.Context
 import com.compdfkit.conversion.*
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertFlutterPlugin.Companion.PARAMS_CONTAIN_ANNOTATIONS
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertFlutterPlugin.Companion.PARAMS_CONTAIN_IMAGES
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertFlutterPlugin.Companion.PARAMS_CONTENTOPTIONS
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertFlutterPlugin.Companion.PARAMS_HTML_PAGE_OPTIONS
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertFlutterPlugin.Companion.PARAMS_IMAGE_DPI
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertFlutterPlugin.Companion.PARAMS_IMAGE_PAGE_OPTIONS
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertFlutterPlugin.Companion.PARAMS_MERGE_CSV
-import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertFlutterPlugin.Companion.PARAMS_WORK_SHEET_OPTIONS
+import com.compdfkit.conversion.flutter.plugin.ConvertFlutterPlugin.Companion.PARAMS_CONTAIN_ANNOTATIONS
+import com.compdfkit.conversion.flutter.plugin.ConvertFlutterPlugin.Companion.PARAMS_CONTAIN_IMAGES
+import com.compdfkit.conversion.flutter.plugin.ConvertFlutterPlugin.Companion.PARAMS_CONTENTOPTIONS
+import com.compdfkit.conversion.flutter.plugin.ConvertFlutterPlugin.Companion.PARAMS_HTML_PAGE_OPTIONS
+import com.compdfkit.conversion.flutter.plugin.ConvertFlutterPlugin.Companion.PARAMS_IMAGE_DPI
+import com.compdfkit.conversion.flutter.plugin.ConvertFlutterPlugin.Companion.PARAMS_IMAGE_PAGE_OPTIONS
+import com.compdfkit.conversion.flutter.plugin.ConvertFlutterPlugin.Companion.PARAMS_MERGE_CSV
+import com.compdfkit.conversion.flutter.plugin.ConvertFlutterPlugin.Companion.PARAMS_WORK_SHEET_OPTIONS
 import com.compdfkit.conversion.flutter.kmpdfkit_demo.ConvertType
 
 /**
@@ -81,15 +81,10 @@ class ConvertUtils {
         }
     }
 
-    fun getConvertOptions(convertType: String, optionsMap: Map<String, String>): CPDFConvertOptions {
-        val isContainImages = optionsMap[PARAMS_CONTAIN_IMAGES].toBoolean()
-        val isContainAnnotation = optionsMap[PARAMS_CONTAIN_ANNOTATIONS].toBoolean()
-        val workSheetOptions = WorkSheetOptions.valueOf(optionsMap[PARAMS_WORK_SHEET_OPTIONS] ?: "")
-        val contentOptions = ContentOptions.valueOf(optionsMap[PARAMS_CONTENTOPTIONS] ?: "")
-        val imageDpi = optionsMap[PARAMS_IMAGE_DPI]
-        val imagePageOptions = ImgType.valueOf(optionsMap[PARAMS_IMAGE_PAGE_OPTIONS] ?: "PNG")
-        val mergeCSV = optionsMap[PARAMS_MERGE_CSV]?.toBoolean() ?: false
-        val htmlPageOptions = PageAndNavigationPaneOptions.valueOf(optionsMap[PARAMS_HTML_PAGE_OPTIONS] ?: "")
+    fun getConvertOptions(convertType: String, optionsMap: Map<String, Any>): CPDFConvertOptions {
+        val isContainImages = optionsMap[PARAMS_CONTAIN_IMAGES] as? Boolean ?: true
+        val isContainAnnotation = optionsMap[PARAMS_CONTAIN_ANNOTATIONS] as? Boolean ?: true
+
         return when (ConvertType.valueOf(convertType.uppercase())) {
             ConvertType.PPT -> CPDFConvertPPTOptions().also {
                 it.isContainImages = isContainImages
@@ -100,6 +95,8 @@ class ConvertUtils {
                 it.isContainAnnotations = isContainAnnotation
             }
             ConvertType.EXCEL -> CPDFConvertExcelOptions().also {
+                val workSheetOptions = WorkSheetOptions.valueOf(optionsMap[PARAMS_WORK_SHEET_OPTIONS]?.toString() ?: "")
+                val contentOptions = ContentOptions.valueOf(optionsMap[PARAMS_CONTENTOPTIONS]?.toString() ?: "")
                 it.isContainImages = isContainImages
                 it.isContainAnnotations = isContainAnnotation
                 it.workSheetOptions = workSheetOptions
@@ -108,11 +105,14 @@ class ConvertUtils {
 
             ConvertType.TXT -> CPDFConvertTxtOptions()
             ConvertType.IMAGE -> CPDFConvertImgOptions().also {
+                val imageDpi = optionsMap[PARAMS_IMAGE_DPI] as? Number
+                val imagePageOptions = ImgType.valueOf(optionsMap[PARAMS_IMAGE_PAGE_OPTIONS]?.toString() ?: "PNG")
                 it.isContainAnnotations = isContainAnnotation
                 it.imageDpi = imageDpi?.toInt() ?: 300
                 it.imgType = imagePageOptions
             }
             ConvertType.CSV -> CPDFConvertCsvOptions().also {
+                val mergeCSV = optionsMap[PARAMS_MERGE_CSV] as? Boolean ?: false
                 it.isMergeCsv = mergeCSV
             }
             ConvertType.RTF -> CPDFConvertRtfOptions().also {
@@ -120,6 +120,7 @@ class ConvertUtils {
                 it.isContainAnnotations = isContainAnnotation
             }
             ConvertType.HTML -> CPDFConvertHtmlOptions().also {
+                val htmlPageOptions = PageAndNavigationPaneOptions.valueOf(optionsMap[PARAMS_HTML_PAGE_OPTIONS]?.toString() ?: "")
                 it.isContainImages = isContainImages
                 it.isContainAnnotations = isContainAnnotation
                 it.pageAndNavigationPaneOptions = htmlPageOptions
@@ -128,5 +129,9 @@ class ConvertUtils {
         }
     }
 
+    fun cancel(){
+        cPDFConvert?.cancle()
+    }
+
 
 }

+ 1 - 1
android/app/src/main/kotlin/com/compdfkit/conversion/flutter/kmpdfkit_demo/utils/FileUtils.kt

@@ -1,4 +1,4 @@
-package com.compdfkit.conversion.flutter.kmpdfkit_demo.utils
+package com.compdfkit.conversion.flutter.plugin.utils
 
 import android.content.Context
 import android.net.Uri

二进制
doc/ios_add_framework.png


二进制
doc/ios_confirm_dialog.png


二进制
doc/ios_embed.png


+ 44 - 0
example/.gitignore

@@ -0,0 +1,44 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+/build/
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
+
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/profile
+/android/app/release

+ 16 - 0
example/README.md

@@ -0,0 +1,16 @@
+# kmpdfkit_conversion_flutter_example
+
+Demonstrates how to use the kmpdfkit_conversion_flutter plugin.
+
+## Getting Started
+
+This project is a starting point for a Flutter application.
+
+A few resources to get you started if this is your first Flutter project:
+
+- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
+- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
+
+For help getting started with Flutter development, view the
+[online documentation](https://docs.flutter.dev/), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.

+ 29 - 0
example/analysis_options.yaml

@@ -0,0 +1,29 @@
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+#
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
+# invoked from the command line by running `flutter analyze`.
+
+# The following line activates a set of recommended lints for Flutter apps,
+# packages, and plugins designed to encourage good coding practices.
+include: package:flutter_lints/flutter.yaml
+
+linter:
+  # The lint rules applied to this project can be customized in the
+  # section below to disable rules from the `package:flutter_lints/flutter.yaml`
+  # included above or to enable additional rules. A list of all available lints
+  # and their documentation is published at
+  # https://dart-lang.github.io/linter/lints/index.html.
+  #
+  # Instead of disabling a lint rule for the entire project in the
+  # section below, it can also be suppressed for a single line of code
+  # or a specific dart file by using the `// ignore: name_of_lint` and
+  # `// ignore_for_file: name_of_lint` syntax on the line or in the file
+  # producing the lint.
+  rules:
+    # avoid_print: false  # Uncomment to disable the `avoid_print` rule
+    # prefer_single_quotes: true  # Uncomment to enable the `prefer_single_quotes` rule
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options

+ 13 - 0
example/android/.gitignore

@@ -0,0 +1,13 @@
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
+/local.properties
+GeneratedPluginRegistrant.java
+
+# Remember to never publicly share your keystore.
+# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+key.properties
+**/*.keystore
+**/*.jks

+ 0 - 11
android/app/build.gradle

@@ -43,7 +43,6 @@ android {
     }
 
     defaultConfig {
-        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
         applicationId "com.compdfkit.conversion.flutter"
         // You can update the following values to match your application needs.
         // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
@@ -55,7 +54,6 @@ android {
 
     buildTypes {
         release {
-            // TODO: Add your own signing config for the release build.
             // Signing with the debug keys for now, so `flutter run --release` works.
             signingConfig signingConfigs.debug
         }
@@ -67,14 +65,5 @@ flutter {
 }
 
 dependencies {
-    implementation fileTree(dir: "libs", include: ["*.jar","*.aar"])
-
-    implementation "androidx.core:core-ktx:1.7.0"
-    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
-    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
-    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
-    api 'androidx.documentfile:documentfile:1.0.1'
-
 }

+ 1 - 1
android/app/src/profile/AndroidManifest.xml

@@ -1,5 +1,5 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.compdfkit.conversion.flutter.kmpdfkit_demo">
+    package="com.compdfkit.conversion.flutter.example">
     <!-- The INTERNET permission is required for development. Specifically,
          the Flutter tool needs it to communicate with the running application
          to allow setting breakpoints, to provide hot reload, etc.

+ 53 - 0
example/android/app/src/main/AndroidManifest.xml

@@ -0,0 +1,53 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.compdfkit.conversion.flutter.example">
+   <application
+        android:label="kmpdfkit_conversion_flutter_example"
+        android:name="${applicationName}"
+        android:icon="@mipmap/ic_launcher">
+        <activity
+            android:name=".MainActivity"
+            android:exported="true"
+            android:launchMode="singleTop"
+            android:theme="@style/LaunchTheme"
+            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
+            android:hardwareAccelerated="true"
+            android:windowSoftInputMode="adjustResize">
+            <!-- Specifies an Android theme to apply to this Activity as soon as
+                 the Android process has started. This theme is visible to the user
+                 while the Flutter UI initializes. After that, this theme continues
+                 to determine the Window background behind the Flutter UI. -->
+            <meta-data
+              android:name="io.flutter.embedding.android.NormalTheme"
+              android:resource="@style/NormalTheme"
+              />
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
+        </activity>
+        <!-- Don't delete the meta-data below.
+             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
+        <meta-data
+            android:name="flutterEmbedding"
+            android:value="2" />
+
+       <provider
+           android:name="androidx.core.content.FileProvider"
+           android:authorities="${applicationId}.fileprovider"
+           android:exported="false"
+           android:grantUriPermissions="true">
+           <meta-data
+               android:name="android.support.FILE_PROVIDER_PATHS"
+               android:resource="@xml/provider_paths" />
+       </provider>
+
+
+       <meta-data
+           android:name="CPDFConverter_key"
+           android:value="HcEZS8HQrBctbJli1xlWOJZq3SAVyEJGiOLDVgu7TaSCTutQTwE7Ob0BHdoyyqeauYV5qpfpv+0sqREPobyjxMYPXPWgfR9tu1l8cBzY1aagCXmEmH52tqT11le1QLdQpIHuMEjl0kNKrrnXoZg5IXM+yK+zGPFZur+Sg36vEak=" />
+       <meta-data
+           android:name="CPDFConverter_secret"
+           android:value="mG0c3O3Mzeu5dkZJW3gpqotjgd+APU/4fMqIHQR4gdwo2nT+JSjvjfOo8NxHMSkD++hxhwHCwPoJfrSZGObicXKC+c93UnqcfqUbcdY/oQKcM/fgvvcctF5rcqYAH1dpMv7C2jvq4o0q6sQtN3jR43QdIezW2vV5wIeyNjPTddUNBwTRKvRkQ75Y56jVVUcsWiExjnRPpqLnyppZAnYJ1tnsa41fJuMqWbPW2c3qJUemdtKP7E4eFYSl6tjgcetK" />
+
+   </application>
+</manifest>

+ 6 - 0
example/android/app/src/main/kotlin/com/compdfkit/conversion/flutter/example/MainActivity.kt

@@ -0,0 +1,6 @@
+package com.compdfkit.conversion.flutter.example
+
+import io.flutter.embedding.android.FlutterActivity
+
+class MainActivity: FlutterActivity() {
+}

android/app/src/main/res/drawable-v21/launch_background.xml → example/android/app/src/main/res/drawable-v21/launch_background.xml


android/app/src/main/res/drawable/launch_background.xml → example/android/app/src/main/res/drawable/launch_background.xml


android/app/src/main/res/mipmap-hdpi/ic_launcher.png → example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png


android/app/src/main/res/mipmap-mdpi/ic_launcher.png → example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png


android/app/src/main/res/mipmap-xhdpi/ic_launcher.png → example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png


android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png → example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png → example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


android/app/src/main/res/values-night/styles.xml → example/android/app/src/main/res/values-night/styles.xml


android/app/src/main/res/values/styles.xml → example/android/app/src/main/res/values/styles.xml


android/app/src/main/res/xml/provider_paths.xml → example/android/app/src/main/res/xml/provider_paths.xml


+ 1 - 1
android/app/src/debug/AndroidManifest.xml

@@ -1,5 +1,5 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.compdfkit.conversion.flutter.kmpdfkit_demo">
+    package="com.compdfkit.conversion.flutter.example">
     <!-- The INTERNET permission is required for development. Specifically,
          the Flutter tool needs it to communicate with the running application
          to allow setting breakpoints, to provide hot reload, etc.

+ 31 - 0
example/android/build.gradle

@@ -0,0 +1,31 @@
+buildscript {
+    ext.kotlin_version = '1.7.10'
+    repositories {
+        google()
+        mavenCentral()
+    }
+
+    dependencies {
+        classpath 'com.android.tools.build:gradle:7.2.0'
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+    }
+}
+
+allprojects {
+    repositories {
+        google()
+        mavenCentral()
+    }
+}
+
+rootProject.buildDir = '../build'
+subprojects {
+    project.buildDir = "${rootProject.buildDir}/${project.name}"
+}
+subprojects {
+    project.evaluationDependsOn(':app')
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}

android/gradle.properties → example/android/gradle.properties


android/gradle/wrapper/gradle-wrapper.properties → example/android/gradle/wrapper/gradle-wrapper.properties


+ 11 - 0
example/android/settings.gradle

@@ -0,0 +1,11 @@
+include ':app'
+
+def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
+def properties = new Properties()
+
+assert localPropertiesFile.exists()
+localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
+
+def flutterSdkPath = properties.getProperty("flutter.sdk")
+assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
+apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

+ 34 - 0
example/ios/.gitignore

@@ -0,0 +1,34 @@
+**/dgph
+*.mode1v3
+*.mode2v3
+*.moved-aside
+*.pbxuser
+*.perspectivev3
+**/*sync/
+.sconsign.dblite
+.tags*
+**/.vagrant/
+**/DerivedData/
+Icon?
+**/Pods/
+**/.symlinks/
+profile
+xcuserdata
+**/.generated/
+Flutter/App.framework
+Flutter/Flutter.framework
+Flutter/Flutter.podspec
+Flutter/Generated.xcconfig
+Flutter/ephemeral/
+Flutter/app.flx
+Flutter/app.zip
+Flutter/flutter_assets/
+Flutter/flutter_export_environment.sh
+ServiceDefinitions.json
+Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!default.mode1v3
+!default.mode2v3
+!default.pbxuser
+!default.perspectivev3

ios/Flutter/AppFrameworkInfo.plist → example/ios/Flutter/AppFrameworkInfo.plist


ios/Flutter/Debug.xcconfig → example/ios/Flutter/Debug.xcconfig


ios/Flutter/Release.xcconfig → example/ios/Flutter/Release.xcconfig


+ 41 - 0
example/ios/Podfile

@@ -0,0 +1,41 @@
+# Uncomment this line to define a global platform for your project
+# platform :ios, '11.0'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+  'Debug' => :debug,
+  'Profile' => :release,
+  'Release' => :release,
+}
+
+def flutter_root
+  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
+  unless File.exist?(generated_xcode_build_settings_path)
+    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
+  end
+
+  File.foreach(generated_xcode_build_settings_path) do |line|
+    matches = line.match(/FLUTTER_ROOT\=(.*)/)
+    return matches[1].strip if matches
+  end
+  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_ios_podfile_setup
+
+target 'Runner' do
+  use_frameworks!
+  use_modular_headers!
+
+  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+end
+
+post_install do |installer|
+  installer.pods_project.targets.each do |target|
+    flutter_additional_ios_build_settings(target)
+  end
+end

+ 50 - 103
ios/Runner.xcodeproj/project.pbxproj

@@ -8,29 +8,21 @@
 
 /* Begin PBXBuildFile section */
 		1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
-		213CDB98C21625DCD1162CCC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 059E20BC1E428EEB5CDC6568 /* Pods_Runner.framework */; };
+		294858E9082334C8009F9D5B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB4FD1BF0DA67929BF7F74DB /* Pods_Runner.framework */; };
 		3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
-		4FF2BE9E29C161D00088AD17 /* ConvertDefine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FF2BE9D29C161D00088AD17 /* ConvertDefine.swift */; };
 		74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
 		97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
 		97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
 		97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
-		EC44ADDD29ADA0C800897924 /* ComPDFKit_Conversion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC44ADDB29AD9FB600897924 /* ComPDFKit_Conversion.framework */; };
-		EC44ADDE29ADA0C800897924 /* ComPDFKit_Conversion.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EC44ADDB29AD9FB600897924 /* ComPDFKit_Conversion.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		EC6D603A29AC598600FB0D56 /* ConverFilePlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC6D603929AC598600FB0D56 /* ConverFilePlugin.swift */; };
-		EC6D603C29AC5EC200FB0D56 /* ConvertUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC6D603B29AC5EC200FB0D56 /* ConvertUtil.swift */; };
-		EC6D603E29AC772B00FB0D56 /* ConvertType.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC6D603D29AC772B00FB0D56 /* ConvertType.swift */; };
-		ECB9C7DF29AC3A3D00FCAC3F /* ConversionSDKInfoPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB9C7DE29AC3A3D00FCAC3F /* ConversionSDKInfoPlugin.swift */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
-		EC6D603829AC580900FB0D56 /* Embed Frameworks */ = {
+		9705A1C41CF9048500538489 /* Embed Frameworks */ = {
 			isa = PBXCopyFilesBuildPhase;
 			buildActionMask = 2147483647;
 			dstPath = "";
 			dstSubfolderSpec = 10;
 			files = (
-				EC44ADDE29ADA0C800897924 /* ComPDFKit_Conversion.framework in Embed Frameworks */,
 			);
 			name = "Embed Frameworks";
 			runOnlyForDeploymentPostprocessing = 0;
@@ -38,14 +30,11 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
-		059E20BC1E428EEB5CDC6568 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
 		1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
-		2D01BD4E557C05A8D5B08EE5 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
 		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
-		4FF2BE9D29C161D00088AD17 /* ConvertDefine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvertDefine.swift; sourceTree = "<group>"; };
-		50B8585759C13AC272A61A9D /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
-		633A684658B71F515E893868 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
+		457F91DDF34DE3DD004C4CE0 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
+		573553D16448AB946CF2319F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
 		74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
 		74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -56,11 +45,8 @@
 		97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-		EC44ADDB29AD9FB600897924 /* ComPDFKit_Conversion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ComPDFKit_Conversion.framework; sourceTree = "<group>"; };
-		EC6D603929AC598600FB0D56 /* ConverFilePlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConverFilePlugin.swift; sourceTree = "<group>"; };
-		EC6D603B29AC5EC200FB0D56 /* ConvertUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvertUtil.swift; sourceTree = "<group>"; };
-		EC6D603D29AC772B00FB0D56 /* ConvertType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvertType.swift; sourceTree = "<group>"; };
-		ECB9C7DE29AC3A3D00FCAC3F /* ConversionSDKInfoPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversionSDKInfoPlugin.swift; sourceTree = "<group>"; };
+		DB4FD1BF0DA67929BF7F74DB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		E455F42CFCDD0FC2DC218C4F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -68,18 +54,28 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				EC44ADDD29ADA0C800897924 /* ComPDFKit_Conversion.framework in Frameworks */,
-				213CDB98C21625DCD1162CCC /* Pods_Runner.framework in Frameworks */,
+				294858E9082334C8009F9D5B /* Pods_Runner.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
-		66B65B34F846DA13528D227B /* Frameworks */ = {
+		3BA9AD2018DC0D30DE27D6FB /* Pods */ = {
 			isa = PBXGroup;
 			children = (
-				059E20BC1E428EEB5CDC6568 /* Pods_Runner.framework */,
+				457F91DDF34DE3DD004C4CE0 /* Pods-Runner.debug.xcconfig */,
+				E455F42CFCDD0FC2DC218C4F /* Pods-Runner.release.xcconfig */,
+				573553D16448AB946CF2319F /* Pods-Runner.profile.xcconfig */,
+			);
+			name = Pods;
+			path = Pods;
+			sourceTree = "<group>";
+		};
+		6B67069484B952E8FD4477D2 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				DB4FD1BF0DA67929BF7F74DB /* Pods_Runner.framework */,
 			);
 			name = Frameworks;
 			sourceTree = "<group>";
@@ -101,8 +97,8 @@
 				9740EEB11CF90186004384FC /* Flutter */,
 				97C146F01CF9000F007C117D /* Runner */,
 				97C146EF1CF9000F007C117D /* Products */,
-				ACC0A6894496D2B2A7FA3A96 /* Pods */,
-				66B65B34F846DA13528D227B /* Frameworks */,
+				3BA9AD2018DC0D30DE27D6FB /* Pods */,
+				6B67069484B952E8FD4477D2 /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -117,7 +113,6 @@
 		97C146F01CF9000F007C117D /* Runner */ = {
 			isa = PBXGroup;
 			children = (
-				EC44ADDB29AD9FB600897924 /* ComPDFKit_Conversion.framework */,
 				97C146FA1CF9000F007C117D /* Main.storyboard */,
 				97C146FD1CF9000F007C117D /* Assets.xcassets */,
 				97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@@ -126,25 +121,10 @@
 				1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
 				74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
 				74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
-				ECB9C7DE29AC3A3D00FCAC3F /* ConversionSDKInfoPlugin.swift */,
-				EC6D603929AC598600FB0D56 /* ConverFilePlugin.swift */,
-				EC6D603B29AC5EC200FB0D56 /* ConvertUtil.swift */,
-				EC6D603D29AC772B00FB0D56 /* ConvertType.swift */,
-				4FF2BE9D29C161D00088AD17 /* ConvertDefine.swift */,
 			);
 			path = Runner;
 			sourceTree = "<group>";
 		};
-		ACC0A6894496D2B2A7FA3A96 /* Pods */ = {
-			isa = PBXGroup;
-			children = (
-				2D01BD4E557C05A8D5B08EE5 /* Pods-Runner.debug.xcconfig */,
-				633A684658B71F515E893868 /* Pods-Runner.release.xcconfig */,
-				50B8585759C13AC272A61A9D /* Pods-Runner.profile.xcconfig */,
-			);
-			path = Pods;
-			sourceTree = "<group>";
-		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -152,14 +132,14 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
 			buildPhases = (
-				5A5835082C08C78DF9A97685 /* [CP] Check Pods Manifest.lock */,
+				D64A38EC783D7A68F7888D3A /* [CP] Check Pods Manifest.lock */,
 				9740EEB61CF901F6004384FC /* Run Script */,
 				97C146EA1CF9000F007C117D /* Sources */,
 				97C146EB1CF9000F007C117D /* Frameworks */,
 				97C146EC1CF9000F007C117D /* Resources */,
+				9705A1C41CF9048500538489 /* Embed Frameworks */,
 				3B06AD1E1E4923F5004D2608 /* Thin Binary */,
-				CEA91C2E89EAD5965A4C6095 /* [CP] Embed Pods Frameworks */,
-				EC6D603829AC580900FB0D56 /* Embed Frameworks */,
+				9E64BD125A1F22FFC94D8917 /* [CP] Embed Pods Frameworks */,
 			);
 			buildRules = (
 			);
@@ -225,7 +205,6 @@
 			files = (
 			);
 			inputPaths = (
-				"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
 			);
 			name = "Thin Binary";
 			outputPaths = (
@@ -234,58 +213,58 @@
 			shellPath = /bin/sh;
 			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
 		};
-		5A5835082C08C78DF9A97685 /* [CP] Check Pods Manifest.lock */ = {
+		9740EEB61CF901F6004384FC /* Run Script */ = {
 			isa = PBXShellScriptBuildPhase;
+			alwaysOutOfDate = 1;
 			buildActionMask = 2147483647;
 			files = (
 			);
-			inputFileListPaths = (
-			);
 			inputPaths = (
-				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
-				"${PODS_ROOT}/Manifest.lock",
-			);
-			name = "[CP] Check Pods Manifest.lock";
-			outputFileListPaths = (
 			);
+			name = "Run Script";
 			outputPaths = (
-				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
-			showEnvVarsInLog = 0;
+			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
 		};
-		9740EEB61CF901F6004384FC /* Run Script */ = {
+		9E64BD125A1F22FFC94D8917 /* [CP] Embed Pods Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
-			alwaysOutOfDate = 1;
 			buildActionMask = 2147483647;
 			files = (
 			);
-			inputPaths = (
+			inputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
 			);
-			name = "Run Script";
-			outputPaths = (
+			name = "[CP] Embed Pods Frameworks";
+			outputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+			showEnvVarsInLog = 0;
 		};
-		CEA91C2E89EAD5965A4C6095 /* [CP] Embed Pods Frameworks */ = {
+		D64A38EC783D7A68F7888D3A /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
 			);
-			name = "[CP] Embed Pods Frameworks";
+			inputPaths = (
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+				"${PODS_ROOT}/Manifest.lock",
+			);
+			name = "[CP] Check Pods Manifest.lock";
 			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+			);
+			outputPaths = (
+				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
 			showEnvVarsInLog = 0;
 		};
 /* End PBXShellScriptBuildPhase section */
@@ -295,13 +274,8 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				ECB9C7DF29AC3A3D00FCAC3F /* ConversionSDKInfoPlugin.swift in Sources */,
-				EC6D603A29AC598600FB0D56 /* ConverFilePlugin.swift in Sources */,
 				74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
-				EC6D603C29AC5EC200FB0D56 /* ConvertUtil.swift in Sources */,
 				1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
-				EC6D603E29AC772B00FB0D56 /* ConvertType.swift in Sources */,
-				4FF2BE9E29C161D00088AD17 /* ConvertDefine.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -383,27 +357,18 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
-				CODE_SIGN_IDENTITY = "Apple Development";
-				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
 				ENABLE_BITCODE = NO;
-				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"$(PROJECT_DIR)/Runner",
-				);
 				INFOPLIST_FILE = Runner/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.conversion.flutter;
+				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.conversion.flutter.kmpdfkitConversionFlutterExample;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
-				VALIDATE_PRODUCT = YES;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Profile;
@@ -521,28 +486,19 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
-				CODE_SIGN_IDENTITY = "Apple Development";
-				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
 				ENABLE_BITCODE = NO;
-				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"$(PROJECT_DIR)/Runner",
-				);
 				INFOPLIST_FILE = Runner/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.conversion.flutter;
+				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.conversion.flutter.kmpdfkitConversionFlutterExample;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 				SWIFT_VERSION = 5.0;
-				VALIDATE_PRODUCT = YES;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Debug;
@@ -553,27 +509,18 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
-				CODE_SIGN_IDENTITY = "Apple Development";
-				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
 				ENABLE_BITCODE = NO;
-				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"$(PROJECT_DIR)/Runner",
-				);
 				INFOPLIST_FILE = Runner/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.conversion.flutter;
+				PRODUCT_BUNDLE_IDENTIFIER = com.compdfkit.conversion.flutter.kmpdfkitConversionFlutterExample;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
-				VALIDATE_PRODUCT = YES;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Release;

ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata → example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata


ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist → example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist


ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings → example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings


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


ios/Runner.xcworkspace/contents.xcworkspacedata → example/ios/Runner.xcworkspace/contents.xcworkspacedata


ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist → example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist


ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings → example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings


+ 13 - 0
example/ios/Runner/AppDelegate.swift

@@ -0,0 +1,13 @@
+import UIKit
+import Flutter
+
+@UIApplicationMain
+@objc class AppDelegate: FlutterAppDelegate {
+  override func application(
+    _ application: UIApplication,
+    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+  ) -> Bool {
+    GeneratedPluginRegistrant.register(with: self)
+    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+  }
+}

ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png


ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png → example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png


ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json → example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json


ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png → example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png


ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png → example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png


ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png → example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png


ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md → example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md


ios/Runner/Base.lproj/LaunchScreen.storyboard → example/ios/Runner/Base.lproj/LaunchScreen.storyboard


+ 3 - 3
ios/Runner/Base.lproj/Main.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
     <device id="retina6_12" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
@@ -23,7 +23,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="139" y="-2"/>
+            <point key="canvasLocation" x="-16" y="-41"/>
         </scene>
     </scenes>
 </document>

+ 11 - 11
ios/Runner/Info.plist

@@ -2,12 +2,10 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>CADisableMinimumFrameDurationOnPhone</key>
-	<true/>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
 	<key>CFBundleDisplayName</key>
-	<string>Kmpdfkit Demo</string>
+	<string>Kmpdfkit Conversion Flutter</string>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
@@ -15,7 +13,7 @@
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>kmpdfkit_demo</string>
+	<string>kmpdfkit_conversion_flutter_example</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
@@ -26,18 +24,16 @@
 	<string>$(FLUTTER_BUILD_NUMBER)</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
-	<key>UIApplicationSupportsIndirectInputEvents</key>
-	<true/>
 	<key>UILaunchStoryboardName</key>
 	<string>LaunchScreen</string>
 	<key>UIMainStoryboardFile</key>
 	<string>Main</string>
 	<key>UISupportedInterfaceOrientations</key>
-	<array/>
-	<key>UIFileSharingEnabled</key>
-	<true/>
-	<key>LSSupportsOpeningDocumentsInPlace</key>
-	<true/>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationLandscapeLeft</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
 	<key>UISupportedInterfaceOrientations~ipad</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>
@@ -47,5 +43,9 @@
 	</array>
 	<key>UIViewControllerBasedStatusBarAppearance</key>
 	<false/>
+	<key>CADisableMinimumFrameDurationOnPhone</key>
+	<true/>
+	<key>UIApplicationSupportsIndirectInputEvents</key>
+	<true/>
 </dict>
 </plist>

+ 1 - 0
example/ios/Runner/Runner-Bridging-Header.h

@@ -0,0 +1 @@
+#import "GeneratedPluginRegistrant.h"

+ 9 - 8
lib/main.dart

@@ -1,15 +1,16 @@
-import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
-import 'package:ConversionFlutterDemo/states/convert_provider.dart';
-import 'package:ConversionFlutterDemo/widgets/conversion_sdk_info_widget.dart';
-import 'package:ConversionFlutterDemo/widgets/convert_config.dart';
-import 'package:ConversionFlutterDemo/widgets/convert_list_widget.dart';
 import 'package:flutter/material.dart';
+import 'package:kmpdfkit_conversion_flutter_example/states/convert_options_provider.dart';
+import 'package:kmpdfkit_conversion_flutter_example/states/convert_provider.dart';
+import 'package:kmpdfkit_conversion_flutter_example/widgets/conversion_sdk_info_widget.dart';
+import 'package:kmpdfkit_conversion_flutter_example/widgets/convert_options_widget.dart';
+import 'package:kmpdfkit_conversion_flutter_example/widgets/convert_list_widget.dart';
+
 import 'package:provider/provider.dart';
 
 void main() {
   runApp(MultiProvider(
     providers: [
-      ChangeNotifierProvider(create: (_) => ConvertProvider()),
+      ChangeNotifierProvider(create: (_) => ConvertTaskQueueProvider()),
       ChangeNotifierProvider(create: (_) => ConvertOptionsProvider())
     ],
     child: const MyApp(),
@@ -47,7 +48,7 @@ class _MyHomePageState extends State<MyHomePage> {
           title: Text(widget.title),
         ),
         body: Padding(
-          padding: EdgeInsets.all(8),
+          padding: const EdgeInsets.all(8),
           child: Column(
             crossAxisAlignment: CrossAxisAlignment.start,
             children: const <Widget>[
@@ -58,4 +59,4 @@ class _MyHomePageState extends State<MyHomePage> {
           ),
         ));
   }
-}
+}

+ 45 - 0
example/lib/models/convert_task.dart

@@ -0,0 +1,45 @@
+///  convert_bean.dart
+///
+///  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+///
+///  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+///  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+///  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+///  This notice may not be removed from this file.
+
+import 'package:kmpdfkit_conversion_flutter/models/convert_status.dart';
+import 'package:kmpdfkit_conversion_flutter/models/convert_type.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/options.dart';
+
+
+/// convert task data
+class ConvertTask {
+
+  String taskId;
+
+  String filePath;
+
+  String fileName;
+
+  int progress;
+
+  ConvertType convertType;
+
+  TaskStatus status;
+
+  String? outputPath;
+
+  Options options;
+
+  ConvertTask({
+    required this.taskId,
+    required this.fileName,
+    required this.filePath,
+    required this.convertType,
+    required this.status,
+    required this.progress,
+    required this.options,
+    this.outputPath,
+  });
+
+}

+ 34 - 30
lib/states/convert_options_provider.dart

@@ -1,8 +1,3 @@
-import 'package:ConversionFlutterDemo/models/convert_contain_options_bean.dart';
-import 'package:ConversionFlutterDemo/models/convert_type.dart';
-import 'package:ConversionFlutterDemo/widgets/options/convert_excel_options_widget.dart';
-import 'package:flutter/material.dart';
-
 ///  convert_options_provider.dart
 ///
 ///  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
@@ -11,40 +6,51 @@ import 'package:flutter/material.dart';
 ///  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
 ///  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
 ///  This notice may not be removed from this file.
-///
+
+import 'package:flutter/material.dart';
+import 'package:kmpdfkit_conversion_flutter/models/convert_type.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_csv_options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_excel_options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_html_options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_image_options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_ppt_options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_rtf_options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_txt_options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_word_options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/options.dart';
+
 ///record convert format options
 class ConvertOptionsProvider extends ChangeNotifier {
   ConvertType convertType = ConvertType.none;
 
-  ConvertOptionsBean pptOptions =
-      ConvertOptionsBean(containImages: true, containAnnotations: true);
+  ConvertPPTOptions pptOptions =
+      ConvertPPTOptions(containImages: true, containAnnotations: true);
 
-  ConvertOptionsBean wordOptions =
-      ConvertOptionsBean(containImages: true, containAnnotations: true);
+  ConvertWordOptions wordOptions =
+      ConvertWordOptions(containImages: true, containAnnotations: true);
 
-  ConvertOptionsBean excelOptions = ConvertOptionsBean(
+  ConvertExcelOptions excelOptions = ConvertExcelOptions(
       containImages: true,
       containAnnotations: false,
-      workSheetOptions: ExcelWorkSheetOptions.ForEachPage,
-      contentOptions: ContentOptions.AllContent);
+      workSheetOptions: ExcelWorkSheetOptions.forEachPage,
+      contentOptions: ExcelContentOptions.allContent);
 
-  ConvertOptionsBean imageOptions = ConvertOptionsBean(
-      containImages: true,
+  ConvertImageOptions imageOptions = ConvertImageOptions(
       containAnnotations: true,
       imageDpi: 300,
-      imagePageOptions: ImagePageOptions.PNG);
+      imagePageOptions: ImagePageOptions.png);
 
-  ConvertOptionsBean csvOptions = ConvertOptionsBean(mergeCSV: false);
+  ConvertCSVOptions csvOptions = ConvertCSVOptions(mergeCSV: false);
 
-  ConvertOptionsBean rtfOptions =
-      ConvertOptionsBean(containImages: true, containAnnotations: true);
+  ConvertRTFOptions rtfOptions =
+      ConvertRTFOptions(containImages: true, containAnnotations: true);
 
-  ConvertOptionsBean htmlOptions = ConvertOptionsBean(
+  ConvertHTMLOptions htmlOptions = ConvertHTMLOptions(
       containImages: true,
       containAnnotations: false,
-      htmlPageOptions: HtmlPageOptions.SinglePage);
+      htmlPageOptions: HtmlPageOptions.singlePage);
 
-  ConvertOptionsBean getOptions() {
+  Options getOptions() {
     switch (convertType) {
       case ConvertType.ppt:
         return pptOptions;
@@ -61,7 +67,7 @@ class ConvertOptionsProvider extends ChangeNotifier {
       case ConvertType.html:
         return htmlOptions;
       default:
-        return ConvertOptionsBean();
+        return ConvertTXTOptions();
     }
   }
 
@@ -94,7 +100,7 @@ class ConvertOptionsProvider extends ChangeNotifier {
       {bool? containImages,
       bool? containAnnotations,
       ExcelWorkSheetOptions? workSheetOptions,
-      ContentOptions? contentOptions}) {
+      ExcelContentOptions? contentOptions}) {
     if (containImages != null) {
       excelOptions.containImages = containImages;
     }
@@ -111,13 +117,9 @@ class ConvertOptionsProvider extends ChangeNotifier {
   }
 
   void changeImageOptions(
-      {bool? containImages,
-      bool? containAnnotations,
+      {bool? containAnnotations,
       int? imageDpi,
       ImagePageOptions? imagePageOptions}) {
-    if (containImages != null) {
-      imageOptions.containImages = containImages;
-    }
     if (containAnnotations != null) {
       imageOptions.containAnnotations = containAnnotations;
     }
@@ -145,7 +147,9 @@ class ConvertOptionsProvider extends ChangeNotifier {
     notifyListeners();
   }
 
-  void changeHtmlOptions({bool? containImages, bool? containAnnotations,
+  void changeHtmlOptions(
+      {bool? containImages,
+      bool? containAnnotations,
       HtmlPageOptions? htmlPageOptions}) {
     if (containImages != null) {
       htmlOptions.containImages = containImages;

+ 113 - 0
example/lib/states/convert_provider.dart

@@ -0,0 +1,113 @@
+///  convert_provider.dart
+///  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+///
+///  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+///  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+///  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+///  This notice may not be removed from this file.
+
+import 'package:flutter/material.dart';
+import 'package:kmpdfkit_conversion_flutter/cpdf_converter.dart';
+import 'package:kmpdfkit_conversion_flutter/models/convert_status.dart';
+import 'package:kmpdfkit_conversion_flutter/models/convert_type.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/options.dart';
+import 'package:kmpdfkit_conversion_flutter/models/task_result.dart';
+import 'package:kmpdfkit_conversion_flutter/util/string_extensions.dart';
+import 'package:path/path.dart';
+import 'package:uuid/uuid.dart';
+
+import '../models/convert_task.dart';
+
+class ConvertTaskQueueProvider extends ChangeNotifier {
+  final List<ConvertTask> _taskQueue = [];
+
+  List<ConvertTask> get taskQueue => _taskQueue;
+
+  bool _isExecuting = false;
+
+  bool autoTask = true;
+
+  void addTask(ConvertType convertType, Options options, List<String> files) {
+    if (files.isEmpty) {
+      conversionLog("pdf files is empty");
+      return;
+    }
+    for (var i = 0; i < files.length; i++) {
+      String? path = files[i];
+      var taskId = const Uuid().v4();
+      ConvertTask task = ConvertTask(
+          taskId: taskId,
+          filePath: path,
+          fileName: basenameWithoutExtension(path),
+          convertType: convertType,
+          status: TaskStatus.wait,
+          progress: 0,
+          options: options);
+      _taskQueue.add(task);
+      conversionLog("The task has been added to the queue");
+    }
+
+    if (!_isExecuting && autoTask) {
+      conversionLog("There is no task in progress, and the conversion task is started");
+      executeNextTask();
+    }
+    notifyListeners();
+  }
+
+  void executeNextTask() {
+    ConvertTask? nextTask = getNextTask();
+    if (nextTask != null) {
+      conversionLog("The waiting task in the queue is not empty, and the file transfer is started");
+      startTask(nextTask);
+    }else{
+      conversionLog("There is no waiting transfer task in the queue, and the task ends");
+    }
+  }
+
+  void startTask(ConvertTask task) {
+    _isExecuting = true;
+    CPDFConverter.convert(
+        taskId: task.taskId,
+        filePath: task.filePath,
+        convertType: task.convertType,
+        options: task.options,
+        callback: (TaskResult result) {
+          conversionLog(
+              "converting : taskId:${result.taskId}--progress:${result.progress}, status:${result.taskStatus}");
+          updateStatus(result.taskId, result.progress, result.taskStatus,
+              result.outPutPath);
+          if (result.taskStatus == TaskStatus.success ||
+              result.taskStatus == TaskStatus.fail) {
+            conversionLog("convert:${result.taskStatus.name}, start the next task");
+            _isExecuting = false;
+            if(autoTask){
+              executeNextTask();
+            }
+          }
+        });
+  }
+
+  void updateStatus(
+      String taskId, int progress, TaskStatus status, String? outputPath) {
+    ConvertTask bean =
+        _taskQueue.firstWhere((element) => element.taskId == taskId);
+    bean
+      ..status = status
+      ..progress = progress
+      ..outputPath = outputPath;
+    notifyListeners();
+  }
+
+  ConvertTask? getNextTask() {
+    try {
+      if (_taskQueue.any((element) => element.status == TaskStatus.wait)) {
+        return _taskQueue
+            .firstWhere((element) => element.status == TaskStatus.wait);
+      } else {
+        return null;
+      }
+    } catch (e) {
+      return null;
+    }
+  }
+}

+ 13 - 5
lib/widgets/conversion_sdk_info_widget.dart

@@ -1,6 +1,5 @@
-import 'package:ConversionFlutterDemo/convert_sdk_info_flutter.dart';
 import 'package:flutter/material.dart';
-
+import 'package:kmpdfkit_conversion_flutter/cpdf_converter.dart';
 
 ///  conversion_sdk_info_widget.dart
 ///
@@ -27,13 +26,13 @@ class _ConversionSdkInfoWidgetState extends State<ConversionSdkInfoWidget> {
   void initState() {
     super.initState();
 
-    ConvertSDKInfoFlutter.getConversionSDKVersion().then((value) {
+    CPDFConverter.getSDKBuildTag().then((value) {
       setState(() {
         conversionSDKVersion = "Version:$value";
       });
     });
 
-    ConvertSDKInfoFlutter.getOutputPath().then((value) => {
+    CPDFConverter.getOutputPath().then((value) => {
           setState(() {
             convertFileOutputPath = value;
           })
@@ -44,7 +43,16 @@ class _ConversionSdkInfoWidgetState extends State<ConversionSdkInfoWidget> {
   Widget build(BuildContext context) {
     return Column(
       crossAxisAlignment: CrossAxisAlignment.start,
-      children: [Text(conversionSDKVersion,style: TextStyle(fontSize: 13),), Text('OutputPath:$convertFileOutputPath',style: const TextStyle(fontSize: 13),)],
+      children: [
+        Text(
+          conversionSDKVersion,
+          style: const TextStyle(fontSize: 13),
+        ),
+        Text(
+          'OutputPath:$convertFileOutputPath',
+          style: const TextStyle(fontSize: 13),
+        )
+      ],
     );
   }
 }

+ 105 - 0
example/lib/widgets/convert_list_widget.dart

@@ -0,0 +1,105 @@
+import 'package:flutter/material.dart';
+import 'package:kmpdfkit_conversion_flutter/cpdf_converter.dart';
+import 'package:kmpdfkit_conversion_flutter/models/convert_status.dart';
+import 'package:open_file/open_file.dart';
+import 'package:provider/provider.dart';
+
+import '../models/convert_task.dart';
+import '../states/convert_provider.dart';
+
+///  convert_list_widget.dart
+///  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+///
+///  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+///  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+///  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+///  This notice may not be removed from this file.
+
+class ConvertListWidget extends StatefulWidget {
+  const ConvertListWidget({Key? key}) : super(key: key);
+
+  @override
+  State<ConvertListWidget> createState() => _ConvertListWidgetState();
+}
+
+class _ConvertListWidgetState extends State<ConvertListWidget> {
+  @override
+  Widget build(BuildContext context) {
+    var count = context.select<ConvertTaskQueueProvider, int>(
+        (value) => value.taskQueue.length);
+    return ListView.builder(
+      itemCount: count,
+      primary: true,
+      shrinkWrap: true,
+      physics: const ClampingScrollPhysics(),
+      itemBuilder: (BuildContext context, int index) {
+        //设置子条目
+        return Builder(builder: (context) {
+          ConvertTask bean =
+              context.select<ConvertTaskQueueProvider, ConvertTask>(
+                  (value) => value.taskQueue[index]);
+          context.select<ConvertTaskQueueProvider, int>(
+              (value) => value.taskQueue[index].progress);
+          TaskStatus status =
+              context.select<ConvertTaskQueueProvider, TaskStatus>(
+                  (value) => value.taskQueue[index].status);
+          return Column(
+            children: [
+              ListTile(
+                isThreeLine: true,
+                title: Text(
+                  bean.fileName,
+                  style: const TextStyle(fontSize: 18),
+                ),
+                subtitle: Text(
+                  "PDF convert ${bean.convertType.name.toUpperCase()} ${bean.outputPath != null ? "\n${bean.outputPath}" : ''}",
+                  style: const TextStyle(fontSize: 12),
+                ),
+                trailing: Text(getStatusName(bean)),
+                // item 直观感受是整体大小
+                contentPadding:
+                    const EdgeInsets.symmetric(horizontal: 12, vertical: 2),
+                onTap: () async {
+                  if (status == TaskStatus.success) {
+                    OpenFile.open(bean.outputPath);
+                  }
+                },
+              ),
+              Row(
+                children: [
+                  ElevatedButton(onPressed: () {
+                    CPDFConverter.cancelTask();
+                  }, child: Text("取消任务")),
+                  ElevatedButton(onPressed: () {
+                    context
+                        .read<ConvertTaskQueueProvider>()
+                        .startTask(bean);
+                  }, child: Text("开始任务"))
+                ],
+              )
+            ],
+          );
+        });
+      },
+    );
+  }
+
+  String getStatusName(ConvertTask task) {
+    switch (task.status) {
+      case TaskStatus.wait:
+        return "Waiting";
+      case TaskStatus.start:
+        return "Start";
+      case TaskStatus.converting:
+        return "Converting (${task.progress}%)";
+      case TaskStatus.success:
+        return "SUCCESS";
+      case TaskStatus.fail:
+        return "FAIL";
+      case TaskStatus.cancel:
+        return "task canceled";
+      default:
+        return "";
+    }
+  }
+}

+ 26 - 24
lib/widgets/convert_config.dart

@@ -1,21 +1,21 @@
-import 'package:ConversionFlutterDemo/models/convert_contain_options_bean.dart';
-import 'package:ConversionFlutterDemo/models/convert_type.dart';
-import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
-import 'package:ConversionFlutterDemo/widgets/options/convert_csv_options_widget.dart';
-import 'package:ConversionFlutterDemo/widgets/options/convert_excel_options_widget.dart';
-import 'package:ConversionFlutterDemo/widgets/options/convert_html_options_widget.dart';
-import 'package:ConversionFlutterDemo/widgets/options/convert_image_options_widget.dart';
-import 'package:ConversionFlutterDemo/widgets/options/convert_ppt_options_widget.dart';
-import 'package:ConversionFlutterDemo/widgets/options/convert_rtf_options_widget.dart';
-import 'package:ConversionFlutterDemo/widgets/options/convert_word_options_widget.dart';
 import 'package:file_picker/file_picker.dart';
 import 'package:flutter/material.dart';
+import 'package:kmpdfkit_conversion_flutter/models/convert_type.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/options.dart';
 import 'package:permission_handler/permission_handler.dart';
 import 'package:provider/provider.dart';
 
+import '../states/convert_options_provider.dart';
 import '../states/convert_provider.dart';
+import 'options/convert_csv_options_widget.dart';
+import 'options/convert_excel_options_widget.dart';
+import 'options/convert_html_options_widget.dart';
+import 'options/convert_image_options_widget.dart';
+import 'options/convert_ppt_options_widget.dart';
+import 'options/convert_rtf_options_widget.dart';
+import 'options/convert_word_options_widget.dart';
 
-///  convert_config.dart
+///  convert_options_widget.dart
 ///
 ///  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 ///
@@ -66,11 +66,17 @@ class _ConvertConfigWidgetState extends State<ConvertConfigWidget> {
         SizedBox(
             width: double.infinity,
             child: ElevatedButton(
-                onPressed: () {
+                onPressed: () async {
                   ConvertType convertType =
                       context.read<ConvertOptionsProvider>().convertType;
                   if (convertType != ConvertType.none) {
-                    getPDFFileList(context);
+                    Options options =
+                        context.read<ConvertOptionsProvider>().getOptions();
+
+                    List<String> files = await getPDFFileList(context);
+                    context
+                        .read<ConvertTaskQueueProvider>()
+                        .addTask(convertType, options, files);
                   }
                 },
                 child: const Text('Convert')))
@@ -85,24 +91,20 @@ class _ConvertConfigWidgetState extends State<ConvertConfigWidget> {
   }
 
   ///Select pdf files from android\ios using 'file_picker'
-  void getPDFFileList(BuildContext context) async {
+  Future<List<String>> getPDFFileList(BuildContext context) async {
     bool isGranted = await getPermission();
     if (!isGranted) {
-      return;
+      return List.empty();
     }
     FilePickerResult? result = await FilePicker.platform.pickFiles(
         type: FileType.custom, allowedExtensions: ['pdf'], allowMultiple: true);
     if (result != null) {
       List<String?> pdfFiles = result.paths;
-
-      ConvertOptionsBean options =
-          context.read<ConvertOptionsProvider>().getOptions();
-      ConvertType convertType =
-          context.read<ConvertOptionsProvider>().convertType;
-      context
-          .read<ConvertProvider>()
-          .addConvertData(context, convertType, options, pdfFiles);
-    } else {}
+      var files = pdfFiles.where((element) => element != null);
+      return List.from(files);
+    } else {
+      return List.empty();
+    }
   }
 
   void _showConvertOptionsModalBottomSheet(context, ConvertType convertType) {

+ 3 - 2
lib/widgets/options/convert_csv_options_widget.dart

@@ -1,7 +1,8 @@
-import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
 import 'package:flutter/material.dart';
 import 'package:provider/provider.dart';
 
+import '../../states/convert_options_provider.dart';
+
 
 
 ///  convert_csv_options_widget.dart
@@ -27,7 +28,7 @@ class _ConvertCSVOptionsWidgetState extends State<ConvertCSVOptionsWidget> {
     bool mergeCSV = context.select<ConvertOptionsProvider, bool>(
         (value) => value.csvOptions.mergeCSV);
     return Padding(
-        padding: EdgeInsets.all(8),
+        padding: const EdgeInsets.all(8),
         child: Column(
           mainAxisSize: MainAxisSize.min,
           children: [

+ 16 - 15
lib/widgets/options/convert_excel_options_widget.dart

@@ -1,8 +1,9 @@
-import 'package:ConversionFlutterDemo/models/convert_contain_options_bean.dart';
-import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
 import 'package:flutter/material.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_excel_options.dart';
 import 'package:provider/provider.dart';
 
+import '../../states/convert_options_provider.dart';
+
 
 ///  convert_excel_options_widget.dart
 ///
@@ -30,7 +31,7 @@ class _ConvertExcelOptionsWidgetState extends State<ConvertExcelOptionsWidget> {
         (value) => value.excelOptions.containAnnotations);
 
     return SingleChildScrollView(child: Padding(
-        padding: EdgeInsets.all(8),
+        padding: const EdgeInsets.all(8),
         child: Column(
           crossAxisAlignment: CrossAxisAlignment.start,
           children: [
@@ -83,11 +84,11 @@ class _ConvertExcelOptionsWidgetState extends State<ConvertExcelOptionsWidget> {
       children: [
         Text('WorkSheetOptions:'),
         _excelWorkSheetOptionsItem(
-            workSheetOptions, ExcelWorkSheetOptions.ForEachTable, onChanged),
+            workSheetOptions, ExcelWorkSheetOptions.forEachTable, onChanged),
         _excelWorkSheetOptionsItem(
-            workSheetOptions, ExcelWorkSheetOptions.ForEachPage, onChanged),
+            workSheetOptions, ExcelWorkSheetOptions.forEachPage, onChanged),
         _excelWorkSheetOptionsItem(
-            workSheetOptions, ExcelWorkSheetOptions.ForTheDocument, onChanged),
+            workSheetOptions, ExcelWorkSheetOptions.forTheDocument, onChanged),
       ],
     );
   }
@@ -105,26 +106,26 @@ class _ConvertExcelOptionsWidgetState extends State<ConvertExcelOptionsWidget> {
         });
   }
 
-  Widget excelContentOptions(ValueChanged<ContentOptions> onChanged) {
-    ContentOptions contentOptions =
-        context.select<ConvertOptionsProvider, ContentOptions>(
+  Widget excelContentOptions(ValueChanged<ExcelContentOptions> onChanged) {
+    ExcelContentOptions contentOptions =
+        context.select<ConvertOptionsProvider, ExcelContentOptions>(
             (value) => value.excelOptions.contentOptions);
     return Column(
       crossAxisAlignment: CrossAxisAlignment.start,
       children: [
-        Text('ContentOptions:'),
+        const Text('ContentOptions:'),
         _excelContentOptionsItem(
-            contentOptions, ContentOptions.OnlyText, onChanged),
+            contentOptions, ExcelContentOptions.onlyText, onChanged),
         _excelContentOptionsItem(
-            contentOptions, ContentOptions.OnlyTable, onChanged),
+            contentOptions, ExcelContentOptions.onlyTable, onChanged),
         _excelContentOptionsItem(
-            contentOptions, ContentOptions.AllContent, onChanged),
+            contentOptions, ExcelContentOptions.allContent, onChanged),
       ],
     );
   }
 
-  Widget _excelContentOptionsItem(ContentOptions currentOptions,
-      ContentOptions options, ValueChanged<ContentOptions> onChanged) {
+  Widget _excelContentOptionsItem(ExcelContentOptions currentOptions,
+      ExcelContentOptions options, ValueChanged<ExcelContentOptions> onChanged) {
     return CheckboxListTile(
         controlAffinity: ListTileControlAffinity.leading,
         title: Text(options.name),

+ 9 - 8
lib/widgets/options/convert_html_options_widget.dart

@@ -1,8 +1,9 @@
-import 'package:ConversionFlutterDemo/models/convert_contain_options_bean.dart';
-import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
 import 'package:flutter/material.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_html_options.dart';
 import 'package:provider/provider.dart';
 
+import '../../states/convert_options_provider.dart';
+
 ///  convert_html_options_widget.dart
 ///
 ///  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
@@ -28,7 +29,7 @@ class _ConvertHtmlOptionsWidgetState extends State<ConvertHtmlOptionsWidget> {
     bool containAnnotations = context.select<ConvertOptionsProvider, bool>(
         (value) => value.htmlOptions.containAnnotations);
     return Padding(
-        padding: EdgeInsets.all(8),
+        padding: const EdgeInsets.all(8),
         child: Column(
           mainAxisSize: MainAxisSize.min,
           children: [
@@ -74,15 +75,15 @@ class _ConvertHtmlOptionsWidgetState extends State<ConvertHtmlOptionsWidget> {
     return Column(
       crossAxisAlignment: CrossAxisAlignment.start,
       children: [
-        Text('Page Options:'),
+        const Text('Page Options:'),
         _htmlPageOptionsItem(
-            contentOptions, HtmlPageOptions.SinglePage, onChanged),
+            contentOptions, HtmlPageOptions.singlePage, onChanged),
         _htmlPageOptionsItem(contentOptions,
-            HtmlPageOptions.SinglePageNavigationByBookmark, onChanged),
+            HtmlPageOptions.singlePageNavigationByBookmark, onChanged),
         _htmlPageOptionsItem(
-            contentOptions, HtmlPageOptions.MultiplePages, onChanged),
+            contentOptions, HtmlPageOptions.multiplePages, onChanged),
         _htmlPageOptionsItem(contentOptions,
-            HtmlPageOptions.MultiplePagesSplitByBookmarks, onChanged),
+            HtmlPageOptions.multiplePagesSplitByBookmarks, onChanged),
       ],
     );
   }

+ 6 - 6
lib/widgets/options/convert_image_options_widget.dart

@@ -1,6 +1,6 @@
-import 'package:ConversionFlutterDemo/models/convert_contain_options_bean.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
+import 'package:kmpdfkit_conversion_flutter/models/options/convert_image_options.dart';
 import 'package:provider/provider.dart';
 
 import '../../states/convert_options_provider.dart';
@@ -46,7 +46,7 @@ class _ConvertImageOptionsWidgetState extends State<ConvertImageOptionsWidget> {
                   })
             ],
           ),
-          Text('ImageDpi:'),
+          const Text('ImageDpi:'),
           TextFormField(
             keyboardType: TextInputType.number,
             textInputAction: TextInputAction.done,
@@ -58,7 +58,7 @@ class _ConvertImageOptionsWidgetState extends State<ConvertImageOptionsWidget> {
               FilteringTextInputFormatter.deny(RegExp(r'[\\,|\\.]')),
               LengthLimitingTextInputFormatter(4)
             ],
-            decoration: InputDecoration(labelText: '请输入范围在1~1000内的整数'),
+            decoration: const InputDecoration(labelText: '请输入范围在1~1000内的整数'),
             onChanged: (value){
               context
                   .read<ConvertOptionsProvider>()
@@ -84,11 +84,11 @@ class _ConvertImageOptionsWidgetState extends State<ConvertImageOptionsWidget> {
     return Column(
       crossAxisAlignment: CrossAxisAlignment.start,
       children: [
-        Text('Page Options:'),
+        const Text('Page Options:'),
         _imagePageOptionsItem(
-            imagePageOptions, ImagePageOptions.JPEG, onChanged),
+            imagePageOptions, ImagePageOptions.jpeg, onChanged),
         _imagePageOptionsItem(
-            imagePageOptions, ImagePageOptions.PNG, onChanged),
+            imagePageOptions, ImagePageOptions.png, onChanged),
       ],
     );
   }

+ 3 - 2
lib/widgets/options/convert_ppt_options_widget.dart

@@ -1,7 +1,8 @@
-import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
 import 'package:flutter/material.dart';
 import 'package:provider/provider.dart';
 
+import '../../states/convert_options_provider.dart';
+
 ///  convert_ppt_options_widget.dart
 ///
 ///  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
@@ -27,7 +28,7 @@ class _ConvertPPTOptionsWidgetState extends State<ConvertPPTOptionsWidget> {
     bool containAnnotations = context.select<ConvertOptionsProvider, bool>(
         (value) => value.pptOptions.containAnnotations);
     return Padding(
-        padding: EdgeInsets.all(8),
+        padding: const EdgeInsets.all(8),
         child: Column(
           mainAxisSize: MainAxisSize.min,
           children: [

+ 3 - 2
lib/widgets/options/convert_rtf_options_widget.dart

@@ -1,7 +1,8 @@
-import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
 import 'package:flutter/material.dart';
 import 'package:provider/provider.dart';
 
+import '../../states/convert_options_provider.dart';
+
 ///  convert_rtf_options_widget.dart
 ///  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 ///
@@ -26,7 +27,7 @@ class _ConvertRTFOptionsWidgetState extends State<ConvertRTFOptionsWidget> {
     bool containAnnotations = context.select<ConvertOptionsProvider, bool>(
         (value) => value.rtfOptions.containAnnotations);
     return Padding(
-        padding: EdgeInsets.all(8),
+        padding: const EdgeInsets.all(8),
         child: Column(
           mainAxisSize: MainAxisSize.min,
           children: [

+ 3 - 2
lib/widgets/options/convert_word_options_widget.dart

@@ -1,7 +1,8 @@
-import 'package:ConversionFlutterDemo/states/convert_options_provider.dart';
 import 'package:flutter/material.dart';
 import 'package:provider/provider.dart';
 
+import '../../states/convert_options_provider.dart';
+
 
 ///  convert_word_options_widget.dart
 ///
@@ -25,7 +26,7 @@ class _ConvertWordOptionsWidgetState extends State<ConvertWordOptionsWidget> {
     bool containImages = context.select<ConvertOptionsProvider, bool>((value) => value.wordOptions.containImages);
     bool containAnnotations = context.select<ConvertOptionsProvider, bool>((value) => value.wordOptions.containAnnotations);
     return Padding(
-        padding: EdgeInsets.all(8),
+        padding: const EdgeInsets.all(8),
         child: Column(
           mainAxisSize: MainAxisSize.min,
           children: [

+ 0 - 0
example/pubspec.lock


部分文件因为文件数量过多而无法显示