diff --git a/PROMS/Volian.Svg.Library/iTextSharp.cs b/PROMS/Volian.Svg.Library/iTextSharp.cs index 2f6068bf..10be53e5 100644 --- a/PROMS/Volian.Svg.Library/iTextSharp.cs +++ b/PROMS/Volian.Svg.Library/iTextSharp.cs @@ -765,8 +765,22 @@ namespace Volian.Svg.Library text = Regex.Replace(text, @"\\[Uu][0-9]+[?]", new MatchEvaluator(ReplaceSpecialCharacter)); text = Regex.Replace(text, @"\\'[0-9a-fA-F][0-9a-fA-F]", new MatchEvaluator(ReplaceHexCharacter)); text += " "; - if (text.Contains("\\")) - text = text.Replace("\\", ((char)9586).ToString()); // B2016-155 convert backslash char to the unicode symbol - to allow processing rtf commands \ul, \up, \dn, etc. + + //if (text.Contains("\\")) -- these 2 lines made \ul and \ulnone in page list text not get resolved and would then print + //text = text.Replace("\\", ((char)9586).ToString()); // B2016-155 convert backslash char to the unicode symbol - to allow processing rtf commands \ul, \up, \dn, etc. + // B2016-167: handle backslashes but don't do if the backslash is an underline rtf command + int stindx = text.IndexOf("\\"); + while (stindx != -1) + { + if (stindx+2 < text.Length-1 && text.ToUpper().IndexOf("UL",stindx+1)==stindx+1) //don't replace it + stindx = text.IndexOf("\\",stindx+1); + else + { + text = text.Remove(stindx,1); + text = text.Insert(stindx, ((char)9586).ToString()); + stindx = text.IndexOf("\\",stindx); + } + } Phrase ph = new Phrase(); while (text.Length > 0) {