I tried to add a hyper link on my pdf document. The code I used is given below.
Text conclusion = new Text();
conclusion.Margin.Left = 50;
conclusion.Margin.Right = 50;
Segment conPart1 = conclusion.Segments.Add("\n\n\nInformation Security Consulting would like to thank you for engaging our services.Please take a few moments of your time to complete our ");
conclusion.TextInfo = new TextInfo
{
FontName = "Calibri",
FontSize = 12,
IsTrueTypeFontBold = true,
IsTrueTypeFontItalic = true
};
Aspose.Pdf.Generator.Segment segment2 = conclusion.Segments.Add("survey");
segment2.Hyperlink = new Aspose.Pdf.Generator.Hyperlink();
segment2.Hyperlink.LinkType = Aspose.Pdf.Generator.HyperlinkType.Web;
segment2.Hyperlink.Url = "http://www.google.com";
segment2.TextInfo.IsUnderline = true;
segment2.TextInfo.Color = new Aspose.Pdf.Generator.Color("blue");
Aspose.Pdf.Generator.Segment segment3 = conclusion.Segments.Add(" at your convenience.\n\n\nThank you once again.");
segment3.TextInfo = new TextInfo{
FontName = "Calibri",
FontSize = 12,
IsTrueTypeFontBold = true,
IsTrueTypeFontItalic = true
};
sec1.Paragraphs.Add(conclusion);
//Section s = pdf1.Sections.Add();
//pdf1.Sections.Remove(s);
The results are weird. If i uncomment last two line and thus add a new page after the page containing the Hyperlink, It works fine otherwise it is not showing hyperlink just a text.
Not able to understand why this is showing like this. I am using VS 2010 with C# code.
Please help and update me on my mail amitburnwal.ggn@gmail.com
This message was posted using Page2Forum from Hyperlink to a Web Location - Aspose.Pdf for .NET