←Select platform

ParseLinks Method

Summary

Parses the links found in this DocumentText.

Syntax

C#
VB
Java
C++
public IList<DocumentLink> ParseLinks( 
   IList<Regex> linkPatterns 
) 
Public Function ParseLinks( 
   ByVal linkPatterns As System.Collections.Generic.IList(Of System.Text.RegularExpressions.Regex) 
) As System.Collections.Generic.IList(Of Leadtools.Documents.DocumentLink) 
public:  
   System::Collections::Generic::IList<Leadtools::Documents::DocumentLink^>^ ParseLinks( 
      System::Collections::Generic::IList<System::Text::RegularExpressions::Regex^>^ linkPatterns 
   ) 
public List<DocumentLink> parseLinks(List<Pattern> linkPatterns) 

Parameters

linkPatterns

A list of System.Text.RegularExpressions.Regex objects to use for parsing the links.

Return Value

A list of the links parsed.

Remarks

If the value of DocumentText.AutoParseLinks is true, then the document will call ParseLinks for each page after the first time the text is obtained using DocumentPage.GetText.

The value of LinkPatterns. The result links (if any) will be merged with any existing links found in the page (for example, internal page links parsed through DocumentStructure or user defined-links and can be accessed through DocumentPage.GetLinks.

This method will run the regular expressions passed and adds any matches found as a value of type DocumentLink with DocumentLink.LinkType equals to DocumentLinkType.Value, DocumentLink.Value set to the matching text, and DocumentLink.Bounds set to the bounding rectangle of the match in page units.

If more than one match occurs for a regular expression, then this method will use the match that has the longest length. For example, if the text contains the string mailto:name@domain.com, and the regular expression list found a match for the whole string (from a URL regular expression matcher) and the email part only (from an email regular expression matcher), then the first match is used since it contains a longer value and the second one is discarded.

Refer to AutoParseLinks for more information.

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Documents Assembly