Replace pdf text in PageMaster

I have been searching for a way to automatize replacing pdf text via command-line, but was unsuccesfull to find anything that could get the job done.
The only thing for replacing text I found was demo code where it replaces whole chunks of text and replaces them with other chunk (which is pretty useless to me, if I can’t get what’s inside that textbox) and other demo where is replace/replace all option, which worked luckily only once and since then kept throwing an error.
I found that PageMaster is used for command-line operations, but as far as I know, it can’t do any advanced operations like text editing or replacing.
Is there some way to accomplish text replacing via command-line in PDF PageMaster or some workaround?