I have an HP printer/scanner at home that my wife and I use surprisingly often, certainly more often than we might think. For the most part it works just fine and it gets the job done, but I do have a couple of complaints about it. One of the bigger ones is that when scanning multiple pages of a single document, I get one PDF per page and have no way of simply scanning in multiple pages to a single file. I also have to use some ugly web interface that’s not very accessible from my phone. In order to solve these problems, I made a small Android app that would allow me to scan multiple pages and then share them as a single PDF. Most of the time I want the scanned documents on my phone anyways so that I can send them to someone via email or WhatsApp so it works out quite nicely. I’ve tentatively called it Skerge (scan + merge + a "K" for Kotlin). Here are some screenshots of the app in action:
Upon opening the app, you’re presented with a simple view with instructions on how to use the app.
Once you tap the “+” button, the app requests a scan from the printer, and waits for it to complete.
When the scan is complete, a preview of the scanned image is displayed.
You can repeat the process multiple times to scan in additional pages.
When you’re finished scanning, you can tap the share button to merge the PDFs from the scanner into a single file and send to your app of choice.
There are still some issues and things to polish but for now at least it’s working and making it much easier for me to scan documents and send them off.
- I know HP has several apps for scanning, some of which might allow you to do this very thing. For some reason beyond me, however, they require you to create an account to use their apps. I’d like to not give away my data to companies that don’t need it.
- I haven’t yet implemented error dialogs, so if anything goes wrong, there’s a one minute timeout, after which the page is automatically removed.
- There’s no way to remove or reorder pages yet, so if you scan out of order or upside down or whatever, you have to start over.
- I’m still not sure why, but for some reason the merged PDF files are several times larger than they should be, based on the size of an individual scan. There also seems to be some quality loss. I’m sure there’s something I’m doing incorrectly with the merge, but I haven’t yet figured it out. This first edition doesn’t use any third-party libraries for the PDF interactions, only the built-in Android libraries, so I may need to look around for something a little more robust (and simpler to use).
- The entire codebase is written in Jetpack Compose 🚀
- I was able to reverse engineer the networking calls made by the web app to figure out the requests I would need to make in order to get the app to talk to the scanner. Once I knew what requests I needed to make, it was just a matter of trial and error to get the app to work.
- I actually did write a couple of tests, mostly for parsing/serializing the XML needed to talk to the printer, but also to ensure I was extracting the correct data from the headers in the responses.
- My home printer’s hostname is hard-coded for now, so if you’d like to contribute a fix to make that editable, that would be cool 😎
- I have no design skills whatsoever, so if you’d like to contribute an icon for the app, that would also be much appreciated 🙌
- I’m not planning on publishing the app to Google Play at this time since it’s far too niche and I don’t want to deal with the negative reviews like “it doesn’t work with my printer”. The code is up on GitHub though, so feel free to check it out, use it if you also have an HP Envy 5000-series printer, or contribute fixes/support for your scanner!