flutter_pdfview icon indicating copy to clipboard operation
flutter_pdfview copied to clipboard

pdf disappear

Open sahmirzali opened this issue 5 years ago • 12 comments

When i close phone's navigate, pdf is disappear, how can i solve this problem ? why this problem is happen ?

problem explain : https://youtu.be/Z_69P6dK81k

@endigo i also try in example project : https://youtu.be/pKo28y47WhY

sahmirzali avatar Oct 18 '20 19:10 sahmirzali

@endigo i'm sorry for upset you, but could you please answered my question ?

@endigo Do you have this issue in your example ? could you please try (run) in your pc ?

sahmirzali avatar Oct 19 '20 18:10 sahmirzali

@shahmirzali I did run my example project but I don't have any solution.

You could run through AndroidPdfViewer source code.

If you find a solution, please create PR because there are issues that wait for very long time.

Thanks

endigo avatar Oct 20 '20 03:10 endigo

I have the same problem I put a textfile to jump from page and from saparese, it also disappears when I flip the phone.

this is one of the messages that I get in both cases D / jniPdfium (8057): Destroy FPDF library

LuisDeLaValie avatar Feb 05 '21 17:02 LuisDeLaValie

I have this problem when I open a soft keyboard on another page. I'm using another page to enter user info (name, phone etc). The moment the soft keyboard is raised I get the "Destore FPDF library" message as well.

See here for others with the same issue. Their fix didn't help for me.

https://github.com/arnaudelub/flutter_fullpdfview/issues/2

jdeltoft avatar Feb 09 '21 15:02 jdeltoft

@LuisDeLaValie @jdeltoft Did you find any solutions ?

sahmirzali avatar Feb 09 '21 16:02 sahmirzali

I moved to using a different pdf lib unfortunately. @sahmirzali . For my situation I got this one for the free community license:

syncfusion_flutter_pdfviewer: ^18.4.42-beta

jdeltoft avatar Feb 10 '21 15:02 jdeltoft

syncfusion_flutter_pdfviewer doesn't have dark mode

raunak-many-ac avatar Dec 19 '21 06:12 raunak-many-ac

I found that this append when the pdf is resized. Currently the package is using a vitual view, if we change to hibryd view it will fix? @endigo what do you think?

lcyper avatar Feb 18 '22 20:02 lcyper

@lcyper whenever pdf disappears in debug console we can see a message:

FPDF destroyed

Possibly being printed from method channel.

If this can be catched in dart then developers can reload the pdf.

raunak-many-ac avatar Feb 18 '22 20:02 raunak-many-ac

@raunak-many-ac how you reload the pdf? (changing the key of the widget)

in this file you can see an aproach to that using this function: (that package is the base for this package, but does not implement that part, and i discover that his aproach does not work well, the best is to reload the widget) onDetachedFromWindow()

lcyper avatar Feb 18 '22 21:02 lcyper

@lcyper that's right.

My sense was we can do anything to reload either by reloading the widget or restarting the screen.

raunak-many-ac avatar Feb 19 '22 05:02 raunak-many-ac