Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use better print API #13

Open
cgogolin opened this issue Jul 29, 2018 · 7 comments
Open

Use better print API #13

cgogolin opened this issue Jul 29, 2018 · 7 comments

Comments

@cgogolin
Copy link
Owner

Pen&PDF could use this API instead of cloud print. There's some support in the "AndroidX" support library as well, to keep compatibility with much older devices.

Looks like this tutorial might be applicable:

Also relevant to #8

@cgogolin
Copy link
Owner Author

I have started implementing this in https://github.com/cgogolin/penandpdf/tree/printing but, it seems the Android print API does not work well with the pdfs produced by MuPDF, or it is very picky about the pdf having exactly the right page sizes. I will have to investigate more...

@projectextremum
Copy link

projectextremum commented Nov 8, 2018

Very picky about page size

Yes, at least it appears to be. There are some fixed layouts. What about using qpdf?

@cgogolin
Copy link
Owner Author

cgogolin commented Nov 8, 2018

I am not keen on adding another pdf library to the app. Everything is built around mupdf and I don't think it is currently possible to change the page size with mupdf, unfortunately. Is there any way to tell the print API that that my app only offers to print in a given format (that natural to the pdf)?

@projectextremum
Copy link

projectextremum commented Nov 22, 2018

qpdf is not a heavy library though. In termux, installed size of qpdf is ~1 MiB. Considering dependencies, it can be hardly ~3MiB I think.

I have not inspected the code regarding print api, but it renders web pages in letter format, at least in older chrome versions that didn't have offlining support. It may be of little help though.

On the other side, would you mind attaching an apk without internet permissions & print feature to releases?

@cgogolin
Copy link
Owner Author

I am not concerned about APK size. It is more that already now, I don't have the time to regularly update mupdf to the newest version. I am against adding another library because of maintainability.

@projectextremum
Copy link

The thing being that ~60% or more of the users don't need print feature but rather stick to something else because of internet permission. It may be an obstacle to adoption of this app, even though there is no up-to-date app offering text selection & highlighting in FLOSS ecosystem.

How about releasing another apk which doesn't have this feature?

@hwasiti
Copy link

hwasiti commented Jul 18, 2019

I don't have the time to regularly update mupdf to the newest version.

Btw,
What is the current mupdf version used in this code?

I have noticed that with MuPDF 1.12 and newer, you could making build easier. Here is the release notes copied from official release history:

MuPDF 1.12.0 (2017-12-13)

You can now download the 1.12.0 release.
MuPDF 1.12-rc1 (2017-11-23)

The release candidate for version 1.12 is now available!

This release has a new Android SDK which is easier to use.

These are the git repositories for the SDK projects:

    mupdf-android-fitz.git has the JNI bindings in a library.
    mupdf-android-viewer.git has the viewer as an activity in a library.
    mupdf-android-viewer-mini.git has the minimalist viewer as an activity in a library. 

There are binary packages for these libraries in our Maven repository:

    com.artifex.mupdf:fitz:1.12.+
    com.artifex.mupdf:viewer:1.12.+
    com.artifex.mupdf:mini:1.12.+ 

Color Management:

    LCMS2 library for color management.
    CMYK rendering with overprint simulation.
    Spot color rendering.
    Transparency rendering fixes. 

Structured text output improvements:

    Reworked structured text API.
    Faster text searching.
    Highlight and copy text by selecting lines instead of by area.
    New semantic XHTML output format.
    New layout preserving HTML output format. 

Features and improvements:

    Improved non-AA rendering with new scan converter.
    Improved LARGEFILE support.
    Improved TIFF support.
    Improved documentation.
    PCLm output.
    PSD output.
    New "mutool trace" tool.
    New "mutool sign" tool (work in progress).
    Text redaction (work in progress). 

Lots of bug fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants