Example #1
0
		private void ProcessLinkClicked(PdfLink pdfLink, PdfWebLink webLink)
		{
			var args = new PdfBeforeLinkClickedEventArgs(webLink, pdfLink);
			OnBeforeLinkClicked(args);
			if (args.Cancel)
				return;
			if (pdfLink != null && pdfLink.Destination != null)
				ProcessDestination(pdfLink.Destination);
			else if (pdfLink != null && pdfLink.Action != null)
				ProcessAction(pdfLink.Action);
			else if (webLink != null)
				Process.Start(webLink.Url);
			OnAfterLinkClicked(new PdfAfterLinkClickedEventArgs(webLink, pdfLink));

		}
        /// <summary>
        /// PDF link annotation constructor
        /// </summary>
        /// <param name="Page">Associated page</param>
        /// <param name="AnnotRect">Annotation rectangle</param>
        /// <param name="WebLink">Weblink</param>
        public PdfAnnotation(
			PdfPage				Page,
			PdfRectangle		AnnotRect,
			PdfWebLink			WebLink
			)
            : base(Page.Document)
        {
            // annotation subtype
            Dictionary.Add("/Subtype", "/Link");

            // action reference dictionary
            Dictionary.AddIndirectReference("/A", WebLink);

            // constructor helper method
            ContructorHelper(Page, AnnotRect);

            // exit
            return;
        }