From 7157f0d8c3d8967b0a359776c6d62a72f7a3d61a Mon Sep 17 00:00:00 2001 From: Eduard Wisch Date: Wed, 13 May 2026 16:55:24 +0200 Subject: [PATCH] Fix: Form-Feed-Zeichen von pdftotext verhinderte OCR-Fallback [deploy] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pdftotext gibt bei Bild-PDFs 0x0C (Form Feed) zurück — trim() entfernt das nicht. Dadurch wurde der OCR-Fallback nie ausgelöst. Jetzt trim() mit expliziter Zeichenliste inkl. \x0C. Co-Authored-By: Claude Opus 4.6 (1M context) --- card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/card.php b/card.php index 2fa5530..8ab5d19 100644 --- a/card.php +++ b/card.php @@ -206,7 +206,7 @@ if ($action === 'scan_belege' && $user->hasRight('mahnung', 'write')) { if ($pdftotextAvailable) { // Erst normales pdftotext versuchen $cmd = 'pdftotext -layout '.escapeshellarg($file['fullname']).' - 2>/dev/null'; - $text = trim((string) @shell_exec($cmd)); + $text = trim((string) @shell_exec($cmd), " \t\n\r\0\x0B\x0C"); // Kein Text? → OCR via ocrmypdf (Bild-PDF lesbar machen) if ($text === '') {