Translate the entire repo to English (UI strings, README, CI, comments)
Prep for public distribution. All user-facing strings, the README, the Gitea workflow step names/comments and the keystore example are now English. Follow-up i18n (string resources + locale files) is tracked in #5. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
123
README.md
123
README.md
@@ -1,110 +1,117 @@
|
||||
# PaperScan
|
||||
|
||||
Een lokale, privacy-bewuste documentscanner voor Android. Scant papieren documenten
|
||||
met de camera, detecteert automatisch de randen, corrigeert het perspectief en bundelt
|
||||
meerdere pagina's in één PDF. Die PDF kun je delen via Android of rechtstreeks uploaden
|
||||
naar je zelf-gehoste **Paperless-ngx**.
|
||||
A local, privacy-conscious document scanner for Android. Scan paper documents with your
|
||||
camera, automatically detect the edges, correct the perspective, and bundle multiple pages
|
||||
into a single PDF. That PDF can be shared through Android or uploaded directly to your
|
||||
self-hosted **Paperless-ngx**.
|
||||
|
||||
**Alles gebeurt op het toestel.** Camerabeelden, randdetectie (OpenCV) en PDF-creatie
|
||||
verlaten je telefoon niet. De enige netwerkverbinding is de optionele upload naar de
|
||||
Paperless-server die jij zelf configureert. Er is geen AI of cloud-verwerking.
|
||||
**Everything happens on the device.** Camera frames, edge detection (OpenCV) and PDF
|
||||
creation never leave your phone. The only network connection is the optional upload to the
|
||||
Paperless server you configure yourself. There is no AI or cloud processing.
|
||||
|
||||
## Functies
|
||||
## Features
|
||||
|
||||
- 📷 Camerapreview met multi-page vastleggen (pagina na pagina toevoegen)
|
||||
- ✂️ Automatische randdetectie + perspectiefcorrectie (OpenCV), met handmatige hoekcorrectie
|
||||
- 🎨 Filters per pagina: kleur, grijstinten, zwart-wit (documentmodus)
|
||||
- 🔄 Pagina's draaien, herordenen en verwijderen
|
||||
- 📄 Export naar multi-page PDF (A4 of originele grootte)
|
||||
- ☁️ Directe upload naar Paperless-ngx **of** delen via het Android-deelmenu
|
||||
- 🔐 API-token versleuteld opgeslagen (Android Keystore / EncryptedSharedPreferences)
|
||||
- 📷 Camera preview with multi-page capture (add pages one by one)
|
||||
- ✂️ Automatic edge detection + perspective correction (OpenCV), with manual corner adjustment
|
||||
- 🎨 Per-page filters: color, grayscale, black & white (document mode)
|
||||
- 🔄 Rotate, reorder and delete pages
|
||||
- 📄 Export to a multi-page PDF (A4 or original size)
|
||||
- ☁️ Direct upload to Paperless-ngx **or** share via the Android share sheet
|
||||
- 🔊 Capture feedback: shutter sound (only when the ringer isn't silenced) + a brief flash
|
||||
- 🔐 API token stored encrypted (Android Keystore / EncryptedSharedPreferences)
|
||||
|
||||
## Tech
|
||||
|
||||
Kotlin · Jetpack Compose · CameraX · OpenCV (`org.opencv:opencv` via Maven) ·
|
||||
`PdfDocument` · OkHttp · DataStore. minSdk 26 (Android 8), target/compile SDK 35.
|
||||
|
||||
## Lokaal bouwen
|
||||
## Building locally
|
||||
|
||||
1. Open het project in **Android Studio** (Ladybug of nieuwer). Dit genereert automatisch
|
||||
de Gradle wrapper (`gradlew` + `gradle-wrapper.jar`).
|
||||
2. Sluit een toestel aan of start een emulator en druk op **Run**.
|
||||
1. Open the project in **Android Studio** (Ladybug or newer). This automatically generates
|
||||
the Gradle wrapper (`gradlew` + `gradle-wrapper.jar`).
|
||||
2. Connect a device or start an emulator and press **Run**.
|
||||
|
||||
Of vanaf de command line (na `gradle wrapper` één keer):
|
||||
Or from the command line (after `gradle wrapper` once):
|
||||
|
||||
```bash
|
||||
./gradlew assembleDebug # debug-APK, geen signing nodig
|
||||
./gradlew assembleRelease # release-APK, vereist signing (zie onder)
|
||||
./gradlew assembleDebug # debug APK, no signing required
|
||||
./gradlew assembleRelease # release APK, requires signing (see below)
|
||||
```
|
||||
|
||||
De release-APK verschijnt in `app/build/outputs/apk/release/`.
|
||||
The release APK ends up in `app/build/outputs/apk/release/`.
|
||||
|
||||
## Signing key aanmaken
|
||||
## Creating a signing key
|
||||
|
||||
Nodig voor release-builds (en dus voor updates die elkaar kunnen overschrijven).
|
||||
Required for release builds (and therefore for updates that can overwrite each other).
|
||||
|
||||
```bash
|
||||
keytool -genkey -v -keystore release.jks -keyalg RSA -keysize 2048 \
|
||||
-validity 10000 -alias paperscan
|
||||
```
|
||||
|
||||
Bewaar `release.jks` **veilig en buiten git** (staat al in `.gitignore`).
|
||||
Keep `release.jks` **safe and out of git** (already in `.gitignore`).
|
||||
|
||||
Voor lokale release-builds maak je een `keystore.properties` in de projectroot
|
||||
(zie `keystore.properties.example`):
|
||||
For local release builds, create a `keystore.properties` in the project root
|
||||
(see `keystore.properties.example`):
|
||||
|
||||
```properties
|
||||
storeFile=/pad/naar/release.jks
|
||||
storeFile=/path/to/release.jks
|
||||
storePassword=...
|
||||
keyAlias=paperscan
|
||||
keyPassword=...
|
||||
```
|
||||
|
||||
## Bouwen via Gitea Actions
|
||||
## Building via Gitea Actions
|
||||
|
||||
De workflow `.gitea/workflows/build.yml` bouwt een getekende release-APK bij elke
|
||||
versietag (`git tag v0.1.0 && git push --tags`) of via een handmatige run.
|
||||
The workflow `.gitea/workflows/build.yml` builds a signed release APK on every version tag
|
||||
(`git tag v0.1.0 && git push --tags`) or via a manual run, and publishes it as a **Release**
|
||||
with the APK attached as a downloadable asset.
|
||||
|
||||
Zet in je Gitea-repo onder **Settings → Actions → Secrets** deze secrets klaar:
|
||||
Add these secrets under **Settings → Actions → Secrets** in your Gitea repo:
|
||||
|
||||
| Secret | Inhoud |
|
||||
| Secret | Contents |
|
||||
| --- | --- |
|
||||
| `SIGNING_KEYSTORE_BASE64` | `base64 -w0 release.jks` (de keystore als base64) |
|
||||
| `SIGNING_STORE_PASSWORD` | wachtwoord van de keystore |
|
||||
| `SIGNING_KEY_ALIAS` | bv. `paperscan` |
|
||||
| `SIGNING_KEY_PASSWORD` | wachtwoord van de sleutel |
|
||||
| `SIGNING_KEYSTORE_BASE64` | `base64 -w0 release.jks` (the keystore as base64) |
|
||||
| `SIGNING_STORE_PASSWORD` | keystore password |
|
||||
| `SIGNING_KEY_ALIAS` | e.g. `paperscan` |
|
||||
| `SIGNING_KEY_PASSWORD` | key password |
|
||||
|
||||
De build gebruikt env-vars, dus er komt niets gevoeligs in de repo terecht. De APK
|
||||
komt als artifact `paperscan-release` beschikbaar bij de workflow-run.
|
||||
The build uses env vars, so nothing sensitive ends up in the repo.
|
||||
|
||||
> Zorg dat je Gitea Actions-runner Docker-images kan trekken (`mingc/android-build-box`).
|
||||
> The build runs in a container (`mingc/android-build-box`), so the Actions runner must be
|
||||
> **x86_64** — the Android build tools (aapt2) are x86_64-Linux only and won't run natively
|
||||
> on an ARM64 runner.
|
||||
|
||||
## Paperless-ngx instellen (in de app)
|
||||
## Setting up Paperless-ngx (in the app)
|
||||
|
||||
1. Maak in Paperless een API-token aan: **Instellingen → profiel → API-token**
|
||||
(of via `/api/token/`).
|
||||
2. Open in PaperScan het tandwiel → vul **server-URL** (bv. `https://paperless.thuis.lan`)
|
||||
en het **token** in → **Verbinding testen** → **Opslaan**.
|
||||
1. Create an API token in Paperless: **Settings → profile → API token** (or via `/api/token/`).
|
||||
2. In PaperScan, open the gear icon → enter the **server URL** (e.g. `https://paperless.home.lan`)
|
||||
and the **token** → **Test connection** → **Save**.
|
||||
|
||||
Gebruik bij voorkeur **https**; bij `http://` waarschuwt de app dat token en documenten
|
||||
onversleuteld over het netwerk gaan.
|
||||
Prefer **https**; with `http://` the app warns that the token and documents travel over the
|
||||
network unencrypted.
|
||||
|
||||
## Projectstructuur
|
||||
## Project layout
|
||||
|
||||
```
|
||||
app/src/main/java/eu/geyskens/pdfscan/
|
||||
├── PaperScanApp.kt # Application; laadt OpenCV native libs
|
||||
├── MainActivity.kt # Compose host + navigatie
|
||||
├── ScanViewModel.kt # scan-sessie, rendering, export, upload
|
||||
├── data/ # Page-model, ScanFilter, SettingsRepository
|
||||
├── PaperScanApp.kt # Application; loads OpenCV native libs
|
||||
├── MainActivity.kt # Compose host + navigation
|
||||
├── ScanViewModel.kt # scan session, rendering, export, upload
|
||||
├── data/ # Page model, ScanFilter, SettingsRepository
|
||||
├── scan/ # EdgeDetector, ImageProcessor, BitmapIo (OpenCV)
|
||||
├── pdf/ # PdfBuilder (multi-page PDF)
|
||||
├── paperless/ # PaperlessClient (OkHttp REST)
|
||||
├── paperless/ # PaperlessClient (OkHttp REST + task polling)
|
||||
└── ui/screens/ # Camera, Pages, Crop, Export, Settings
|
||||
```
|
||||
|
||||
## Roadmap / ideeën
|
||||
## Roadmap
|
||||
|
||||
- Live randdetectie-overlay tijdens het richten (nu bij vastleggen)
|
||||
- OCR-tekstlaag (bv. Tesseract) volledig on-device
|
||||
- Batch-import van bestaande foto's uit de galerij
|
||||
Tracked as issues in the repository:
|
||||
|
||||
- Live edge-detection overlay while aiming (like Microsoft Lens)
|
||||
- Internationalization: extract UI strings to resources + add translations
|
||||
- Batch import scans from the gallery
|
||||
|
||||
> OCR is intentionally **not** done on-device: Paperless-ngx already runs OCR (via
|
||||
> OCRmyPDF/Tesseract) when it consumes the uploaded document.
|
||||
|
||||
Reference in New Issue
Block a user