You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2d7efcc
Browse filesBrowse the repository at this point in the historyBrowse files
M10: Searchable Image drops stale results, reports signed documents once and says it is destructive
Review of storytold#5126:
- ocr_recognize and ocr_recognize_files advertise destructiveHint: downsampling
throws image detail away, and the multi-file tool replaces a same-named file
in its folder (the input itself, given its own folder), with downsampled as a
full rewrite. The descriptions say so, and that images is absent when no page
was read.
- Every Recognize Text run now records the document's edit generation, not
only Edit's automatic one: a result that arrives after the document changed
(a page moved or deleted) is dropped and the user is told, instead of adding
words to and downsampling the page that now has the old index.
- A signed document's refusal is ScanImages::refused, one reason for the
document, not an entry in skipped, so the summary no longer reports it as
"1 left as they are"; the toast and the multi-file summary say the signed
document(s) kept their images.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
t("js_enabled","JavaScript on or off","Preferences ▸ JavaScript ▸ Enable Acrobat JavaScript: set it with `enabled`, or read it. With JavaScript off, field scripts other than Acrobat's AF calls don't run.")
t("ocr_recognize","Recognize text (OCR)","Scan & OCR ▸ Recognize text: render pages, read the words in them and add them as invisible text over the page image, so scanned pages become searchable and selectable. output \"exact\" (default, Searchable Image (Exact)) leaves the page images exactly as they are; \"downsampled\" (Searchable Image) also resamples the images on the pages that were read down to dpi where they are finer (more than 5% above), in place and in the same undo step: same object and placement (the new text still lines up), colour space, decode array and masks kept, JPEG stays JPEG, black-and-white stays 1-bit and lossless; images that can't be handled (CMYK, indexed, 16-bit, JPEG 2000, JBIG2, CCITT, colour-key masks) are left alone and listed under images.skipped with why. Pages that already have text are skipped unless skip_text_pages or force_ocr say otherwise; words overlapping existing text are omitted and counted as already_on_page. With output_mode \"editable\" nothing is applied: a NEW document of visible text at the recognised boxes is written to out (which must not be the source; empty pages stay blank). engine and strategy choose the readers (an engine that cannot run is an error named up front); the four preprocessing flags clean the raster first. region reads just that part of one page ([x0, y0, x1, y1] in points from the top-left of the displayed page). Returns each page's recognised text, word count or why it was skipped. Needs the engines (ocr_status). Searchable output is undoable as one step.")
1526
+
t("ocr_recognize","Recognize text (OCR)","Scan & OCR ▸ Recognize text: render pages, read the words in them and add them as invisible text over the page image, so scanned pages become searchable and selectable. output \"exact\" (default, Searchable Image (Exact)) leaves the page images exactly as they are; \"downsampled\" (Searchable Image) also resamples the images on the pages that were read down to dpi where they are finer (more than 5% above), in place and in the same undo step: same object and placement (the new text still lines up), colour space, decode array and masks kept, JPEG stays JPEG, black-and-white stays 1-bit and lossless; images that can't be handled (CMYK, indexed, 16-bit, JPEG 2000, JBIG2, CCITT, colour-key masks) are left alone and listed under images.skipped with why; a signed document keeps all its images and says why under images.refused. The detail removed is gone once the document is saved, and that save is a full rewrite (the earlier revisions leave the file). images is absent when no page was read (every page skipped, e.g. because each already has text). Pages that already have text are skipped unless skip_text_pages or force_ocr say otherwise; words overlapping existing text are omitted and counted as already_on_page. With output_mode \"editable\" nothing is applied: a NEW document of visible text at the recognised boxes is written to out (which must not be the source; empty pages stay blank). engine and strategy choose the readers (an engine that cannot run is an error named up front); the four preprocessing flags clean the raster first. region reads just that part of one page ([x0, y0, x1, y1] in points from the top-left of the displayed page). Returns each page's recognised text, word count or why it was skipped. Needs the engines (ocr_status). Searchable output is undoable as one step.")
"deskew":{"type":"boolean","description":"Straighten skewed text lines before reading (default false)."},
1544
1545
"denoise":{"type":"boolean","description":"A 3×3 median filter against scan speckle (default false)."},
1545
1546
"binarize":{"type":"boolean","description":"Sauvola binarization: ink to black, paper to white (default false)."},
1546
-
"output":{"type":"string","enum":["exact","downsampled"],"description":"exact (default): the page images are not changed. downsampled: images on the pages read are reduced to dpi where they are finer; the result carries an images report."},
1547
+
"output":{"type":"string","enum":["exact","downsampled"],"description":"exact (default): the page images are not changed. downsampled: images on the pages read are reduced to dpi where they are finer; the result carries an images report unless no page was read."},
t("ocr_recognize_files","Recognize text in multiple files","Scan & OCR ▸ Recognize text ▸ In multiple files: read every page of each PDF in paths and write the searchable result into folder under the same name. skip_text_files leaves whole files that already contain text alone (they are their own skipped bucket, nothing is written); skip_text_pages leaves single text pages alone; force_ocr reads regardless of both. Every output name is checked before the first page is read: two paths sharing a file name (from different folders) are refused, and a file of that name already in folder aborts the batch, with the names in the error. Each written file carries a low_confidence note when words at or under 60 confidence sit on it (1-based sorted pages). Returns, per file, the output path, word count, skipped pages or the error, plus recognized/words/skipped_files totals. Needs the engines (ocr_status).")
1580
+
t("ocr_recognize_files","Recognize text in multiple files","Scan & OCR ▸ Recognize text ▸ In multiple files: read every page of each PDF in paths and write the searchable result into folder under the same name. skip_text_files leaves whole files that already contain text alone (they are their own skipped bucket, nothing is written); skip_text_pages leaves single text pages alone; force_ocr reads regardless of both. Every output name is checked before the first page is read: two paths sharing a file name (from different folders) are refused, and a file of that name already in folder aborts the batch, with the names in the error. With output downsampled a written file is a full rewrite, without the input's earlier revisions or the detail its images lost. Each written file carries a low_confidence note when words at or under 60 confidence sit on it (1-based sorted pages). Returns, per file, the output path, word count, skipped pages or the error, plus recognized/words/skipped_files totals. Needs the engines (ocr_status).")
"output":{"type":"string","enum":["exact","downsampled"],"description":"As in ocr_recognize (default exact); with downsampled each file reports images."},
1598
+
"output":{"type":"string","enum":["exact","downsampled"],"description":"As in ocr_recognize (default exact); with downsampled each file reports images, unless none of its pages was read."},
skipped:vec!["the document is signed: its images are left as they are, since a smaller file needs a full rewrite, which would break the signatures".into()],
1070
+
refused:Some("the document is signed: its images are left as they are, since a smaller file needs a full rewrite, which would break the signatures".into()),
1071
1071
..Default::default()
1072
1072
});
1073
1073
if edits.is_empty(){
@@ -2532,6 +2532,28 @@ mod tests {
2532
2532
assert_eq!(s.get(id).unwrap().can_undo(),None);
2533
2533
}
2534
2534
2535
+
/// A signed document keeps its images, and the report gives the reason once for the
2536
+
/// document, not as an image of its own left as it is: `skipped` lists images only.
0 commit comments