Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Add print support#7

Merged
paride merged 5 commits intoparide:develfrom
AndroidFromFrankfurt:master
Dec 28, 2017
Merged

Add print support#7
paride merged 5 commits intoparide:develfrom
AndroidFromFrankfurt:master

Conversation

@Lesik
Copy link
Copy Markdown
Contributor

@Lesik Lesik commented Oct 22, 2017

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

Some caveats:

  • Due to the way that CopperPDF displays PDFs, only the current page can be printed, not the whole document.
  • If the user selects print before the document fully loaded, the resulting print job may be incomplete. I couldn't figure out a way to get a callback from PDF.js when the document has successfully loaded.

@Lesik
Copy link
Copy Markdown
Contributor Author

Lesik commented Oct 22, 2017

@paride
Copy link
Copy Markdown
Owner

paride commented Oct 23, 2017

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

@Tommy-Geenexus
Copy link
Copy Markdown

@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
Copy link
Copy Markdown
Contributor Author

Lesik commented Nov 15, 2017

@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
Copy link
Copy Markdown

@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
Copy link
Copy Markdown
Owner

paride commented Dec 20, 2017

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.

@paride paride changed the base branch from master to devel December 28, 2017 14:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants