Giter VIP home page Giter VIP logo

flutter_cached_pdfview's Introduction

Hi thereWave Emoji, I'm
Someone

Visitors

  • ๐Ÿ’ฌ Ask me about ... [Java, Dart, JS, Android, Flutter, NodeJS]
  • ๐Ÿ“ซ How to reach me: ... bnsaed.com ,[email protected]
  • โšก Fun fact: Nothing fully secure ๐Ÿ”“.

Languages and Tools:

java android git dart flutter firebase nodejs express jest mongodb redis

flutter_cached_pdfview's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

flutter_cached_pdfview's Issues

java.io.IOException: cannot create document: File not in PDF format or corrupted.

Describe the bug
java.io.IOException: cannot create document: File not in PDF format or corrupted.

To Reproduce
Steps to reproduce the behaviour:

  1. Load pdf from cached url - first load is perfect and works as expected.
  2. once navigated to home and back to the pdf screen
  3. java.io.IOException: cannot create document: File not in PDF format or corrupted. is the error outputted

Expected behaviour
I expected the pdf to load again on the same default page

PDF link:
https://www.dbc.mandhdevelopments.co.za/system/qrcode/qrcode.php?id=19

E/FlutterLoader(11738): Flutter initialization failed.

ok, so once i try to run the app this happen...
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Warning
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project.
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Launching lib\main.dart on G011A in debug mode...
lib\main.dart
โˆš Built build\app\outputs\flutter-apk\app-debug.apk.
E/FlutterLoader(11738): Flutter initialization failed.
E/FlutterLoader(11738): java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.int2.ecommerce_int2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.int2.ecommerce_int2-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libflutter.so"
E/FlutterLoader(11738): at java.util.concurrent.FutureTask.report(FutureTask.java:93)
E/FlutterLoader(11738): at java.util.concurrent.FutureTask.get(FutureTask.java:163)
E/FlutterLoader(11738): at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:178)
E/FlutterLoader(11738): at io.flutter.view.FlutterMain.ensureInitializationComplete(FlutterMain.java:78)
E/FlutterLoader(11738): at io.flutter.app.FlutterActivityDelegate.onCreate(FlutterActivityDelegate.java:145)
E/FlutterLoader(11738): at io.flutter.app.FlutterActivity.onCreate(FlutterActivity.java:91)
E/FlutterLoader(11738): at com.int2.ecommerce_int2.MainActivity.onCreate(MainActivity.kt:10)
E/FlutterLoader(11738): at android.app.Activity.performCreate(Activity.java:5990)
E/FlutterLoader(11738): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
E/FlutterLoader(11738): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
E/FlutterLoader(11738): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
E/FlutterLoader(11738): at android.app.ActivityThread.access$800(ActivityThread.java:151)
E/FlutterLoader(11738): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
E/FlutterLoader(11738): at android.os.Handler.dispatchMessage(Handler.java:102)
E/FlutterLoader(11738): at android.os.Looper.loop(Looper.java:135)
E/FlutterLoader(11738): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/FlutterLoader(11738): at java.lang.reflect.Method.invoke(Native Method)
E/FlutterLoader(11738): at java.lang.reflect.Method.invoke(Method.java:372)
E/FlutterLoader(11738): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/FlutterLoader(11738): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
E/FlutterLoader(11738): Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.int2.ecommerce_int2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.int2.ecommerce_int2-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libflutter.so"
E/FlutterLoader(11738): at java.lang.Runtime.loadLibrary(Runtime.java:366)
E/FlutterLoader(11738): at java.lang.System.loadLibrary(System.java:988)
E/FlutterLoader(11738): at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:129)
E/FlutterLoader(11738): at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:123)
E/FlutterLoader(11738): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/FlutterLoader(11738): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/FlutterLoader(11738): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/FlutterLoader(11738): at java.lang.Thread.run(Thread.java:818)
E/AndroidRuntime(11738): FATAL EXCEPTION: main
E/AndroidRuntime(11738): Process: com.int2.ecommerce_int2, PID: 11738
E/AndroidRuntime(11738): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.int2.ecommerce_int2/com.int2.ecommerce_int2.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.int2.ecommerce_int2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.int2.ecommerce_int2-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libflutter.so"
E/AndroidRuntime(11738): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
E/AndroidRuntime(11738): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
E/AndroidRuntime(11738): at android.app.ActivityThread.access$800(ActivityThread.java:151)
E/AndroidRuntime(11738): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
E/AndroidRuntime(11738): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(11738): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(11738): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime(11738): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11738): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(11738): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime(11738): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
E/AndroidRuntime(11738): Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.int2.ecommerce_int2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.int2.ecommerce_int2-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libflutter.so"
E/AndroidRuntime(11738): at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:243)
E/AndroidRuntime(11738): at io.flutter.view.FlutterMain.ensureInitializationComplete(FlutterMain.java:78)
E/AndroidRuntime(11738): at io.flutter.app.FlutterActivityDelegate.onCreate(FlutterActivityDelegate.java:145)
E/AndroidRuntime(11738): at io.flutter.app.FlutterActivity.onCreate(FlutterActivity.java:91)
E/AndroidRuntime(11738): at com.int2.ecommerce_int2.MainActivity.onCreate(MainActivity.kt:10)
E/AndroidRuntime(11738): at android.app.Activity.performCreate(Activity.java:5990)
E/AndroidRuntime(11738): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
E/AndroidRuntime(11738): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
E/AndroidRuntime(11738): ... 10 more
E/AndroidRuntime(11738): Caused by: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.int2.ecommerce_int2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.int2.ecommerce_int2-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libflutter.so"
E/AndroidRuntime(11738): at java.util.concurrent.FutureTask.report(FutureTask.java:93)
E/AndroidRuntime(11738): at java.util.concurrent.FutureTask.get(FutureTask.java:163)
E/AndroidRuntime(11738): at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:178)
E/AndroidRuntime(11738): ... 17 more
E/AndroidRuntime(11738): Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.int2.ecommerce_int2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.int2.ecommerce_int2-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libflutter.so"
E/AndroidRuntime(11738): at java.lang.Runtime.loadLibrary(Runtime.java:366)
E/AndroidRuntime(11738): at java.lang.System.loadLibrary(System.java:988)
E/AndroidRuntime(11738): at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:129)
E/AndroidRuntime(11738): at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:123)
E/AndroidRuntime(11738): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/AndroidRuntime(11738): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime(11738): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime(11738): at java.lang.Thread.run(Thread.java:818)
Exited (1)

the problem will be gone by disabling "flutter_cached_pdfview: ^0.3.3" in pubspec.yamel
thank you.

Issue with apk size

Using this package adds up approximately 15 mb to my apk . Is there some optimization

How to open protected pdf file

Hello sir, not sure how to use the option "Password" to open protected pdf file, I have entered correct password but it's still show incorrect, could you please suggest for this

Thank you for your support.

2020-08-02_14-05-34

Please review the class DownloadIndicator.

In the DownloadIndicator class, if Text ('Downloading ...') appears, you should have the programmer's option to write whatever he wants in place of "Downloading".

So Text ('Downloading ...'), it should just be a Widget, which for anyone who wants to use the library should, put whatever he wants, while downloading the pdf ...

It may be the case that in place of Text ('Downloading ...'), I want to put a Gif ... or something else ...

Do you understand what I want?

PDF View with Draggable Scrolllbar

Is your feature request related to a problem? Please describe.
I have a requirement whereby the users need to be provided with a draggable scrollbar. So dragging the scrollbar movement should synchronize page number in view. I tried using a draggable scrollbar plugin https://pub.dev/packages/draggable_scrollbar .

The above works in a way that DraggableScrollbar should be the parent widget of the underlying list (or pdf page in our case). The scrollable scrollbar provides a controller which needs to be passed to underlying list widget for maintaining synchronization of list position with the scroll bar position.

Since Cached_PdfView doesn't provide such controller property to which a scrollbar controller can be assigned.

Please provide a solution to the requirement which is an urgent business need. Alternatively, if there is already a solution, please direct me to the available resource to refer.

Describe the solution you'd like
The solution to the Draggable Scrollbar requirement which is integrated & synchronized with pdf view is needed.

Describe alternatives you've considered
No clear alternative found. Although I did try unsuccessfully to force-fit and integrate the 2 components that didn't work.

Additional context
NA

Some Android phones fail to load heavier pdfs

Describe the bug
Issue reported on Firebase crashlytics

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.github.barteksc.pdfviewer.PdfFile.getPageAtOffset(float, float)' on a null object reference
       at com.github.barteksc.pdfviewer.DragPinchManager.checkLinkTapped(DragPinchManager.java:88)
       at com.github.barteksc.pdfviewer.DragPinchManager.onSingleTapConfirmed(DragPinchManager.java:69)
       at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:300)
       at android.os.Handler.dispatchMessage(Handler.java:108)
       at android.os.Looper.loop(Looper.java:166)
       at android.app.ActivityThread.main(ActivityThread.java:7425)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

How to place a scroll handle.

I dont know if this package have scroll handle . if yes kindly help me to set it in pdf view.
If this package don't have scroll handle, kindly add.

Break PdfView when open Keyboard

Describe the bug
On an Android device when open the keyboard it causes pdf to show nothing.

To Reproduce
Steps to reproduce the behaviour:

  1. Select on TextField
  2. Pdf view will show nothing

Screenshots
Alt Text

Smartphone (please complete the following information):

  • Device: Huawei Nova 3i, Emulator Google Pixel 3a
  • OS: Android
  • Version 10

Additional context
NA

Can't select content in PDF_View on Android

Describe the bug
While in iOS it is possible to select, mark, and copy text from inside the PDF_View, I am unable to do so on Android.

To Reproduce
Steps to reproduce the behavior:

  1. Load PDF.
  2. Zoom to any text
  3. Try to mark the text to copy it.

Expected behavior
Text gets marked/selected.

Smartphone (please complete the following information):
OS: Android

Blank screen after rotate screen

Once the Pdf will download it displays correctly but after screen will rotate it displays as blank screen even after I will return to previous rotation screen. Is there some option I can provide or is it someting on my side?

To Reproduce
Steps to reproduce the behavior:

  1. Download PDF
  2. Once downloaded and displayed rotate phone screen

Expected behavior
Blank screen instead of pdf document.

Video
https://streamable.com/8hk3jv

Screenshot of code
https://prnt.sc/trly4l

Old path_provider version causes import failure

Please, update dependencies, because right now I can't integrate the library:
Because ess_front depends on flutter_cached_pdfview ^0.3.5 which depends on path_provider ^1.6.27, path_provider ^1.6.27 is required.
So, because ess_front depends on path_provider ^2.0.1, version solving failed.
pub get failed (1; So, because ess_front depends on path_provider ^2.0.1, version solving failed.)

I can't lower path_provider, because file_picker uses a newer version.

Printing and sharing pdf from url

The pdf from URL is already cached by the package, so it would be super convenient to be able to share and print that cached pdf.

Link Handler

It would be great if I could write mine own method to implement insted of open link from pdf immediately. Then ask user if he is sure to open that link.

Describe the solution you'd like
Provide own method to handle user click on links in pdf.

Is it super easy or will need extra effort? Let me know.

How to show page controller

This is an awesome plugin for pdf viewer in a flutter, It looks clean and easy to implement, I have tried many plugins on "pub.dev", May I ask some question how can we show page total and page controller Could you please advise.

App has stopped on production

This is awesome plugin, It's working fine when running on the emulator but I have some issue when released app to pay store, it show the error app has stopped when pdf view try to loading,
thought might need to add this line "-keep class com.shockwave.**" but not sure where need to add it,
could you please advise, thank you.

PDF().fromPath('/path'), not showing the PDF

fromPath is not working
Please provide a example to load PDF fromPath as its not working for me

My Code is as below:
import 'package:flutter/material.dart';
import 'package:flutter_cached_pdfview/flutter_cached_pdfview.dart';

class PDFScreen extends StatelessWidget {
// static const String routeName = '/pdf_screen';
// final String path;
// PDFScreen({@required this.path});
@OverRide
Widget build(BuildContext context) {
final arguments = ModalRoute.of(context).settings.arguments;
print(arguments);
return Scaffold(
appBar: AppBar(
title: Text('PDF1'),
),
body: PDF().fromPath(
'/storage/emulated/0/Android/data/com.example.book_test/files/books/Book1.pdf'),
);
}
}

The above code should display the PDF but its is not
Please help me with the issue

Inverted frames

Large inverted frames appearing when loading PDF from URL.

101652746-5f2a4380-3a1d-11eb-95c7-d53827604e81

Error in Android System, when I test in emulator or real device.

I am to test in android system.
When I test the app on the emulator or real device, the view does not show the pdf.

Appears this error

D/com.shockwave.pdfium.PdfiumCore( 3943): Starting PdfiumAndroid 1.9.0
E/MethodChannel#flutter/platform_views( 3943): Failed to handle method call
E/MethodChannel#flutter/platform_views( 3943): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
E/MethodChannel#flutter/platform_views( 3943): at io.endigo.plugins.pdfviewflutter.FlutterPDFView.getBoolean(FlutterPDFView.java:171)
E/MethodChannel#flutter/platform_views( 3943): at io.endigo.plugins.pdfviewflutter.FlutterPDFView.(FlutterPDFView.java:33)
E/MethodChannel#flutter/platform_views( 3943): at io.endigo.plugins.pdfviewflutter.PDFViewFactory.create(PDFViewFactory.java:22)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:179)
E/MethodChannel#flutter/platform_views( 3943): at android.app.Dialog.dispatchOnCreate(Dialog.java:389)
E/MethodChannel#flutter/platform_views( 3943): at android.app.Dialog.show(Dialog.java:293)
E/MethodChannel#flutter/platform_views( 3943): at android.app.Presentation.show(Presentation.java:235)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.platform.VirtualDisplayController.(VirtualDisplayController.java:94)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:47)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:112)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:95)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#flutter/platform_views( 3943): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/MethodChannel#flutter/platform_views( 3943): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter/platform_views( 3943): at android.os.MessageQueue.next(MessageQueue.java:323)
E/MethodChannel#flutter/platform_views( 3943): at android.os.Looper.loop(Looper.java:136)
E/MethodChannel#flutter/platform_views( 3943): at android.app.ActivityThread.main(ActivityThread.java:6077)
E/MethodChannel#flutter/platform_views( 3943): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter/platform_views( 3943): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
E/MethodChannel#flutter/platform_views( 3943): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
E/flutter ( 3943): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference, null)
E/flutter ( 3943): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter ( 3943): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter ( 3943):
E/flutter ( 3943): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter ( 3943): #3 AndroidViewController._create (package:flutter/src/services/platform_views.dart:633:54)
E/flutter ( 3943): #4 AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:550:14)
E/flutter ( 3943): #5 RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:175:29)
E/flutter ( 3943): #6 RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:156:5)
E/flutter ( 3943): #7 RenderObject.layout (package:flutter/src/rendering/object.dart:1746:9)
E/flutter ( 3943): #8 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
E/flutter ( 3943): #9 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3943): #10 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:11)
E/flutter ( 3943): #11 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:484:7)
E/flutter ( 3943): #12 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:240:7)
E/flutter ( 3943): #13 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:399:14)
E/flutter ( 3943): #14 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1630:7)
E/flutter ( 3943): #15 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:887:18)
E/flutter ( 3943): #16 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:402:19)
E/flutter ( 3943): #17 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:884:13)
E/flutter ( 3943): #18 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:284:5)
E/flutter ( 3943): #19 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1113:15)
E/flutter ( 3943): #20 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1052:9)
E/flutter ( 3943): #21 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:968:5)
E/flutter ( 3943): #22 _rootRun (dart:async/zone.dart:1184:13)
E/flutter ( 3943): #23 _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter ( 3943): #24 _CustomZone.runGuarded (dart:async/zone.dart:979:7)
E/flutter ( 3943): #25 _invoke (dart:ui/hooks.dart:261:10)
E/flutter ( 3943): #26 _drawFrame (dart:ui/hooks.dart:219:3)
E/flutter ( 3943):
D/ ( 3943): HostConnection::get() New Host Connection established 0x9aa91c80, tid 3955
D/ ( 3943): HostConnection::get() New Host Connection established 0x82734a80, tid 4021
D/ ( 3943): HostConnection::get() New Host Connection established 0x9aa91c00, tid 3952

update dependency

Describe the bug
A clear and concise description of what the bug is.

image

To Reproduce
Steps to reproduce the behaviour:

  1. flutter run

I test in 2 devices, and pdf view only show screen white. the document pdf don't show.

On android System version 9,show this error.

D/ (31775): Gralloc Register w:720, h:1344, f:0x1, usage:0x300, ui64Stamp:280791, sSize:3870720, line = 2106
D/com.shockwave.pdfium.PdfiumCore(31775): Starting PdfiumAndroid 1.9.0
D/ (31775): Gralloc Register w:720, h:1344, f:0x1, usage:0x300, ui64Stamp:280797, sSize:3870720, line = 2106
W/enhada.humbitec(31775): type=1400 audit(0.0:1419930): avc: denied { read } for name="u:object_r:jsonweb_default_prop:s0" dev="tmpfs" ino=12128 scontext=u:r:untrusted_app:s0:c229,c256,c512,c768 tcontext=u:object_r:jsonweb_default_prop:s0 tclass=file permissive=0
E/libc (31775): Access denied finding property "qemu.hw.mainkeys"
E/libc (31775): Access denied finding property "ro.vendor.hwui.texture_cache_size"
W/RenderThread(31775): type=1400 audit(0.0:1419931): avc: denied { read } for name="u:object_r:vendor_hwui_prop:s0" dev="tmpfs" ino=12177 scontext=u:r:untrusted_app:s0:c229,c256,c512,c768 tcontext=u:object_r:vendor_hwui_prop:s0 tclass=file permissive=0
D/OpenGLRenderer(31775): textureCacheSize 25165824
E/libc (31775): Access denied finding property "ro.vendor.hwui.texture_cache_size"
D/OpenGLRenderer(31775): textureCacheSize 25165824
W/RenderThread(31775): type=1400 audit(0.0:1419932): avc: denied { read } for name="u:object_r:vendor_hwui_prop:s0" dev="tmpfs" ino=12177 scontext=u:r:untrusted_app:s0:c229,c256,c512,c768 tcontext=u:object_r:vendor_hwui_prop:s0 tclass=file permissive=0
I/OpenGLRenderer(31775): queryNativeWindowStatus 0x87844808 query=0 dataspace=0
E/enhada.humbite(31775): No implementation found for long com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(int, java.lang.String) (tried Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument and Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument__ILjava_lang_String_2)
D/ (31775): Gralloc Register w:720, h:1344, f:0x1, usage:0xb00, ui64Stamp:280805, sSize:3870720, line = 2106
D/ (31775): Gralloc Register w:720, h:1344, f:0x1, usage:0xb00, ui64Stamp:280811, sSize:3870720, line = 2106
D/ (31775): Gralloc Register w:720, h:1344, f:0x1, usage:0x300, ui64Stamp:280813, sSize:3870720, line = 2106

On android System version 8,show this error.

D/com.shockwave.pdfium.PdfiumCore( 794): Starting PdfiumAndroid 1.9.0
D/mali_winsys( 794): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000, [540x888]-format:1
E/zygote ( 794): No implementation found for long com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(int, java.lang.String) (tried Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument and Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument__ILjava_lang_String_2)
I/zygote ( 794): Do partial code cache collection, code=61KB, data=58KB
I/zygote ( 794): After code cache collection, code=61KB, data=58KB
I/zygote ( 794): Increasing code cache capacity to 256KB

Blank screen is displayed when change orientation

a blank screen is displayed when changing orientation

Steps to reproduce the behavior:

  1. open a pdf from URL
  2. change orientation from portrait to landscape and vise versa

Expected behaviour
the pdf file should continue displaying

Smartphone (please complete the following information):

  • Device:Honor 8x
  • OS: Android
  • version 10

sample code
`
class PDFViewer extends StatefulWidget {
final String url;

PDFViewer({@required this.url});

@OverRide
_PDFViewerState createState() => _PDFViewerState();
}

class _PDFViewerState extends State {

@OverRide
Widget build(BuildContext context) {
return View(
builder: (context, model, child) {
return Scaffold(
body: SafeArea(
child: PDF(
nightMode: true,
onError: (error){
print("err");
print(error.toString());
}
).cachedFromUrl(
widget.url,
placeholder: (progress) => Center(child: Text('$progress %')),
errorWidget: (error) => Center(child: Text(error.toString())),
),
),
);
},
);
}
}`

Can i change background colour of pdf instead of nightmode ?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

How to enable pinch to zoom?

How can I add pinch to Zoom?

It seems that it's enabled by default, but I can't get it to work.

Is there any special property I'm supposed to set to PDF()?

iOS - Unable to zoom-in at initial load on the first page

Describe the bug
Unable to zoom-in the first page of PDF in iOS devices. Once we move to the second page and come back it can be zoomed.

To Reproduce
Steps to reproduce the behavior:

  • Install the application on iOS device
  • Try to zoom in and out
  • You will see that You can not zoom in or zoom out the first page of pdf.
  • Then scroll down and try to "zoom in and out" the second page of pdf.
  • Again try to "zoom in and out" of the first page.
  • Now you will be able to zoom in and zoom out all the pdf pages.

Expected behavior
The pdf should be zoomable on the first page and on the initial load itself.

Smartphone (please complete the following information):

  • Device: [iPhone XS]
  • OS: [iOS 11]
  • Browser [stock browser, safari]

Nightmode only Changing on rebuild

Describe the bug
I can only change the Nightmode Setting only if I rebuild the complete App, if I do a hot Restart or Reload it does not change. I can also not set it to a variable and change that. (not by hardcoding it and also not with setState({})

To Reproduce
My Widget:

class PDFViewerPage extends StatefulWidget {

  PDFViewerPage(this.url);
  final url;

  @override
  _PDFViewerPageState createState() => _PDFViewerPageState(url);
}

class _PDFViewerPageState extends State<PDFViewerPage> {
  _PDFViewerPageState(this.url);
  final url;
  final bool nightmode = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.transparent,
      body: PDF(
        nightMode: nightmode,
      ).cachedFromUrl(
        url,
        placeholder: (progress) => Center(
          child: SpinKitWave(
            color: thomaeumRot,
          ),
        ),
        errorWidget: (error) => ErrorMessageWidget(),
      ),
    );
  }
}

Desktop (please complete the following information):

  • OS: Windows 10

Smartphone (please complete the following information):

  • Device: Emulator (Pixel 4XL
  • OS: Android
  • Version: 11.0

Night mode toggle doesn't work

Describe the bug
I have a Flutter application where I am placing the PDF widget as a Saffold body. The Scaffold header has a Widget which toggles between Light and Dark mode of the app. So the toggle is working perfectly for all Widgets on the page except flutter_chached_view pdf. On change of toggle switch, I toggle a boolean variable value which is assigned to night mode property i.e.
PDF(nighMode: _boolToggle)

So the application code calls set state on change in bool value which toggles night mode for all widgets but PDF doesn't toggle between the two modes. The file remains in the mode when the PDF widget was initiated and rendered for the first time. The user needs to go back to the previous page, change the theme and then open the pdf again to view the pdf as per the updated theme.
To Reproduce

  1. Create a simple flutter Material widget with Scaffold and PDF widget is defined as the body of the scaffold.
  2. Create a floating action button which is supposed to toggle between the dark and light themes
  3. Toggle boolean variable onPress of the FAB and call setstate().
  4. Although the boolean variable value mapped to nightMode property of PDF widget is chaged, the PDF nightMode doesn't toggle between Light and Dark mode. The pdf view remains in line with the theme at first installation of the widget on page load.

Expected behaviour
On change of nightMode boolean value, the PDF view should be updated to show as per the updated mode.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

  • Device: Android - Emulator: PIxel 3 API 29
  • OS:Emulator running on Mac OS Cataline
  • Version: Latest Flutter and Dart versions as of date of reporting the issue.

Additional context
NA

Search for any word in the pdf

The package is very good, congratulations. I would like to know if it is possible to search for any word in the pdf, if so please could you guide me. Thanks

[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(942)] Check failed: CheckException(env) occurs while opening pdffrom cacheUrl

App crashes while opening pdf. This is the log of error

fingerprint: 'samsung/j7popelteue/j7popelteue:8.1.0/M1AJQ/J727UUES8BTF3:user/release-keys'
Revision: '5'
ABI: 'arm'
pid: 5475, tid: 5475, name: .pdfdemo >>> com.example.pdf_demo<<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(942)] Check failed: CheckException(env).
'
r0 00000000 r1 00001563 r2 00000006 r3 00000008
r4 00001563 r5 00001563 r6 ff8cb3e4 r7 0000010c
r8 00000000 r9 ff8cb540 sl 00000031 fp eccbbd90
ip ec851111 sp ff8cb3d0 lr ed3bbe53 pc ed3b5518 cpsr 20070030
backtrace:
#00 pc 0001a518 /system/lib/libc.so (abort+63)
#1 pc 000127c3 /data/app/com.example.pdf_demo-ry7VNoGr0K2Ce5_6tjwqQg==/lib/arm/libflutter.so (offset 0x1002000)

ios setPage ่ฟ”ๅ›ž้”™่ฏฏ

ๅœจiOSไธญ่ฐƒ็”จsetPage่ฟ”ๅ›ž็š„ๆ˜ฏๅฝ“ๅ‰็š„page๏ผŒไฝ†ๆ˜ฏAndroidๅ’Œflutterไธญ่งฃๆž็š„้ƒฝๆ˜ฏboolๅ€ผ๏ผ›FlutterPDFView.m่ฟ”ๅ›ž้œ€่ฆไฟฎๆ”นไธบtrue

- (void)setPage:(FlutterMethodCall*)call result:(FlutterResult)result {
    NSDictionary<NSString*, NSNumber*>* arguments = [call arguments];
    NSNumber* page = arguments[@"page"];
    
    [_pdfView goToPage: [_pdfView.document pageAtIndex: page.unsignedLongValue ]];
    result(YES);
}

image

I have an ideia.

Have you thought about the possibility of not only saving PDFs in cache, but also being able to save them in a database, such as sqllite data, in this package ...?

How to make a widget test of this component?

I know the component is on the screen, because I put a key on your ancestor and verified that the ancestor was found

final PDFWidget = find.byType(PDF);
expect(PDFWidget, findsOneWidget);

return _WidgetTypeFinder:<zero widgets with type "PDF" (ignoring offstage widgets)

Getting page count return 0

i this code that i used in our application i get zero for getting page count

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_cached_pdfview/flutter_cached_pdfview.dart';
import 'package:velocity_x/velocity_x.dart';

class ShowPdfFromUrl extends StatefulWidget {
  final String pdfUrl;
  final String productName;

  ShowPdfFromUrl({@required this.pdfUrl, @required this.productName});

  @override
  _ShowPdfFromUrlState createState() => _ShowPdfFromUrlState();
}

class _ShowPdfFromUrlState extends State<ShowPdfFromUrl> {
  final Completer<PDFViewController> _pdfViewController = Completer<PDFViewController>();
  final ValueNotifier<int> _pageCount = ValueNotifier<int>(0);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          '${widget.productName}',
          overflow: TextOverflow.ellipsis,
          maxLines: 1,
        ),
      ),
      body: Stack(
        children: [
          PDF(
            onViewCreated: (PDFViewController pdfViewController) async {
              _pdfViewController.complete(pdfViewController);
              _pageCount.value = await pdfViewController.getPageCount();
            },
          ).cachedFromUrl(
            '${widget.pdfUrl}',
            placeholder: (progress) => Center(child: Text('Yรผkleniyor $progress % ...')),
            errorWidget: (error) {
              return Center(
                  child: Container(
                    width: context.screenWidth,
                    height: context.screenHeight,
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Text('PDF hatasฤฑ indiriliyor'),
                        Padding(
                          padding: const EdgeInsets.only(top: 16.0),
                          child: OutlineButton(
                            onPressed: () {
                              setState(() {});
                            },
                            child: Text('lรผtfen tekrar deneyin'),
                          ),
                        ),
                      ],
                    ),
                  ));
            },
          ),

          Positioned(
            top: 8.0,
            left: 8.0,
            child: ValueListenableBuilder(
              valueListenable: _pageCount,
              builder: (_,value,__){
                return Container(
                  padding: EdgeInsets.all(8.0),
                  color: Colors.black,
                  child: Text('($value)',style: TextStyle(
                    color: Colors.white,
                  ),),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}

Blurry text after scrolling/translating coordinates

Describe the bug
When moving around the page, the renderer often keeps some areas blurry.

To Reproduce
Steps to reproduce the behavior:

  1. Open a PDF on android.
  2. Zoom in
  3. Move the page around.

Expected behavior
Text should be rendered cleary.

Screenshots

photo5373100247775031118

Smartphone (please complete the following information):

  • Pixel 2 XL
  • 11 (but other (previous) versions same behaviour

Massive app size increase after install this plugin

Describe the bug
Before installing the plugin, my app was 26.3 Mb and After I install the ^0.2.8 version of this plugin the app size increased up to 44.6Mb on android

To Reproduce
Steps to reproduce the behavior:
Install the plugin and run flutter build apk --release

Expected behavior
There is at least an 18Mb gap between two builds. Is the plugin has this much size?

Desktop (please complete the following information):

  • OS: Widows
  • Version: 10

Smartphone (please complete the following information):

  • Device: Nexus 5x Emulator
  • OS: Android
  • Version 9.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.