Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I am using the function replaceText() for a pdf document. The pdf contains the word "test". I tried to replace the string test by the word "replaced" but i didn't success. But when searching for "replaced" it highlights the word "text".
I used the below code. Please i need help here or more clarification. I need to change a word inside a pdf file. What is the best way to do it using Aspose.
package samples.contentEditor;
import com.aspose.pdf.kit.*;
public class ReplaceText {
public ReplaceText() {
}
public static void main(String args[]) throws Exception {
try {
PdfContentEditor editor = new PdfContentEditor();
editor.bindPdf("C:\\Documents and Settings\\Ever\\Desktop\\abc\\Scan-Family Wealth-18AUG_searchable_searchable.pdf");
editor.replaceText("test", "replaced");
editor.save("C:\\Documents and Settings\\Ever\\Desktop\\abc\\Scan-Family Wealth-18AUG_searchable_searchable.pdf");
} catch (java.io.IOException ioe) {
System.out.println(ioe.getMessage() + ioe.getStackTrace());
}
}
}