Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Nov 11, 2014 5:19 pm

Hello, I am having some trouble getting mailto links to work in a pdf that i a a generating. I can get regular links to work fin and my research leads me to believe that mailto links can work in pdfs, I just can't get them to work when I make the pdf with Spire,pdf. If this is a known limitation of if there is a different way that you have to make the links in order for mailto links to work that would be useful to know. Any information is appreciated.

Cian.Butterfield
 
Posts: 1
Joined: Tue Nov 11, 2014 5:14 pm

Wed Nov 12, 2014 7:35 am

Hello,

Thanks for your inqury. You could use the following method to create a mailto link in pdf.
Code: Select all
PdfDocument pdfdoc = new PdfDocument();
PdfPageBase page = pdfdoc.Pages.Add();
PdfTextWebLink link = new PdfTextWebLink();
link.Text = "contact us";
link.Url = "mailto:support@e-iceblue.com";
link.Font =  new PdfTrueTypeFont(new Font("Arial", 12, FontStyle.Regular));
link.Brush = PdfBrushes.DarkSeaGreen;
link.DrawTextWebLink(page.Canvas, new PointF(0, 0));
pdfdoc.SaveToFile("DrawLink.pdf",FileFormat.PDF);

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.PDF