PDFBox 2.0 RC3 — Find and replace text
问题 How can one find and replace text inside a PDF document using PDFBox 2.0, they pulled the old example and it's syntax no longer works so I am wondering if it's still possible and if so what the best way to go about it is. Thanks! 回答1: You can try like this: public static PDDocument replaceText(PDDocument document, String searchString, String replacement) throws IOException { if (Strings.isEmpty(searchString) || Strings.isEmpty(replacement)) { return document; } PDPageTree pages = document