外部フィールドのコピー
Contents
[
Hide
]
別の PDF からフィールドのコピー
- 少なくとも 1 ページの宛先 PDF を作成してください。
- 宛先 PDF を
FormEditorファサードにバインドしてください。 copyOuterField(...)を、ソースドキュメントのパス、フィールド名、対象ページ、座標を引数として呼び出してください。- 更新された宛先ドキュメントを保存してください。
public static void copyOuterField(Path inputFile, Path outputFile) {
try (Document document = new Document()) {
document.getPages().add();
document.save(outputFile.toString());
}
FormEditor editor = new FormEditor();
try {
editor.bindPdf(outputFile.toString());
editor.copyOuterField(inputFile.toString(), "First Name", 1, 200, 600);
editor.save(outputFile.toString());
} finally {
editor.close();
}
}