An Open-Source Doc Scanner (Like Microsoft Lens / CamScanner) That Integrates with ODK Collect

Hello everyone! - Hope you're doing well! :waving_hand:

I wanted to share a small exploration I recently worked on, hoping it might be helpful to someone!

:green_circle: The "What & Why?" / Problem Statement

Recently, I was looking for an open-source document scanner app that could:

  • Use an Android phone's camera to scan documents,
  • Automatically Crop or Enhance Images / Generate a PDF, and
  • Attach that PDF directly to a specific ODK Collect form - ideally automatically because in practice, many data collectors struggle to remember which scanned file (or clicked image) belongs to which particular saved draft form. This often leads to incorrect attachments and, ultimately, incorrect submissions. Automating this hand-off felt like a meaningful improvement to me.

During my research, I came across this app: FairScan - a clean, respectful, open-source document scanner. While it worked well as a scanner, it didn't interact with ODK Collect in the way I was hoping it would (i.e., returning the scanned PDF back to ODK Collect automatically).

:green_circle: The "What I did?" / Solution

So, I experimented with making minimal changes to FairScan's codebase, using ODK Collect's documented intent-based integration, to allow the scanned PDF to be sent straight back to ODK Collect - and it worked exactly as intended! :partying_face:

For anyone interested in trying this out or exploring further, I'm including a demonstration, the GitHub repo for the minimal code I modified to make it work (contains built .apk files as well!), and a sample XLSForm below:

:white_small_square: Quick Demonstration [50 seconds]:

:white_small_square: GitHub Repo / Modified Source Code / Built .apk Files:

:link: Here!

:white_small_square: Sample XLSForm:

fileuploadtest.xlsx (8.3 KB)

That's all!

Have a great day! :smile: - and, Merry Christmas in advance! :christmas_tree:

6 Likes

That's great! I could see a lot of cases where that would be super useful.

Have you asked the FairScan maintainers if they would integrate your changes so the app store version would work rather than sideloading an apk?

5 Likes

Thank you so much!

That's a great suggestion, and it would indeed remove the need for sideloading the APK altogether. I've reached out to the FairScan's maintainer regarding this and will keep this thread updated as I hear back.

Appreciate the input - thanks again! :smile:

5 Likes