B2015-103: indents (strip out rtf indent commands)

B2015-103:  indents (handle rtf indent commands)
B2015-103:  indents (set/clear ribbon button for indents)
B2015-103: setup rtf string for indents; display small identifying marks for indents
B2015-103: remove page break from ribbon; move indent; support new indent; support for table grid indent
B2015-103: Print for new indents in tables
B2015-103: Print for new indents in paragraphs
This commit is contained in:
2015-08-19 12:18:39 +00:00
parent 49dcdd4f4a
commit a58add8937
9 changed files with 1078 additions and 990 deletions

View File

@@ -11,6 +11,7 @@ using Itenso.Rtf.Support;
using Volian.Controls.Library;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
using System.Text.RegularExpressions;
namespace Volian.Print.Library
{
@@ -392,7 +393,7 @@ namespace Volian.Print.Library
rtf2IText.HasIndent = hasIndent;
iTextSharp.text.Paragraph para = rtf2IText.Convert();
para.SetLeading(_SixLinesPerInch, 0);
if (rtf.Contains("\x05"))
if (rtf.Contains("\x05")) // note that this is for existing customer data as of August 2015.
{
// if there is a hanging indent, the iTextSharp paragraph properties must be set
// to print the indent. Replace the indent 'token' with a non-used symbol, this will
@@ -406,6 +407,16 @@ namespace Volian.Print.Library
para.IndentationLeft = chkW;
para.FirstLineIndent = -chkW;
}
Match match = Regex.Match(rtf, @"\\fi([-0-9]*) ?\\li([0-9]*)");
if (match.Success)
{
float fi = float.Parse(match.Groups[1].Value) / 20;
float li = float.Parse(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;
para.FirstLineIndent = fi;
}
// Change the chunks to only split on spaces rather than spaces and hyphens
foreach (Chunk chk in para)
{