Problem in displaying Link In PDF(Urgent)


I am showing link on PDF. It is working perfectly fine but for link

throw an error index out of the bound array.

My Code -->

string NewsLink = Convert.ToString(_oDSet.Tables[0].Rows[i][4]);if (IsNewsSource && !string.IsNullOrEmpty(Convert.ToString(NewsLink)))


Aspose.Pdf.Row _row6 = tbl1.Rows.Add();

Aspose.Pdf.Text tNewsLinkHeader = new Aspose.Pdf.Text(NewsLink , pdfStyle.StyleForNewsLink());

tNewsLinkHeader.IsHtmlTagSupported = true;tNewsLinkHeader.IsSpaced =


tNewsLinkHeader.Margin.Top = 0;

tNewsLinkHeader.Margin.Bottom = 0;

Aspose.Pdf.Cell _cell62 = _row6.Cells.Add(); _cell62.Alignment = Aspose.Pdf.AlignmentType.Left;

//_cell62.Padding = mrg;



Hello Gaurav,

I have tested the scenario using the following code snippet and I am unable to notice any problem. As per my understanding, the issue is not related to hyperlink. Can you please share the complete code snippet, so that we can test the scenario once again.


// Instantiate an object PDF class
Pdf pdf = new Pdf();
// add the section to PDF document sections collection
Aspose.Pdf.Section section = pdf.Sections.Add();

Aspose.Pdf.Table tbl1 = new Aspose.Pdf.Table();
Aspose.Pdf.Row _row6 = tbl1.Rows.Add();
Aspose.Pdf.Text tNewsLinkHeader = new Aspose.Pdf.Text();

//Add a text segment in the text paragraph
Segment segment2 = tNewsLinkHeader.Segments.Add("this is a web link");
//Assign a new instance of hyperlink to hyperlink property of segment
segment2.Hyperlink = new Aspose.Pdf.Hyperlink();
//Set the link type of the text segment to Web
segment2.Hyperlink.LinkType = HyperlinkType.Web;
//Set the URL of the web location to create a web link for the segment
segment2.Hyperlink.Url = "";

Aspose.Pdf.Cell _cell62 = _row6.Cells.Add();
_cell62.Alignment = Aspose.Pdf.AlignmentType.Left;

//Save the pdf document

The resultant PDF that I have generated using the above code is also in attachment, please take a look.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We apologize for your inconvenience.