I am trying to do some simple text replacement in a PDF file using Acrobat. Specifically, I want to do some simple transliteration of words or partial transliteration. For instance, I would like to change a word like "red" to "ρed". This is to help me get used to the Greek alphabet step by step.
thanks if you can help
JS can't edit the text in a PDF file directly. There are workarounds, like
using a redaction with overlay text or simply placing a new field or
annotation on top of the old text with the new one, but they are all far
from perfect and won't cause a "reflow" of the document, so if the two
texts are not of the same length the result will look odd. Also there's the
issue of which font to use (font family, color, size, etc.), which JS can't
know so you'll have to tell it.
PDF is fundamentally unsuited to this, because you would need reflow and the information to do that doesn't exist. You'll notice that Acrobat has no search and replace for the same reason.
A way to approach this would be to copy/paste to Word. You can do your changes manually; Word also has its own API.