I have a simple requirement to find and replace text in pdf. I try with below code. Just add a label and try to modify the label. However the element collection seems to be empty. Any idea on this.
Is there any better idea for FIND AND REPLACE TEXT in pdf? Please let me know.
/*Add a label element*/
MergeDocument document = new MergeDocument();
Page page = new Page(PageSize.Letter, PageOrientation.Portrait);
page.Elements.Add(new Label("Cover Page", 0, 0, 512, 12));
document.Pages.Add(page);
document.Draw(@"Output.pdf");
/*Try to read modify the label element. However the elements collection is empty*/
MergeOptions options = new MergeOptions(false);
MergeDocument document1 = new MergeDocument(@"Output.pdf", options);
ceTe.DynamicPDF.Page page1 = document1.Pages[0];
var elements = page1.Elements;
Console.ReadKey();