diff --git a/PROMS/Volian.Print.Library/vlnPrintObject.cs b/PROMS/Volian.Print.Library/vlnPrintObject.cs index 7b73f385..612b03cd 100644 --- a/PROMS/Volian.Print.Library/vlnPrintObject.cs +++ b/PROMS/Volian.Print.Library/vlnPrintObject.cs @@ -121,7 +121,8 @@ namespace Volian.Print.Library vlnParagraph myParagraph = this as vlnParagraph; if (myParagraph != null) { - if (myParagraph.MyItemInfo.FormatStepData != null && myParagraph.MyItemInfo.FormatStepData.Font.Family == "Prestige Elite Tall") + //if (myParagraph.MyItemInfo.FormatStepData != null && myParagraph.MyItemInfo.FormatStepData.Font.Family == "Prestige Elite Tall") + if (!myParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WrapSameAsEdit) { Chunk chk = RemoveLastCharacter(iParagraph); float heightAllButOne = GetHeight(cb, iParagraph, width, throwException); @@ -146,11 +147,14 @@ namespace Volian.Print.Library object obj = iParagraph[iParagraph.Count-1]; Chunk chk = obj as Chunk; if (chk == null) - Console.WriteLine("Here"); - iParagraph.RemoveAt(iParagraph.Count - 1); + return null; string s = chk.Content; - s = s.Substring(0,s.Length - 1); - iParagraph.Add(new Chunk(s,chk.Font)); + if (s.Length > 1) // don't remove last character if it's the only one + { + iParagraph.RemoveAt(iParagraph.Count - 1); + s = s.Substring(0, s.Length - 1); + iParagraph.Add(new Chunk(s, chk.Font)); + } return chk; } private static float GetHeight(PdfContentByte cb, Paragraph iParagraph, float width, bool throwException)