If we cannot find a space character to split on, then break up the word ( SplitText function)

This commit is contained in:
John Jenko 2014-07-15 01:58:27 +00:00
parent beb97b57e8
commit e6b45641cd

View File

@ -144,14 +144,15 @@ namespace Volian.Print.Library
set { _PrintedSectionPage = value; } set { _PrintedSectionPage = value; }
} }
private bool _AddBlankPagesForDuplexPrinting = false; //private bool _AddBlankPagesForDuplexPrinting = false;
public bool AddBlankPagesForDuplexPrinting // Tells us if a the option to add a blank page is turn on (for procedures with duplex foldouts) //public bool AddBlankPagesForDuplexPrinting // Tells us if a the option to add a blank page is turn on (for procedures with duplex foldouts)
{ //{
get { return _AddBlankPagesForDuplexPrinting; } // get { return _AddBlankPagesForDuplexPrinting; }
set { _AddBlankPagesForDuplexPrinting = value; } // set { _AddBlankPagesForDuplexPrinting = value; }
} //}
public override void OnEndPage(PdfWriter writer, iTextSharp.text.Document document) public override void OnEndPage(PdfWriter writer, iTextSharp.text.Document document)
{ {
bool onBlankPage = OnBlankPage;
if (OnBlankPage) if (OnBlankPage)
{ {
OnBlankPage = false; OnBlankPage = false;
@ -198,6 +199,7 @@ namespace Volian.Print.Library
{ {
if ((MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS) if ((MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)
DrawHorizontal(writer.DirectContent, (float)MySection.MyDocStyle.Layout.LeftMargin, (float)MySection.MyDocStyle.Layout.PageWidth, (float)MySection.MyDocStyle.CenterLineYTop); DrawHorizontal(writer.DirectContent, (float)MySection.MyDocStyle.Layout.LeftMargin, (float)MySection.MyDocStyle.Layout.PageWidth, (float)MySection.MyDocStyle.CenterLineYTop);
//if (MySection.ColumnMode > 0 && onBlankPage == false)
if (MySection.ColumnMode > 0) if (MySection.ColumnMode > 0)
DrawCenterLine(writer.DirectContent, MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0, MySection.MyDocStyle.CenterLineYTop ?? 0, MySection.MyDocStyle.CenterLineYBottom ?? 0); DrawCenterLine(writer.DirectContent, MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0, MySection.MyDocStyle.CenterLineYTop ?? 0, MySection.MyDocStyle.CenterLineYBottom ?? 0);
} }
@ -1780,6 +1782,13 @@ namespace Volian.Print.Library
if (width > len) if (width > len)
{ {
// what should be done if lastspace == 0 // what should be done if lastspace == 0
// cannot find space char to split on, so break the word
// not ideal but PROMS was bombing otherwise - jsj 7/7/2014
if (lastspace == 0)
{
lastspace = indx;
startNonRtf = width - 1;
}
results.Add(nextprefix+text.Substring(start, lastspace-start).Trim(" ".ToCharArray())); results.Add(nextprefix+text.Substring(start, lastspace-start).Trim(" ".ToCharArray()));
nextprefix = rtfprefix; nextprefix = rtfprefix;
if (nextprefix != "") nextprefix += " "; if (nextprefix != "") nextprefix += " ";