現在の Java PdfContentEditorExamples クラスは、以下の機能を直接サポートしています。
PdfContentEditorExamples
replaceTextSimple(...)
replaceTextWithState(...)