Free Support Forum - aspose.com

Email hyperlink

Hello,
how can I create a hyperlink to an email like in the image below? image.png (2.2 KB)

@mpogorelov

Please use following code snippet in order to add required link in your PDF:

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
Aspose.Pdf.Page page = doc.Pages.Add();
TextFragment textFragment = new TextFragment("msooy@hvac.mea.com");
textFragment.TextState.Underline = true;
textFragment.TextState.ForegroundColor = Color.Blue;
textFragment.Hyperlink = new Aspose.Pdf.WebHyperlink("mailto:msooy@hvac.mea.com");
page.Paragraphs.Add(textFragment);
doc.Save(dataDir + @"Hyperlink.pdf");

Hyperlink.pdf (2.1 KB)

1 Like