Text
テキスト API
Aspose.PDF の Java 用 FOSS は、利用ケースに応じて複数の API を通じてテキスト処理を提供します。
FormattedText
FormattedText は、スタンプや注釈で使用するスタイル付きテキストを表します。フォント、サイズ、カラーのプロパティとともにテキスト文字列をカプセル化します。
テキスト置換
PdfContentEditor.replaceText() は PDF コンテンツストリーム内のテキスト文字列を置換します:
try (PdfContentEditor editor = new PdfContentEditor()) {
editor.bindPdf("input.pdf");
editor.replaceText("old text", "new text");
editor.save("output.pdf");
}TextReplaceOptions は、テキストのマッチングと置換の実行方法に対する追加の制御を提供します。
テキスト抽出
PdfExtractor はページ単位のテキスト抽出 API を提供します。extractText() を呼び出した後、hasNextPageText() / getNextPageText() で反復します。
参照してください Facades 完全なページ PdfExtractor 例。