paride / CopperPDF

CuperPDF is a PDF viewer based on pdf.js in a WebView. It doesn’t require any permissions.
Apache License 2.0
27 stars 11 forks source link

Add print support #7

Closed Lesik closed 6 years ago

Lesik commented 7 years ago

The code was tested by me on an Android 7.1 device and works.

Some caveats:

Lesik commented 7 years ago

paride commented 7 years ago

Thanks! Will test (and merge) in a couple of days.

Tommy-Geenexus commented 7 years ago

@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.

Lesik commented 7 years ago

@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...

Tommy-Geenexus commented 7 years ago

@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.

paride commented 6 years ago

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.