OCR to replace original

Hello!

I’d love to have the option that “OCR to searchable PDF” replaces the original item.

Use case: sometimes I already have taken reading notes / excerpts from a PDF and they point to it through wikilinks / URL field. And then I realized that the PDF textflow is crappy and I want to re-OCR.

Hope it’s clear enough.

If you use Wikilinks, it’s a question of naming the PDF, I think. But if you use an x-devonthink-item link … not possible. Those use unique IDs, which are not recycled.

1 Like

As a workaround, you can swap the data of the PDF files using a script.

-- This is a demonstrator. You need to modify this script for it to work.
tell application id "DNtp"
	set newData to (data of OCRedPDF)
	set (data of oldPDF) to newData
end tell
2 Likes

You could create a smart rule with the condition Kind is PDF and the action OCR > Apply. Then either drag & drop your PDFs onto the smart rule or use Tools > Apply Rules > …

@cgrunenberg, to be sure: “OCR > Apply” in a smart rule does replace original and “Data > OCR to searchable PDF” does not?

Data > OCR > to searchable PDF is identical to the smart rule action OCR > to searchable PDF, both create a new document.

Ok, so there’s no way to “OCR in place”, except for going the applescript way and replacing data.

See above, just use the OCR > Apply smart rule action.