diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 2859c877..80cb2dc8 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -1163,7 +1163,8 @@ namespace Volian.Print.Library // adjust ylocation for pagenumber - the ylocation will get reset if the // section title split on 2 lines and the page number needs to be on the 2nd line. - if (retval != ttlRetval) yLocation += (retval - ttlRetval); + // Only do this if the title is not empty (the code was meant for if title spans more than a line) + if (retval != ttlRetval && mySection.MyContent.Text != null && mySection.MyContent.Text != "") yLocation += (retval - ttlRetval); // retval = the minimum (further down the page) between section number and // title - this accounts for multi line title. @@ -1198,7 +1199,11 @@ namespace Volian.Print.Library } else startSpace = leftMargin + adjSecTitlePos + width + 6; - float endSpace = leftMargin + secPagePos - 6; + // If the page number is Right justified, need less space characters ('.') so that page number + // doesn't have the last space character overwriting the 1st digit: + int endJust = (tOfC.TofCPageNumAlign.ToUpper() == "RIGHT") ? 18 : 6; + + float endSpace = leftMargin + secPagePos - endJust; float numSpace = endSpace - startSpace; rtfText = GetRtfToC(tOfC.TofCSpaceChar, tOfC); Paragraph tmpmyparagraph = vlnPrintObject.RtfToParagraph(rtfText);