Hello - Is it possible to search for a term and then add a bookmark on the found terms?
Thank you,
Stan
PdfDocument doc = new PdfDocument(@"F:\Sample.pdf");
PdfTextFind[] result = null;
foreach (PdfPageBase p in doc.Pages)
{
result = p.FindText("word").Finds;
foreach (PdfTextFind find in result)
{
//get the text position
PointF location = find.Position;
//add the bookmark according to the position
PdfBookmark BookMark = doc.Bookmarks.Add("Bookmark1");
PdfDestination BookmarkDest = new PdfDestination(p, location);
BookMark.Action = new PdfGoToAction(BookmarkDest);
}
}
doc.SaveToFile("9922.pdf", FileFormat.PDF);