We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

doc.getRange().replace don't work in some case

Document doc = new Document(“d:/a/fetal3.doc”);

LayoutEnumerator enumerator = new LayoutEnumerator(doc);
//i need instance of LayoutEnumerator,so i created it ,but this seem to cause replacement failure
//if i do not construct LayoutEnumerator,replacement work as expected
FindReplaceOptions options = new FindReplaceOptions();
options.setReplacingCallback(new IReplacingCallback() {
public int replacing(ReplacingArgs target) throws Exception {
return 0;
doc.getRange().replace(Pattern.compile("\$(.?)\{(.*?)\}"), “”, options);
doc.save(“d:/a/fetal3.pdf”, SaveFormat.PDF);

A post was merged into an existing topic: doc.getRange().replace(reg,options) don’t work in some case