Browse Source

ComPDFKit(flutter) - v2.1.0 接入,新增注释回复

liuxiaolong 8 months ago
parent
commit
7f2a869a3e

+ 26 - 9
CONFIGURATION.md

@@ -64,7 +64,16 @@ var configuration = CPDFConfiguration(
     ]
   )
 );
-ComPDFKit.openDocument(document, password: '', configuration: configuration);    
+ComPDFKit.openDocument(document, password: '', configuration: configuration); 
+
+// usage Widget
+Scaffold(
+  resizeToAvoidBottomInset: false,
+  appBar: AppBar(title: const Text('CPDFReaderWidget Example'),),
+  body: CPDFReaderWidget(
+    document: widget.documentPath,
+    configuration: configuration
+  ));
 ```
 
 ### Option Explanations
@@ -182,11 +191,12 @@ Configure annotation-related settings, such as enabling types displayed in the a
 
 ##### **Parameters**
 
-| Name           | Type  | Description                                                  |
-| -------------- | ----- | ------------------------------------------------------------ |
-| availableTypes | Array | The types of annotations enabled in the toolbar at the bottom. |
-| availableTools | Array | Annotation tools, including `Setting`, `Undo`, and `Redo`.   |
-| initAttribute  | Array | Set default attributes for annotations.                      |
+| Name             | Type   | Description                                                              |
+| ---------------- | ------ |--------------------------------------------------------------------------|
+| availableTypes   | Array  | The types of annotations enabled in the toolbar at the bottom.           |
+| availableTools   | Array  | Annotation tools, including `Setting`, `Undo`, and `Redo`.               |
+| initAttribute    | Array  | Set default attributes for annotations.                                  |
+| annotationAuthor | String | Set the author name when adding annotations and replying to annotations. |
 
 ##### **availableTypes Constants**
 
@@ -760,9 +770,10 @@ This section is used to configure the types of forms enabled in the view's botto
 
 ##### Parameters
 
-| Name      | Type          | Example | Description                                                  |
-| --------- | ------------- | ------- | ------------------------------------------------------------ |
-| themeMode | CPDFThemeMode | light   | Set the view theme style, support `light`, `dark`, `system`, the default is `light` theme<br />**ComPDFKit SDK for Flutter:** => 2.0.2<br />Only Android Platform. |
+| Name                    | Type          | Example | Description                                                  |
+| ----------------------- | ------------- | ------- | ------------------------------------------------------------ |
+| themeMode               | CPDFThemeMode | light   | Set the view theme style, support `light`, `dark`, `system`, the default is `light` theme<br />**ComPDFKit SDK for Flutter:** => 2.0.2<br />Only Android Platform. |
+| fileSaveExtraFontSubset | boolean       | true    | When saving a document, whether to save the used font set together with the document. |
 
 ##### themeMode Constants
 
@@ -780,6 +791,7 @@ This section is used to configure the types of forms enabled in the view's botto
 {
   "modeConfig": {
     "initialViewMode": "viewer",
+    "readerOnly": false,
     "availableViewModes": [
       "viewer",
       "annotations",
@@ -817,6 +829,7 @@ This section is used to configure the types of forms enabled in the view's botto
     ]
   },
   "annotationsConfig": {
+    "annotationAuthor": "Guest",
     "availableTypes": [
       "note",
       "highlight",
@@ -1033,6 +1046,10 @@ This section is used to configure the types of forms enabled in the view's botto
     "pageSpacing": 10,
     "pageScale": 1.0,
     "pageSameWidth":true
+  },
+  "global" : {
+    "themeMode" : "system",
+    "fileSaveExtraFontSubset" : true
   }
 }
 ```

+ 206 - 202
README.md

@@ -151,119 +151,10 @@ Alternatively you can update the `AndroidManifest.xml` file to use `FlutterFragm
  dependencies:
    flutter:
      sdk: flutter
-+  compdfkit_flutter: ^2.0.2
++  compdfkit_flutter: ^2.1.0
 ```
 
-8. From the terminal app, run the following command to get all the packages:
-
-```bash
-flutter pub get
-```
-
-9. Open `lib/main.dart` and replace the entire content with the following code. And fill in the license provided to you in the `ComPDFKit.init` method, this simple example will load a PDF document from the local device file system.
-
-```dart
-import 'dart:io';
-
-import 'package:compdfkit_flutter/compdfkit.dart';
-import 'package:compdfkit_flutter/cpdf_configuration.dart';
-
-import 'package:flutter/material.dart';
-
-const String _documentPath = 'pdfs/PDF_Document.pdf';
-
-void main() {
-  runApp(const MyApp());
-}
-
-class MyApp extends StatefulWidget {
-  const MyApp({super.key});
-
-  @override
-  State<MyApp> createState() => _MyAppState();
-}
-
-class _MyAppState extends State<MyApp> {
-  @override
-  void initState() {
-    super.initState();
-    _init();
-  }
-
-  void _init() async {
-    /// Please replace it with your ComPDFKit license
-    ComPDFKit.initialize(androidOnlineLicense : 'your compdfkit key', iosOnlineLicense : 'your compdfkit key');
-  
-    /// If you are using an offline certified license, please use init() method
-    /// ComPDFKit.init('your compdfkit key')
-  }
-
-  @override
-  Widget build(BuildContext context) {
-    return MaterialApp(
-      home: Scaffold(
-          body: SafeArea(
-              child: Center(
-        child: ElevatedButton(
-            onPressed: () async {
-              showDocument(context);
-            },
-            child: const Text(
-              'Open Document',
-              style: TextStyle(color: Colors.white),
-            )),
-      ))),
-    );
-  }
-
-  void showDocument(BuildContext context) async {
-    final bytes = await DefaultAssetBundle.of(context).load(_documentPath);
-    final list = bytes.buffer.asUint8List();
-    final tempDir = await ComPDFKit.getTemporaryDirectory();
-    var pdfsDir = Directory('${tempDir.path}/pdfs');
-    pdfsDir.createSync(recursive: true);
-
-    final tempDocumentPath = '${tempDir.path}/$_documentPath';
-    final file = File(tempDocumentPath);
-    if (!file.existsSync()) {
-      file.create(recursive: true);
-      file.writeAsBytesSync(list);
-    }
-    var configuration = CPDFConfiguration();
-    // How to disable functionality:
-    // setting the default display mode when opening
-    //      configuration.modeConfig = const ModeConfig(initialViewMode: CPreviewMode.annotations);
-    // top toolbar configuration:
-    // android:
-    //      configuration.toolbarConfig = const ToolbarConfig(androidAvailableActions: [
-    //           ToolbarAction.thumbnail, ToolbarAction.bota, 
-    //           ToolbarAction.search, ToolbarAction.menu
-    //      ],
-    //      availableMenus: [
-    //        ToolbarMenuAction.viewSettings, ToolbarMenuAction.documentInfo, ToolbarMenuAction.security,
-    //      ]);
-    // iOS:
-    //      configuration.toolbarConfig = const ToolbarConfig(
-    //		// ios top toolbar left buttons
-    //		iosLeftBarAvailableActions: [
-    //          ToolbarAction.back, ToolbarAction.thumbnail
-    //      ],
-    //		// ios top toolbar right buttons
-    //      iosRightBarAvailableActions: [
-    //        ToolbarAction.bota, ToolbarAction.search, ToolbarAction.menu
-    //      ],
-    //      availableMenus: [
-    //        ToolbarMenuAction.viewSettings, ToolbarMenuAction.documentInfo, ToolbarMenuAction.security,
-    //      ]);
-    // readerview configuration
-    //      configuration.readerViewConfig = const ReaderViewConfig(linkHighlight: true, formFieldHighlight: true);
-    ComPDFKit.openDocument(tempDocumentPath,
-        password: '', configuration: configuration);
-  }
-}
-```
-
-9. Add the PDF documents you want to display in the project
+8. Add the PDF documents you want to display in the project
 
 * create a `pdf` directory
 
@@ -272,7 +163,7 @@ class _MyAppState extends State<MyApp> {
   ```
 * Copy your example document into the newly created `pdfs` directory and name it `PDF_Document.pdf`
 
-10. Specify the `assets` directory in `pubspec.yaml`
+9. Specify the `assets` directory in `pubspec.yaml`
 
 ```diff
  flutter:
@@ -280,11 +171,10 @@ class _MyAppState extends State<MyApp> {
 +    - pdfs/
 ```
 
-11. Start your Android emulator, or connect a device.
-12. Run the app with:
+10. From the terminal app, run the following command to get all the packages:
 
 ```bash
-flutter run
+flutter pub get
 ```
 
 #### iOS
@@ -307,16 +197,10 @@ cd example
  dependencies:
    flutter:
      sdk: flutter
-+  compdfkit_flutter: ^2.0.2
++  compdfkit_flutter: ^2.1.0
 ```
 
-4. From the terminal app, run the following command to get all the packages:
-
-```bash
-flutter pub get
-```
-
-5. Open your project's Podfile in a text editor:
+4. Open your project's Podfile in a text editor:
 
 ```bash
 open ios/Podfile
@@ -336,8 +220,8 @@ open ios/Podfile
    use_modular_headers!`
 
    flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
-+  pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.0.2.podspec'
-+  pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.0.2.podspec'
++  pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.1.0.podspec'
++  pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.1.0.podspec'
 
  end
 ```
@@ -348,7 +232,129 @@ open ios/Podfile
 pod install
 ```
 
-8. Open `lib/main.dart` and replace the entire content with the following code. And fill in the license provided to you in the `ComPDFKit.init` method, this simple example will load a PDF document from the local device file system.
+8. Add the PDF documents you want to display in the project
+
+* create a `pdf` directory
+
+  ```bash
+  mkdir pdfs
+  ```
+* Copy your example document into the newly created `pdfs` directory and name it `PDF_Document.pdf`
+
+9. Specify the `assets` directory in `pubspec.yaml`
+
+```diff
+ flutter:
++  assets:
++    - pdfs/
+```
+
+10. To protect user privacy, before accessing the sensitive privacy data, you need to find the "***Info\***" configuration in your iOS 10.0 or higher iOS project and configure the relevant privacy terms as shown in the following picture.
+
+![](./screenshots/1-8.png)
+
+```objective-c
+<key>NSCameraUsageDescription</key>
+<string>Your consent is required before you could access the function.</string>
+
+<key>NSMicrophoneUsageDescription</key>
+<string>Your consent is required before you could access the function.</string>
+
+<key>NSPhotoLibraryAddUsageDescription</key>
+<string>Your consent is required before you could access the function.</string>
+
+<key>NSPhotoLibraryUsageDescription</key>
+<string>Your consent is required before you could access the function.</string>
+  
+<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
+```
+
+11. From the terminal app, run the following command to get all the packages:
+
+```bash
+flutter pub get
+```
+
+
+
+#### Apply the License Key
+
+ComPDFKit PDF SDK is a commercial SDK, which requires a license to grant developer permission to release their apps. Each license is only valid for one `bundle ID` or `applicationId` in development mode. Other flexible licensing options are also supported, please contact [our marketing team](mailto:support@compdf.com) to know more.
+
+To initialize ComPDFKit using a license key, call either of the following before using any other ComPDFKit APIs or features:
+
+* **Online license:**
+
+```dart
+ComPDFKit.initialize(androidOnlineLicense : 'your compdfkit key', iosOnlineLicense : 'your compdfkit key');
+```
+
+* **Offline license:**
+
+```dart
+ComPDFKit.init('your compdfkit key');
+```
+
+**Example:**
+
+```diff
+import 'dart:io';
+
+import 'package:compdfkit_flutter/compdfkit.dart';
+import 'package:compdfkit_flutter/cpdf_configuration.dart';
+
+import 'package:flutter/material.dart';
+
+const String _documentPath = 'pdfs/PDF_Document.pdf';
+
+void main() {
+  runApp(const MyApp());
+}
+
+class MyApp extends StatefulWidget {
+  const MyApp({super.key});
+
+  @override
+  State<MyApp> createState() => _MyAppState();
+}
+
+class _MyAppState extends State<MyApp> {
+
+  @override
+  void initState() {
+    super.initState();
+    _init();
+  }
+
+  void _init() async {
+    /// Please replace it with your ComPDFKit license
++    ComPDFKit.initialize(androidOnlineLicense : 'your compdfkit key', iosOnlineLicense : 'your compdfkit key');
+  
+    /// If you are using an offline certified license, please use init() method
++    /// ComPDFKit.init('your compdfkit key')
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return MaterialApp();
+  }
+}
+```
+
+#### Usage
+
+There are 2 different ways to use ComPDFKit Flutter API:
+
+* Present a document via a plugin.
+* Show a ComPDFKit document view via a Widget.
+
+##### Usage Plugin
+
+Open `lib/main.dart`,replace the entire file with the following:
 
 ```dart
 import 'dart:io';
@@ -418,106 +424,104 @@ class _MyAppState extends State<MyApp> {
       file.writeAsBytesSync(list);
     }
     var configuration = CPDFConfiguration();
-    // How to disable functionality:
-    // setting the default display mode when opening
-    //      configuration.modeConfig = const ModeConfig(initialViewMode: CPreviewMode.annotations);
-    // top toolbar configuration:
-    // android:
-    //      configuration.toolbarConfig = const ToolbarConfig(androidAvailableActions: [
-    //           ToolbarAction.thumbnail, ToolbarAction.bota, 
-    //           ToolbarAction.search, ToolbarAction.menu
-    //      ],
-    //      availableMenus: [
-    //        ToolbarMenuAction.viewSettings, ToolbarMenuAction.documentInfo, ToolbarMenuAction.security,
-    //      ]);
-    // iOS:
-    //      configuration.toolbarConfig = const ToolbarConfig(iosLeftBarAvailableActions: [
-    //          ToolbarAction.back, ToolbarAction.thumbnail
-    //      ],
-    //      iosRightBarAvailableActions: [
-    //        ToolbarAction.bota, ToolbarAction.search, ToolbarAction.menu
-    //      ],
-    //      availableMenus: [
-    //        ToolbarMenuAction.viewSettings, ToolbarMenuAction.documentInfo, ToolbarMenuAction.security,
-    //      ]);
-    // readerview configuration:
-    //      configuration.readerViewConfig = const ReaderViewConfig(linkHighlight: true, formFieldHighlight: 		true);
+    // Present a document via a plugin.
     ComPDFKit.openDocument(tempDocumentPath,
         password: '', configuration: configuration);
   }
 }
 ```
 
-9. Add the PDF documents you want to display in the project
-
-* create a `pdf` directory
-
-  ```bash
-  mkdir pdfs
-  ```
-* Copy your example document into the newly created `pdfs` directory and name it `PDF_Document.pdf`
+##### Usage Widget
 
-10. Specify the `assets` directory in `pubspec.yaml`
+Open `lib/main.dart`,replace the entire file with the following:
 
-```diff
- flutter:
-+  assets:
-+    - pdfs/
-```
+```dart
+import 'dart:io';
 
-11. To protect user privacy, before accessing the sensitive privacy data, you need to find the "***Info\***" configuration in your iOS 10.0 or higher iOS project and configure the relevant privacy terms as shown in the following picture.
+import 'package:compdfkit_flutter/compdfkit.dart';
+import 'package:compdfkit_flutter/cpdf_configuration.dart';
+import 'package:compdfkit_flutter/widgets/cpdf_reader_widget.dart';
 
-![](./screenshots/1-8.png)
+import 'package:flutter/material.dart';
 
-```objective-c
-<key>NSCameraUsageDescription</key>
-<string>Your consent is required before you could access the function.</string>
+const String _documentPath = 'pdfs/PDF_Document.pdf';
 
-<key>NSMicrophoneUsageDescription</key>
-<string>Your consent is required before you could access the function.</string>
+void main() {
+  runApp(const MyApp());
+}
 
-<key>NSPhotoLibraryAddUsageDescription</key>
-<string>Your consent is required before you could access the function.</string>
+class MyApp extends StatefulWidget {
+  const MyApp({super.key});
 
-<key>NSPhotoLibraryUsageDescription</key>
-<string>Your consent is required before you could access the function.</string>
-  
-<key>NSAppTransportSecurity</key>
-	<dict>
-		<key>NSAllowsArbitraryLoads</key>
-		<true/>
-	</dict>
-```
+  @override
+  State<MyApp> createState() => _MyAppState();
+}
 
-12. Start your Android emulator, or connect a device.
+class _MyAppState extends State<MyApp> {
+  String? _document;
 
-```bash
-flutter emulators --launch apple_ios_simulator
-```
+  @override
+  void initState() {
+    super.initState();
+    _init();
+    _getDocumentPath(context).then((value) {
+      setState(() {
+        _document = value;
+      });
+    });
+  }
 
-13. Run the app with:
+  void _init() async {
+    /// Please replace it with your ComPDFKit license
+    ComPDFKit.initialize(
+         androidOnlineLicense: 'your compdfkit key',
+         iosOnlineLicense: 'your compdfkit key');
 
-```bash
-flutter run
-```
+    /// If you are using an offline certified license, please use init() method
+    /// ComPDFKit.init('your compdfkit key')
+  }
 
-#### Apply the License Key
+  @override
+  Widget build(BuildContext context) {
+    return MaterialApp(
+      home: Scaffold(
+        resizeToAvoidBottomInset: false,
+        appBar: AppBar(
+          title: const Text('Dark Theme Example'),
+        ),
+        body: _document == null
+        ? Container()
+        : CPDFReaderWidget(
+          document: _document!,
+          configuration: CPDFConfiguration(),
+          onCreated: (_create) => {})));
+  }
 
-ComPDFKit PDF SDK is a commercial SDK, which requires a license to grant developer permission to release their apps. Each license is only valid for one `bundle ID` or `applicationId` in development mode. Other flexible licensing options are also supported, please contact [our marketing team](mailto:support@compdf.com) to know more.
+  Future<String> _getDocumentPath(BuildContext context) async {
+    final bytes = await DefaultAssetBundle.of(context).load(_documentPath);
+    final list = bytes.buffer.asUint8List();
+    final tempDir = await ComPDFKit.getTemporaryDirectory();
+    var pdfsDir = Directory('${tempDir.path}/pdfs');
+    pdfsDir.createSync(recursive: true);
 
-To initialize ComPDFKit using a license key, call either of the following before using any other ComPDFKit APIs or features:
+    final tempDocumentPath = '${tempDir.path}/$_documentPath';
+    final file = File(tempDocumentPath);
+    if (!file.existsSync()) {
+      file.create(recursive: true);
+      file.writeAsBytesSync(list);
+    }
+    return tempDocumentPath;
+  }
+}
+```
 
-* **Online license:**
+Start your Android emulator, or connect a device, Run the app with:
 
-```dart
-ComPDFKit.initialize(androidOnlineLicense : 'your compdfkit key', iosOnlineLicense : 'your compdfkit key');
+```bash
+flutter run
 ```
 
-* **Offline license:**
 
-```dart
-ComPDFKit.init('your compdfkit key');
-```
 
 #### Troubleshooting
 
@@ -553,8 +557,8 @@ target 'PDFView_RN' do
     # Pods for testing
   end
 
-+  pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.0.2'
-+  pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.0.2'
++  pod 'ComPDFKit', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.0'
++  pod 'ComPDFKit_Tools', :git => 'https://github.com/ComPDFKit/compdfkit-pdf-sdk-ios-swift.git', :tag => '2.1.0'
 
   # Enables Flipper.
   #

+ 1 - 1
android/build.gradle

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

BIN
android/libs/ComPDFKit-UI.aar


BIN
android/libs/ComPDFKit.aar


BIN
android/libs/ComPDFKit_Tools-release.aar


+ 1 - 1
android/src/main/java/com/compdfkit/flutter/compdfkit_flutter/plugin/ComPDFKitSDKPlugin.java

@@ -64,7 +64,7 @@ public class ComPDFKitSDKPlugin extends BaseMethodChannelPlugin {
                 });
                 break;
             case SDK_VERSION_CODE:
-                result.success("ComPDFKit 2.0.2 for Android");
+                result.success(CPDFSdk.getSDKVersion());
                 break;
             case SDK_BUILD_TAG:
                 result.success(CPDFSdk.getSDKBuildTag());

BIN
example/android/app/libs/ComPDFKit-UI.aar


BIN
example/android/app/libs/ComPDFKit.aar


BIN
example/android/app/libs/ComPDFKit_Tools-release.aar


+ 3 - 1
example/lib/page/settings_page.dart

@@ -5,6 +5,8 @@
 ///  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
 ///  This notice may not be removed from this file.
 ///
+import 'dart:io';
+
 import 'package:compdfkit_flutter/compdfkit.dart';
 import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
@@ -32,7 +34,7 @@ class SettingsPage extends StatelessWidget {
                     trailing: FutureBuilder(
                         future: ComPDFKit.getVersionCode(),
                         builder: (context, snap) {
-                          return Text(snap.data ?? "",
+                          return Text(snap.data == null ? '' : 'ComPDFKit ${snap.data} for ${Platform.operatingSystem}',
                               style: Theme.of(context).textTheme.bodyMedium);
                         })),
                 head(context, 'Company Information'),

+ 1 - 1
example/pubspec.lock

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

+ 1 - 1
example/pubspec.yaml

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

+ 14 - 4
lib/cpdf_configuration.dart

@@ -192,6 +192,8 @@ class ReaderViewConfig {
 }
 
 class CPDFAnnotationsConfig {
+  final String annotationAuthor;
+
   final List<CPDFAnnotationType> availableTypes;
 
   final List<CPDFConfigTool> availableTools;
@@ -199,11 +201,13 @@ class CPDFAnnotationsConfig {
   final CPDFAnnotationAttribute initAttribute;
 
   const CPDFAnnotationsConfig(
-      {this.availableTypes = CPDFAnnotationType.values,
+      {this.annotationAuthor = '',
+      this.availableTypes = CPDFAnnotationType.values,
       this.availableTools = CPDFConfigTool.values,
       this.initAttribute = const CPDFAnnotationAttribute()});
 
   Map<String, dynamic> toJson() => {
+        'annotationAuthor': annotationAuthor,
         'availableTypes': availableTypes.map((e) => e.name).toList(),
         'availableTools': availableTools.map((e) => e.name).toList(),
         'initAttribute': initAttribute.toJson()
@@ -862,12 +866,18 @@ class CPDFFormAttr {
 }
 
 class CPDFGlobalConfig {
-
   /// Only supports Android platform in version 2.0.2
   //  Set the view theme mode except the PDF area, the default value is [CPDFThemeMode.system]
   final CPDFThemeMode themeMode;
 
-  const CPDFGlobalConfig({this.themeMode = CPDFThemeMode.system});
+  final bool fileSaveExtraFontSubset;
+
+  const CPDFGlobalConfig(
+      {this.themeMode = CPDFThemeMode.system,
+      this.fileSaveExtraFontSubset = true});
 
-  Map<String, dynamic> toJson() => {"themeMode": themeMode.name};
+  Map<String, dynamic> toJson() => {
+        'themeMode': themeMode.name,
+        'fileSaveExtraFontSubset': fileSaveExtraFontSubset
+      };
 }

+ 1 - 1
pubspec.yaml

@@ -1,6 +1,6 @@
 name: compdfkit_flutter
 description: ComPDFKit for Flutter is a comprehensive SDK that allows you to quickly add PDF functionality to Android and iOS Flutter applications.
-version: 2.0.2
+version: 2.1.0
 homepage: https://www.compdf.com
 repository: https://github.com/ComPDFKit/compdfkit-pdf-sdk-flutter
 issue_tracker: https://www.compdf.com/support