Sfoglia il codice sorgente

ComPDFKit(flutter) - 水印图片缩放大小问题修正

liuxiaolong 1 mese fa
parent
commit
5f9faf6a31

+ 17 - 20
CHANGELOG.md

@@ -1,26 +1,23 @@
 ## 2.2.1
-
 * Added the features support for ComPDFKit PDF SDK for iOS [iOS V2.2.1](https://www.compdf.com/pdf-sdk/changelog-ios#v2-2-1).
-
 * Added the features support for ComPDFKit PDF SDK for Android [Android V2.2.1](https://www.compdf.com/pdf-sdk/changelog-android#v2-2-1).
-
-- Added API for importing fonts.
-- Added API for adding watermarks.
-- Added API for security settings.
-- Added view-related APIs, including opening thumbnail lists, preview settings, watermark editing, and security settings.
-- For detailed information about the new interfaces, please refer to `cpdf_reader_widget_controller.dart` and `cpdf_document.dart`.
-- Fixed an issue where certain documents could crash when importing XFDF annotations.
-- Fixed an issue on iOS where the author information for Ink annotations was not displayed.
-- Fixed a crash in iOS 18 when editing content in the context menu.
-- Fixed a crash on certain Android devices when initializing the SDK.
-- Fixed a crash on Android related to screenshot functionality.
-- Fixed an issue on Android with the LaBan Key input method.
-- Fixed an issue on Android where the modified date was not updated when saving a modified document.
-- Fixed a crash on Android related to the undo operation in content editing.
-- Fixed an issue on Android where form background color was transparent when highlighting forms was not enabled.
-- Fixed an issue on Android where annotation text would display incorrectly when editing text in highlighted comment areas.
-- Fixed an issue on Android where cloud comment borders were displayed incorrectly in graphic annotations.
-
+* Added API for importing fonts.
+* Added API for adding watermarks.
+* Added API for security settings.
+* Added view-related APIs, including opening thumbnail lists, preview settings, watermark editing, and security settings.
+* Fixed an issue where certain documents could crash when importing XFDF annotations.
+* Fixed an issue on iOS where the author information for Ink annotations was not displayed.
+* Fixed a crash in iOS 18 when editing content in the context menu.
+* Fixed a crash on certain Android devices when initializing the SDK.
+* Fixed a crash on Android related to screenshot functionality.
+* Optimize the screenshot function of the Android platform to improve the quality of image capture
+* Fixed an issue on Android with the LaBan Key input method.
+* Fixed an issue on Android where the modified date was not updated when saving a modified document.
+* Fixed a crash on Android related to the undo operation in content editing.
+* Fixed an issue on Android where form background color was transparent when highlighting forms was not enabled.
+* Fixed an issue on Android where annotation text would display incorrectly when editing text in highlighted comment areas.
+* Fixed an issue on Android where cloud comment borders were displayed incorrectly in graphic annotations. 
+For detailed information about the new interfaces, please refer to `cpdf_reader_widget_controller.dart` and `cpdf_document.dart`.
 
 
 ## 2.2.0

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

@@ -43,6 +43,7 @@ import android.os.Environment;
 import android.text.TextUtils;
 import android.util.Log;
 import androidx.annotation.NonNull;
+import com.bumptech.glide.request.target.Target;
 import com.compdfkit.core.common.CPDFDocumentException;
 import com.compdfkit.core.document.CPDFDocument;
 import com.compdfkit.core.document.CPDFDocument.PDFDocumentEncryptAlgo;
@@ -388,7 +389,7 @@ public class CPDFDocumentPlugin extends BaseMethodChannelPlugin {
             return null;
           }else {
             try {
-              Bitmap bitmap = GlideApp.with(context).asBitmap().load(imagePath).submit(360, 480).get();
+              Bitmap bitmap = GlideApp.with(context).asBitmap().load(imagePath).submit(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL).get();
               return bitmap;
             }catch (Exception e){
               return null;

+ 1 - 1
example/android/config.gradle

@@ -3,6 +3,6 @@ ext {
             COMPILESDK: 33,
             MINSDK: 21,
             TARGETSDK: 33,
-            VERSIONCODE: 13
+            VERSIONCODE: 14
     ]
 }

+ 2 - 2
example/ios/Podfile

@@ -31,8 +31,8 @@ target 'Runner' do
   use_frameworks!
   use_modular_headers!
 
-  pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.2.0.podspec'
-  pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.2.0.podspec'
+  pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.2.1.podspec'
+  pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.2.1.podspec'
   flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
   target 'RunnerTests' do
     inherit! :search_paths

+ 2 - 2
example/lib/cpdf_reader_widget_security_example.dart

@@ -111,7 +111,7 @@ class _CPDFReaderWidgetSecurityExampleState
         await controller.document.createWatermark(CPDFWatermark.image(
           imagePath: imageFile.path,
           opacity: 1,
-          scale: 0.5,
+          scale: 1,
           rotation: 45,
           pages: [0, 1, 2, 3],
           horizontalAlignment: CPDFWatermarkHorizontalAlignment.center,
@@ -126,7 +126,7 @@ class _CPDFReaderWidgetSecurityExampleState
           await controller.document.createWatermark(CPDFWatermark.image(
             imagePath: pickerResult.files.first.path!,
             pages: [0, 1, 2, 3],
-            scale: 0.5,
+            scale: 0.3,
             horizontalAlignment: CPDFWatermarkHorizontalAlignment.center,
             verticalAlignment: CPDFWatermarkVerticalAlignment.center,
           ));

+ 1 - 1
ios/compdfkit_flutter.podspec

@@ -4,7 +4,7 @@
 #
 Pod::Spec.new do |s|
   s.name             = 'compdfkit_flutter'
-  s.version          = '2.2.0'
+  s.version          = '2.2.1'
   s.summary          = 'Flutter PDF Library by ComPDFKit'
   s.description      = <<-DESC
 A new Flutter plugin project.