From e6b45641cd5f3720d362c372672c7c9b6bee5f82 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 15 Jul 2014 01:58:27 +0000 Subject: [PATCH] If we cannot find a space character to split on, then break up the word ( SplitText function) --- .../Volian.Print.Library/VlnSvgPageHelper.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index ecc87f0e..37e2f1c8 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -144,14 +144,15 @@ namespace Volian.Print.Library set { _PrintedSectionPage = value; } } - 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) - { - get { return _AddBlankPagesForDuplexPrinting; } - set { _AddBlankPagesForDuplexPrinting = value; } - } + //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) + //{ + // get { return _AddBlankPagesForDuplexPrinting; } + // set { _AddBlankPagesForDuplexPrinting = value; } + //} public override void OnEndPage(PdfWriter writer, iTextSharp.text.Document document) { + bool onBlankPage = OnBlankPage; if (OnBlankPage) { OnBlankPage = false; @@ -198,6 +199,7 @@ namespace Volian.Print.Library { 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); + //if (MySection.ColumnMode > 0 && onBlankPage == false) if (MySection.ColumnMode > 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) { // 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())); nextprefix = rtfprefix; if (nextprefix != "") nextprefix += " ";