diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro index c9ed26b5..596a039b 100644 --- a/android/proguard-rules.pro +++ b/android/proguard-rules.pro @@ -1 +1 @@ --keep class com.shockwave.** \ No newline at end of file +-keep class com.shockwave.** { *; } \ No newline at end of file diff --git a/android/src/main/java/io/endigo/plugins/pdfviewflutter/FlutterPDFView.java b/android/src/main/java/io/endigo/plugins/pdfviewflutter/FlutterPDFView.java index 7b91d027..a86be87a 100644 --- a/android/src/main/java/io/endigo/plugins/pdfviewflutter/FlutterPDFView.java +++ b/android/src/main/java/io/endigo/plugins/pdfviewflutter/FlutterPDFView.java @@ -10,6 +10,7 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; import io.flutter.plugin.platform.PlatformView; +import android.graphics.Color; import java.io.File; import java.util.HashMap; @@ -35,7 +36,7 @@ public class FlutterPDFView implements PlatformView, MethodCallHandler { methodChannel = new MethodChannel(messenger, "plugins.endigo.io/pdfview_" + id); methodChannel.setMethodCallHandler(this); - + pdfView.setBackgroundColor(Color.LTGRAY); linkHandler = new PDFLinkHandler(context, pdfView, methodChannel, preventLinkNavigation); Configurator config = null; @@ -59,8 +60,10 @@ else if (params.get("pdfData") != null) { .pageSnap(getBoolean(params, "pageSnap")) .pageFitPolicy(getFitPolicy(params)) .enableAnnotationRendering(true) - .linkHandler(linkHandler). - enableAntialiasing(false) + .linkHandler(linkHandler) + .linkHandler(linkHandler) + .spacing(10) + .enableAntialiasing(false) // .fitEachPage(getBoolean(params,"fitEachPage")) .onPageChange(new OnPageChangeListener() { @Override diff --git a/ios/Classes/FlutterPDFView.m b/ios/Classes/FlutterPDFView.m index b814ffc1..797bd3b1 100644 --- a/ios/Classes/FlutterPDFView.m +++ b/ios/Classes/FlutterPDFView.m @@ -168,13 +168,22 @@ - (instancetype)initWithFrame:(CGRect)frame if (@available(iOS 11.0, *)) { UIScrollView *_scrollView; - - for (id subview in _pdfView.subviews) { + for (id subview in _pdfView.subviews) { if ([subview isKindOfClass: [UIScrollView class]]) { _scrollView = subview; - } + } else { + for (UIView *subsubview in [subview subviews]) { + if ([subsubview isKindOfClass:[UIScrollView class]]) { + _scrollView = (UIScrollView *)subsubview; + } + } + } + } + if (_scrollView != NULL) { + _scrollView.showsVerticalScrollIndicator = false; + _scrollView.showsHorizontalScrollIndicator = false; } - + _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; if (@available(iOS 13.0, *)) { _scrollView.automaticallyAdjustsScrollIndicatorInsets = NO;