I have two libraries one is MuPDF
to view PDF
files in android and second is pageCurl
to implement the page curl effect, but it works for bitmaps. Now, I have no idea how can i integrate both of these to get page curl effect in PDF
files, opened by MuPDF
. If any one has already implemented this or knows about some link then please help me.
Thanks
As far as I know there's no simple way to accomplish this. I made a real world app for a wide spread national newspaper: the only way seems to work with bitmaps. They used server side pdf for iOS devices and jpg bitmaps for the Android counterpart.
Keep in mind that working with large bitmaps is a pain in android. That's the reason why pdf viewers renders them in chunk: if you scroll too much, in zooming mode, the high resolution chunks already loaded in memory keep being garbage collected and lost. Test it with whatever pdf implementation (even muPDF) you choose.
2 bitmaps at once (front page and back page, for example) with resolutions of say about 1200x800 eat up the whole app heap memory causing the infamous unrecoverable OutOfMemory exception. Every device has a fixed (and different) amount of heap memory to use for the objects in memory and suffer max allocation limitations too.
My suggestion is:
save your time and change implementation to prerendered images from pdf (server side the best if possible, or prerender directly on device) and manage low memory limited device with different resolution ones.
I'm an Android enthusiast developer but I'm waiting ages for some all-pdf components that could accomplish what iOS devices already do flawlessly. Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With