Detect broken font encodings and flag for OCR fallback
Add has_encoding_issues field to PdfProcessResult that detects garbled text from broken ToUnicode CMaps (U+FFFD replacement characters or systematic dollar-as-space substitution). Surfaced in JSON output so clients can fall back to OCR for affected PDFs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a7dbb16e86
commit
8725e2b487
@@ -950,6 +950,7 @@ fn test_pages_needing_ocr_field_accessible() {
|
||||
title: None,
|
||||
confidence: 1.0,
|
||||
layout: pdf_inspector::LayoutComplexity::default(),
|
||||
has_encoding_issues: false,
|
||||
};
|
||||
assert_eq!(process_result.pages_needing_ocr, vec![1, 3]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user