I'm trying to update hyperlinks in pdf files using c# and iTextSharp.
I've reached the point where I can get the hyperlinks, reset them to what I need, but cannot find out how to change the text related to the link.
This code gets the text that is displayed,
var LinkLocation = AnnotationDictionary.GetAsArray(PdfName.RECT);
iTextSharp.text.Rectangle rect = new iTextSharp.text.Rectangle(((PdfNumber)LinkLocation).FloatValue, ((PdfNumber)LinkLocation).FloatValue, ((PdfNumber)LinkLocation).FloatValue, ((PdfNumber)LinkLocation).FloatValue);
RenderFilter renderFilter = new RenderFilter;
renderFilter = new RegionTextRenderFilter(rect);
ITextExtractionStrategy textExtractionStrategy = new FilteredTextRenderListener(new LocationTextExtractionStrategy(), renderFilter);
string linkTextBuilder = PdfTextExtractor.GetTextFromPage(R, i, textExtractionStrategy).Trim();
but as it only returns a string I have no object to access to set the text. I've searched extensively and it seems I could try and find the rectangle the link text is in and change that, but my new text may be a different length and may affect the pdf layout.