Quantcast
Viewing all articles
Browse latest Browse all 3131

How to add link to text to a merged document

I am trying to add text and want to link it to a specific page - document will be merged later on in the code. I tried adding this code, but it doesn't work,

var pdf = new Aspose.Generator.Pdf();
 // here adding a section to it
// here adding a table, a row and a cell to it

 Text linkText = new Text();
 Segment linkSegment = linkText.Segments.Add("Future Document Name");

// Above document will be added to this pdf after converting it to a document but later in code

 linkSegment.Hyperlink = new Aspose.Pdf.Generator.Hyperlink();
 linkSegment.Hyperlink.LinkType = Aspose.Pdf.Generator.HyperlinkType.Local;
 linkSegment.Hyperlink.LinkPageNumber = 76; 


It adds link but link doesn't take user to any page at all in last generated document.

I also tried 
http://www.aspose.com/docs/display/pdfnet/hyperlinks+to+pages+in+the+same+pdf+document

But how can I add id to a document object ? as it's readonly.

Viewing all articles
Browse latest Browse all 3131

Trending Articles