Iterate through the collection and get a hyperlink text and URL.
The following example shows how to extract hyperlinks from the document page area:
// Create an instance of Parser classusing(Parserparser=newParser(filePath)){// Check if the document supports hyperlink extractionif(!parser.Features.Hyperlinks){Console.WriteLine("Document isn't supports hyperlink extraction.");return;}// Create the options which are used for hyperlink extractionPageAreaOptionsoptions=newPageAreaOptions(newRectangle(newPoint(380,90),newSize(150,50)));// Extract hyperlinks from the document page areaIEnumerable<PageHyperlinkArea>hyperlinks=parser.GetHyperlinks(options);// Iterate over hyperlinksforeach(PageHyperlinkAreahinhyperlinks){// Print the hyperlink textConsole.WriteLine(h.Text);// Print the hyperlink URLConsole.WriteLine(h.Url);Console.WriteLine();}}
More resources
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples: