From c100349dcbbde5d0b9c377966a186d1735f87be8 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 4 Mar 2016 16:45:54 +0000 Subject: [PATCH] --- PROMS/Volian.Print.Library/vlnPrintObject.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnPrintObject.cs b/PROMS/Volian.Print.Library/vlnPrintObject.cs index 97653220..b15cfd04 100644 --- a/PROMS/Volian.Print.Library/vlnPrintObject.cs +++ b/PROMS/Volian.Print.Library/vlnPrintObject.cs @@ -415,8 +415,8 @@ namespace Volian.Print.Library Match match = Regex.Match(rtf, @"\\fi([-0-9]*) ?\\li([0-9]*)"); if (match.Success) { - float fi = float.Parse("0" + match.Groups[1].Value) / 20; - float li = float.Parse("0" + match.Groups[2].Value) / 20; + float fi = float.Parse(FixNumber(match.Groups[1].Value)) / 20; + float li = float.Parse(FixNumber(match.Groups[2].Value)) / 20; // if there is a hanging indent, the iTextSharp paragraph properties must be set // to print the indent. para.IndentationLeft = li; @@ -434,6 +434,11 @@ namespace Volian.Print.Library } return para; } + private static string FixNumber(string num) + { + if (num == "") return ("0"); + return num; + } public static float CalculateHangingIndent(string rtf) { float chkW=0;