A hyperlink is a piece of text or an image or icon that points to an entire document or to a particular part within a document. The use of hyperlinks allows users to navigate to a web page or document. It is often required to extract hyperlinks from a document and use it to access external document or webpage. GroupDocs.Parser for .NET is a fascinating document text extraction API that provides complete functionality for implementing text and metadata extraction solutions. It supports text & hyperlinks extraction from PDF, Emails, Ebooks, Microsoft Office formats: Word (DOC, DOCX), PowerPoint (PPT, PPTX), Excel (XLS, XLSX), LibreOffice formats and many more. It supports several advanced features for documents parsing, extracting plain and structured text, text searching by keywords, extract metadata or images, containers as well as attachments and many more.
GroupDocs.Parser for .NET makes it easy for C# developers to extract hyperlinks from a OTP file by implementing a few easy steps.
// Extract hyperlinks from OTP file using GroupDocs.Parser API
// Create an instance of Parser class
using (Parser parser = new Parser(filePath)) {
// Check if the document supports hyperlink extraction
if (!parser.Features.Hyperlinks) {
Console.WriteLine("Document isn't supports hyperlink extraction.");
return;
}
// Extract hyperlinks from the document
IEnumerable<PageHyperlinkArea> hyperlinks = parser.GetHyperlinks();
// Iterate over hyperlinks
foreach (PageHyperlinkArea h in hyperlinks) {
// Print the hyperlink text
Console.WriteLine(h.Text);
// Print the hyperlink URL
Console.WriteLine(h.Url);
Console.WriteLine();
}
}
GroupDocs.Parser for .NET APIs are supported on all major platforms and operating systems. Before executing the code below, please make sure that you have the following prerequisites installed on your system.
.NET documents parse & hyperlinks extraction API for file formats and images. Extract data for some of the popular file formats as stated below.
(Portable Document Format)
(PowerPoint Slide Show)
(PowerPoint Slide Show)
(Microsoft PowerPoint 97-2003)
(Open XML presentation Format)
(Rich Text Format)
(LaTeX Source Document)
(The 7th Guest Video File)
(Visio Macro-Enabled Drawing)
(Visio Drawing)
(Visio Macro-Enabled Stencil File)
(Visio Stencil File)
(Visio Macro-Enabled Drawing Template)
(Visio Drawing Template)
(Visio Stencil XML File)
(Anim8or 3D Model)