Excel to PDF is not preserving the links completely

@John.He ,

foreach (var textFragment in textFragmentCollection)
{
    
    var text = textFragment.Text;
    //var str = string.Empty;
    textFragment.Text = string.Empty;
    if (text.Contains("\r\n"))
    {
        text = text.Replace("\r\n", "").Replace("[", "").Replace("]", "");
    }
    else
    {
        text = text.Replace("[", "").Replace("]", "");
    }
 textFragment.Text = text;
Console.WriteLine($"Text Fragment :{textFragment.Text}");
    textFragment.TextState.ForegroundColor = foregroundColor;
    textFragment.TextState.BackgroundColor = backgroundColor;
}

textFragments initial value is “[Reas\r\non]”. I would like to replace square braces with empty string.

textFragment.Text = text;

it does not allow me to override textFragments.Text value with text and throws the above mentioned exception.

@shreyap
It seems that you are using Aspose.PDF to modify the pdf file. I am moving your thread to respective Aspose.PDF section where Aspose.PDF staff member will assist you accordingly soon.

@John.He
Quicker response is appreciated. This issue seems to be a blocker for us.
Thanks in advance

@shreyap

We could not find any PDF in this forum thread that has text enclosed in square brackets. Could you please share that PDF file with us so that we can try to replicate the exception in our environment and address it accordingly?