using System;
using GroupDocs.Parser;
using GroupDocs.Parser.Data;
using System.Collections.Generic;

namespace ExtractHyperlinksfromPPTusingCSharp
{
    internal class Program
    {
        static void Main(string[] args)
        {
            // Apply the license to remove the restrictions imposed by the Parser library
            License lic = new License();
            lic.SetLicense(@"GroupDocs.Parser.lic");

            // Create an instance of the Parser class to access its methods
            // and properties for data processing or manipulation.
            using (Parser parser = new Parser("input.ppt"))
            {
                // 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();
                }
                Console.ReadLine();
            }
        }
    }
}