Closed Lesik closed 6 years ago
Thanks! Will test (and merge) in a couple of days.
@Lesik Take a look at https://github.com/Applications-Development/platform_packages_apps_PdfViewer/commit/2017c867f69d038872bd0ee4acb3d9525cf5ddf2.
You can modify viewer.js and add a javascript interface acting as a callback. Disable the print menu item initially, and enable it once the callback gets invoked, then disable again once a new PDF gets selected.
@Tommy-Geenexus Thanks, but are we allowed to take inspiration from your code? It is under a non-free license, so I deliberately didn't look at it, even if it was tempting...
@Lesik Sure. I originally planned to get my fork on FDroid, but i forgot about the restrictive license. Eventually i'll try to pr my changes to this fork, because they implement basic necessary features.
I'm very sorry for the delay in merging this. I just finished (temporarily) relocating in another country, and I've been under pressure with other things. Will come back to this asap.
The code was tested by me on an Android 7.1 device and works.
Some caveats: