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
|
|
|
|
|
|
|
| 1 |
+
# PDF_TEXT_REINSERT_UI_PLAN — WP17 planning only
|
| 2 |
+
|
| 3 |
+
Workpackage: `WP17 — PDF text extraction reinsert UI planning only`
|
| 4 |
+
Repository: `solidprivacy-nl/scrub`
|
| 5 |
+
Status: completed planning/specification-only
|
| 6 |
+
Date: 2026-06-09
|
| 7 |
+
|
| 8 |
+
This document specifies a safe future UI plan for exposing the WP16 text-based PDF extraction helper.
|
| 9 |
+
|
| 10 |
+
No UI, code, tests, dependencies, export behavior, Scrub Key behavior, OCR, AI calls or cloud processing are changed by this plan.
|
| 11 |
+
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
## 1. Product decision
|
| 15 |
+
|
| 16 |
+
PDF text extraction may be exposed in the UI, but only in a narrow, explicitly limited form:
|
| 17 |
+
|
| 18 |
+
```text
|
| 19 |
+
PDF support may be exposed only as text-based PDF extraction to restored TXT output.
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
The future UI must not present this as full PDF reinsert. It must not imply layout preservation, legal completeness, visual fidelity or restored PDF generation.
|
| 23 |
+
|
| 24 |
+
Allowed future direction:
|
| 25 |
+
|
| 26 |
+
```text
|
| 27 |
+
PDF upload → local selectable-text extraction → existing Scrub Key reinsert → restored TXT preview/download only
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
DOCX remains the preferred document-level reinsert route.
|
| 31 |
+
|
| 32 |
+
Reasoning:
|
| 33 |
+
|
| 34 |
+
- DOCX is a document format where controlled document-level output is more realistic.
|
| 35 |
+
- PDF is a presentation/layout format, so extraction may lose order, structure, headers, footers, tables or columns.
|
| 36 |
+
- Text-based PDF support can still be useful when a user only has a PDF with selectable placeholders, but the output must be treated as a text convenience result, not as a reconstructed legal document.
|
| 37 |
+
|
| 38 |
+
Product decision:
|
| 39 |
+
|
| 40 |
+
```text
|
| 41 |
+
Expose only if the future implementation keeps the UI clearly limited, warning-heavy, local-only and TXT-only.
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## 2. Proposed user workflow
|
| 47 |
+
|
| 48 |
+
The future workflow should be:
|
| 49 |
+
|
| 50 |
+
1. User opens `Originele waarden terugzetten`.
|
| 51 |
+
2. User loads or pastes a Scrub Key.
|
| 52 |
+
3. User uploads a text-based PDF.
|
| 53 |
+
4. Scrub extracts selectable text locally.
|
| 54 |
+
5. Scrub reinserts values using the Scrub Key.
|
| 55 |
+
6. Scrub shows restored TXT preview.
|
| 56 |
+
7. Scrub offers restored TXT download only.
|
| 57 |
+
8. Scrub shows an audit report and warnings.
|
| 58 |
+
|
| 59 |
+
The UI must require a deliberate user action before reinsertion. Loading a Scrub Key or uploading a PDF must not automatically restore values.
|
| 60 |
+
|
| 61 |
+
Recommended processing model:
|
| 62 |
+
|
| 63 |
+
```text
|
| 64 |
+
active Scrub Key + uploaded PDF bytes
|
| 65 |
+
→ reinsert_pdf_text_bytes(pdf_bytes, active_scrub_key)
|
| 66 |
+
→ restored text/TXT + audit fields + warnings
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
The future implementation should reuse the WP16 helper. It must not create a second replacement engine.
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
## 3. UI placement
|
| 74 |
+
|
| 75 |
+
The future PDF text extraction UI must be placed only in:
|
| 76 |
+
|
| 77 |
+
```text
|
| 78 |
+
Originele waarden terugzetten
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
It must not appear in the `Anonimiseren` flow.
|
| 82 |
+
|
| 83 |
+
Suggested placement inside `Originele waarden terugzetten`:
|
| 84 |
+
|
| 85 |
+
```text
|
| 86 |
+
1. Scrub Key laden
|
| 87 |
+
2. Originele waarden terugzetten — geplakte tekst
|
| 88 |
+
3. TXT-bestand terugzetten
|
| 89 |
+
4. DOCX-bestand terugzetten
|
| 90 |
+
5. PDF-tekst terugzetten
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
Suggested future section label:
|
| 94 |
+
|
| 95 |
+
```text
|
| 96 |
+
PDF-tekst terugzetten
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
Suggested upload label:
|
| 100 |
+
|
| 101 |
+
```text
|
| 102 |
+
Upload een tekstgebaseerde PDF met placeholders
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
Suggested button label:
|
| 106 |
+
|
| 107 |
+
```text
|
| 108 |
+
Extraheer tekst en zet lokaal terug
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
Suggested preview label:
|
| 112 |
+
|
| 113 |
+
```text
|
| 114 |
+
Herstelde PDF-tekst
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
Suggested download label:
|
| 118 |
+
|
| 119 |
+
```text
|
| 120 |
+
Download herstelde tekst (.txt)
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
Suggested audit label:
|
| 124 |
+
|
| 125 |
+
```text
|
| 126 |
+
Controleverslag PDF-tekst terugzetten
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
The future UI should visually separate restored TXT download from scrubbed export/download controls. It must not be placed near `Download opgeschoonde bestanden` in a way that could confuse scrubbed output with restored sensitive output.
|
| 130 |
+
|
| 131 |
+
---
|
| 132 |
+
|
| 133 |
+
## 4. Required warnings
|
| 134 |
+
|
| 135 |
+
The future UI must show strong warnings before the action button and near the result area.
|
| 136 |
+
|
| 137 |
+
Required PDF limitation warning:
|
| 138 |
+
|
| 139 |
+
```text
|
| 140 |
+
Let op: PDF-tekstextractie is niet gegarandeerd volledig. Opmaak, kolommen, tabellen, kopteksten, voetteksten en leesvolgorde kunnen afwijken. Controleer de volledige herstelde tekst handmatig voordat u deze gebruikt of deelt.
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
Required sensitive-output warning:
|
| 144 |
+
|
| 145 |
+
```text
|
| 146 |
+
Let op: terugzetten herstelt originele gevoelige waarden. De uitvoer kan weer persoonsgegevens of vertrouwelijke informatie bevatten.
|
| 147 |
+
```
|
| 148 |
+
|
| 149 |
+
Required unsupported/OCR warning:
|
| 150 |
+
|
| 151 |
+
```text
|
| 152 |
+
Scans of image-only PDF's worden niet ondersteund. OCR is niet beschikbaar in deze versie.
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
Required output warning:
|
| 156 |
+
|
| 157 |
+
```text
|
| 158 |
+
Scrub maakt geen herstelde PDF. De uitvoer is alleen tekst/TXT.
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
Additional recommended caption:
|
| 162 |
+
|
| 163 |
+
```text
|
| 164 |
+
Deze stap wordt lokaal uitgevoerd met uw Scrub Key. Scrub gebruikt hiervoor geen AI, geen cloudverwerking en geen OCR.
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
The UI should avoid success language that implies completeness. Prefer:
|
| 168 |
+
|
| 169 |
+
```text
|
| 170 |
+
Tekst is lokaal geëxtraheerd en waar mogelijk teruggezet. Controleer het volledige resultaat handmatig.
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
Do not use wording such as:
|
| 174 |
+
|
| 175 |
+
```text
|
| 176 |
+
PDF succesvol hersteld
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
because that implies restored PDF fidelity.
|
| 180 |
+
|
| 181 |
+
---
|
| 182 |
+
|
| 183 |
+
## 5. Required audit fields
|
| 184 |
+
|
| 185 |
+
The future UI must show at least these audit fields:
|
| 186 |
+
|
| 187 |
+
- document type;
|
| 188 |
+
- extracted text length;
|
| 189 |
+
- restored value count;
|
| 190 |
+
- mapping item count;
|
| 191 |
+
- active item count;
|
| 192 |
+
- excluded item count;
|
| 193 |
+
- placeholders not found;
|
| 194 |
+
- unknown placeholders;
|
| 195 |
+
- duplicate placeholders;
|
| 196 |
+
- validation issues;
|
| 197 |
+
- unsupported reason;
|
| 198 |
+
- local-only status;
|
| 199 |
+
- AI-processing status;
|
| 200 |
+
- cloud-processing status;
|
| 201 |
+
- OCR-used status;
|
| 202 |
+
- PDF-output status.
|
| 203 |
+
|
| 204 |
+
Suggested Dutch rendering:
|
| 205 |
+
|
| 206 |
+
```text
|
| 207 |
+
Documenttype: <document_type>
|
| 208 |
+
Lengte geëxtraheerde tekst: <len(extracted_text)>
|
| 209 |
+
Aantal teruggezette waarden: <replacement_count>
|
| 210 |
+
Mappingregels totaal: <item_count>
|
| 211 |
+
Actieve mappingregels: <active_item_count>
|
| 212 |
+
Uitgesloten mappingregels: <excluded_item_count>
|
| 213 |
+
Niet gevonden placeholders: <placeholders_not_found>
|
| 214 |
+
Onbekende placeholders in tekst: <unknown_placeholders>
|
| 215 |
+
Dubbele placeholders in sleutel: <duplicate_placeholders>
|
| 216 |
+
Validatieproblemen: <validation_issues>
|
| 217 |
+
Niet-ondersteund reden: <unsupported_reason>
|
| 218 |
+
Lokaal uitgevoerd: ja/nee
|
| 219 |
+
AI-verwerking: ja/nee
|
| 220 |
+
Cloudverwerking: ja/nee
|
| 221 |
+
OCR gebruikt: ja/nee
|
| 222 |
+
PDF-uitvoer gemaakt: ja/nee
|
| 223 |
+
```
|
| 224 |
+
|
| 225 |
+
Expected safe values for a valid WP16-based future implementation:
|
| 226 |
+
|
| 227 |
+
```text
|
| 228 |
+
document_type = pdf_text
|
| 229 |
+
local_only = True
|
| 230 |
+
ai_processing = False
|
| 231 |
+
cloud_processing = False
|
| 232 |
+
ocr_used = False
|
| 233 |
+
pdf_output = False
|
| 234 |
+
```
|
| 235 |
+
|
| 236 |
+
The UI must display warnings when:
|
| 237 |
+
|
| 238 |
+
- `validation_issues` is not empty;
|
| 239 |
+
- `unsupported_reason` is present;
|
| 240 |
+
- `replacement_count` is zero;
|
| 241 |
+
- `unknown_placeholders` is not empty;
|
| 242 |
+
- `duplicate_placeholders` is not empty;
|
| 243 |
+
- `placeholders_not_found` is not empty;
|
| 244 |
+
- extracted text length is suspiciously low.
|
| 245 |
+
|
| 246 |
+
---
|
| 247 |
+
|
| 248 |
+
## 6. Unsupported cases
|
| 249 |
+
|
| 250 |
+
Each unsupported or risky case must produce a clear message and must not silently succeed.
|
| 251 |
+
|
| 252 |
+
### Scanned/image-only PDF
|
| 253 |
+
|
| 254 |
+
Expected behavior:
|
| 255 |
+
|
| 256 |
+
- Do not run OCR.
|
| 257 |
+
- Show unsupported warning.
|
| 258 |
+
- Do not offer restored output as successful.
|
| 259 |
+
|
| 260 |
+
Suggested message:
|
| 261 |
+
|
| 262 |
+
```text
|
| 263 |
+
Deze PDF bevat geen bruikbare tekstlaag of lijkt een scan/image-only PDF. Scans worden niet ondersteund omdat OCR niet beschikbaar is in deze versie.
|
| 264 |
+
```
|
| 265 |
+
|
| 266 |
+
### PDF with no usable text layer
|
| 267 |
+
|
| 268 |
+
Expected behavior:
|
| 269 |
+
|
| 270 |
+
- Mark as unsupported.
|
| 271 |
+
- Show the unsupported reason from the helper where available.
|
| 272 |
+
- Do not show a successful restored TXT result.
|
| 273 |
+
|
| 274 |
+
Suggested message:
|
| 275 |
+
|
| 276 |
+
```text
|
| 277 |
+
Geen bruikbare tekstlaag gevonden. Scrub kan alleen tekstgebaseerde PDF's verwerken en gebruikt geen OCR.
|
| 278 |
+
```
|
| 279 |
+
|
| 280 |
+
### Malformed PDF
|
| 281 |
+
|
| 282 |
+
Expected behavior:
|
| 283 |
+
|
| 284 |
+
- Show validation issue.
|
| 285 |
+
- Do not attempt fallback conversion.
|
| 286 |
+
- Do not call external services.
|
| 287 |
+
|
| 288 |
+
Suggested message:
|
| 289 |
+
|
| 290 |
+
```text
|
| 291 |
+
De PDF kan niet betrouwbaar worden gelezen. Controleer of het bestand een geldige PDF is.
|
| 292 |
+
```
|
| 293 |
+
|
| 294 |
+
### Encrypted/password-protected PDF
|
| 295 |
+
|
| 296 |
+
Expected behavior:
|
| 297 |
+
|
| 298 |
+
- Show validation issue or unsupported reason.
|
| 299 |
+
- Do not ask for or store passwords in WP18 unless separately approved.
|
| 300 |
+
- Do not attempt cloud unlocking or conversion.
|
| 301 |
+
|
| 302 |
+
Suggested message:
|
| 303 |
+
|
| 304 |
+
```text
|
| 305 |
+
Deze PDF lijkt beveiligd of versleuteld en kan niet lokaal worden uitgelezen in deze versie.
|
| 306 |
+
```
|
| 307 |
+
|
| 308 |
+
### PDF where text extraction returns very little text
|
| 309 |
+
|
| 310 |
+
Expected behavior:
|
| 311 |
+
|
| 312 |
+
- Show extracted text length.
|
| 313 |
+
- Warn that the result may be incomplete.
|
| 314 |
+
- Do not imply legal completeness.
|
| 315 |
+
|
| 316 |
+
Suggested message:
|
| 317 |
+
|
| 318 |
+
```text
|
| 319 |
+
Er is weinig tekst uit de PDF gehaald. Dit kan betekenen dat de PDF een scan is, een onbruikbare tekstlaag heeft of dat extractie onvolledig is. Controleer het resultaat handmatig.
|
| 320 |
+
```
|
| 321 |
+
|
| 322 |
+
### PDF where placeholders are split or changed
|
| 323 |
+
|
| 324 |
+
Expected behavior:
|
| 325 |
+
|
| 326 |
+
- Do not guess or fuzzy-match placeholders.
|
| 327 |
+
- Report mapped placeholders not found and/or unknown placeholders.
|
| 328 |
+
- Keep output as text only.
|
| 329 |
+
|
| 330 |
+
Suggested message:
|
| 331 |
+
|
| 332 |
+
```text
|
| 333 |
+
Sommige placeholders zijn mogelijk gesplitst of gewijzigd tijdens PDF-tekstextractie. Scrub zet alleen intacte placeholders terug en gokt niet.
|
| 334 |
+
```
|
| 335 |
+
|
| 336 |
+
### Unknown placeholders
|
| 337 |
+
|
| 338 |
+
Expected behavior:
|
| 339 |
+
|
| 340 |
+
- Show the list of unknown placeholders from the result.
|
| 341 |
+
- Warn that these placeholders are not in the active Scrub Key.
|
| 342 |
+
- Do not invent original values.
|
| 343 |
+
|
| 344 |
+
Suggested message:
|
| 345 |
+
|
| 346 |
+
```text
|
| 347 |
+
De PDF-tekst bevat placeholders die niet in de actieve Scrub Key staan. Deze waarden zijn niet teruggezet.
|
| 348 |
+
```
|
| 349 |
+
|
| 350 |
+
### Mapped placeholders not found
|
| 351 |
+
|
| 352 |
+
Expected behavior:
|
| 353 |
+
|
| 354 |
+
- Show placeholders from the Scrub Key that were not found in the extracted text.
|
| 355 |
+
- Warn that this may be caused by missing text, changed placeholders, split placeholders, or a wrong Scrub Key.
|
| 356 |
+
|
| 357 |
+
Suggested message:
|
| 358 |
+
|
| 359 |
+
```text
|
| 360 |
+
Niet alle mappingregels uit de Scrub Key zijn gevonden in de geëxtraheerde PDF-tekst. Controleer of de juiste Scrub Key is geladen en of de PDF-tekst volledig is geëxtraheerd.
|
| 361 |
+
```
|
| 362 |
+
|
| 363 |
+
---
|
| 364 |
+
|
| 365 |
+
## 7. Non-goals
|
| 366 |
+
|
| 367 |
+
The future PDF text reinsert UI must keep these out of scope unless a later workpackage explicitly approves them:
|
| 368 |
+
|
| 369 |
+
```text
|
| 370 |
+
full restored PDF output
|
| 371 |
+
OCR
|
| 372 |
+
PDF-to-DOCX reconstruction
|
| 373 |
+
cloud PDF conversion
|
| 374 |
+
AI-based extraction
|
| 375 |
+
layout preservation promises
|
| 376 |
+
batch PDF processing
|
| 377 |
+
real-data PDF test cases
|
| 378 |
+
automatic PDF rehydration
|
| 379 |
+
```
|
| 380 |
+
|
| 381 |
+
Also out of scope:
|
| 382 |
+
|
| 383 |
+
- automatic fuzzy placeholder repair;
|
| 384 |
+
- automatic password handling for encrypted PDFs;
|
| 385 |
+
- server-side Scrub Key storage;
|
| 386 |
+
- durable storage of restored PDF text;
|
| 387 |
+
- changes to existing scrubbed TXT/CSV/DOCX/PDF export/download semantics;
|
| 388 |
+
- changes to existing pasted-text, TXT or DOCX reinsert semantics;
|
| 389 |
+
- changes to Scrub Key import/export behavior.
|
| 390 |
+
|
| 391 |
+
---
|
| 392 |
+
|
| 393 |
+
## 8. Safety and privacy rules
|
| 394 |
+
|
| 395 |
+
The future implementation must preserve:
|
| 396 |
+
|
| 397 |
+
- local-only processing;
|
| 398 |
+
- no AI calls;
|
| 399 |
+
- no cloud processing;
|
| 400 |
+
- no OCR;
|
| 401 |
+
- no real personal data in tests;
|
| 402 |
+
- Scrub Key remains sensitive and must be protected;
|
| 403 |
+
- restored output may contain confidential data again.
|
| 404 |
+
|
| 405 |
+
User-facing safety position:
|
| 406 |
+
|
| 407 |
+
```text
|
| 408 |
+
Een Scrub Key maakt vervangen waarden lokaal herleidbaar. Dit is pseudonimisering, geen volledige anonimisering. Bewaar de sleutel lokaal en beveiligd. Deel de Scrub Key niet met AI-diensten of derden tenzij dat bewust en toegestaan is.
|
| 409 |
+
```
|
| 410 |
+
|
| 411 |
+
The future UI must make clear that restored TXT is sensitive output:
|
| 412 |
+
|
| 413 |
+
```text
|
| 414 |
+
Herstelde tekst kan weer originele persoonsgegevens, zaakgegevens of vertrouwelijke informatie bevatten.
|
| 415 |
+
```
|
| 416 |
+
|
| 417 |
+
The future UI must not store uploaded PDFs, Scrub Keys or restored TXT beyond normal in-session UI state unless a later approved storage/vault workpackage changes that policy.
|
| 418 |
+
|
| 419 |
+
---
|
| 420 |
+
|
| 421 |
+
## 9. Future implementation package
|
| 422 |
+
|
| 423 |
+
The safest next implementation workpackage, if approved, is:
|
| 424 |
+
|
| 425 |
+
```text
|
| 426 |
+
WP18 — PDF text extraction to restored TXT UI implementation
|
| 427 |
+
```
|
| 428 |
+
|
| 429 |
+
WP18 must not start inside WP17.
|
| 430 |
+
|
| 431 |
+
Recommended WP18 scope:
|
| 432 |
+
|
| 433 |
+
```text
|
| 434 |
+
Originele waarden terugzetten only
|
| 435 |
+
PDF upload
|
| 436 |
+
local text extraction via WP16 helper
|
| 437 |
+
restored TXT preview
|
| 438 |
+
restored TXT download
|
| 439 |
+
audit report
|
| 440 |
+
strong warnings
|
| 441 |
+
no PDF output
|
| 442 |
+
no OCR
|
| 443 |
+
no AI/cloud
|
| 444 |
+
```
|
| 445 |
+
|
| 446 |
+
Likely implementation files for WP18, if approved later:
|
| 447 |
+
|
| 448 |
+
```text
|
| 449 |
+
fix_streamlit_nested_expanders.py
|
| 450 |
+
tests/test_pdf_text_reinsert_ui_patch.py
|
| 451 |
+
```
|
| 452 |
+
|
| 453 |
+
WP18 should not edit `presidio_streamlit.py` directly unless the coordinator explicitly approves direct UI refactoring. The current project pattern uses `fix_streamlit_nested_expanders.py` for controlled patch-level UI integration.
|
| 454 |
+
|
| 455 |
+
Required future tests for WP18 should verify at least:
|
| 456 |
+
|
| 457 |
+
- the PDF UI appears only under `Originele waarden terugzetten`;
|
| 458 |
+
- the PDF UI does not appear in `Anonimiseren`;
|
| 459 |
+
- the UI imports or references the WP16 helper;
|
| 460 |
+
- the upload label is present;
|
| 461 |
+
- the action button is present;
|
| 462 |
+
- required warnings are present;
|
| 463 |
+
- restored TXT preview label is present;
|
| 464 |
+
- restored TXT download label is present;
|
| 465 |
+
- audit label is present;
|
| 466 |
+
- required audit fields are represented;
|
| 467 |
+
- no `Download herstelde PDF` label is introduced;
|
| 468 |
+
- no OCR wording suggests support;
|
| 469 |
+
- no AI/cloud behavior is introduced;
|
| 470 |
+
- existing pasted-text, TXT and DOCX reinsert labels remain present;
|
| 471 |
+
- existing scrubbed export/download labels remain unchanged;
|
| 472 |
+
- existing Scrub Key import/export behavior remains unchanged.
|
| 473 |
+
|
| 474 |
+
Validation for WP18 should include targeted UI patch tests and app verification after GitHub Actions and Hugging Face sync are green, because WP18 would change UI behavior.
|
| 475 |
+
|
| 476 |
+
---
|
| 477 |
+
|
| 478 |
+
## Final planning conclusion
|
| 479 |
+
|
| 480 |
+
PDF text extraction may be exposed in the UI only as a cautious TXT-only convenience workflow inside `Originele waarden terugzetten`.
|
| 481 |
+
|
| 482 |
+
The UI must be warning-heavy, audit-visible and explicit that:
|
| 483 |
+
|
| 484 |
+
- PDF extraction is not guaranteed complete;
|
| 485 |
+
- output is restored TXT/text only;
|
| 486 |
+
- restored output may contain sensitive/confidential values again;
|
| 487 |
+
- DOCX remains the preferred document-level reinsert route;
|
| 488 |
+
- full restored PDF output, OCR, PDF-to-DOCX reconstruction, cloud conversion and AI-based extraction remain out of scope.
|