This commit is contained in:
Kathy Ruffing 2011-04-14 14:03:08 +00:00
parent c1d863e1ac
commit 48b677486e
2 changed files with 30 additions and 7 deletions

View File

@ -636,8 +636,12 @@ namespace Volian.Print.Library
case "{OF}": // Total Page Count for this section
return CurrentPageOf.ToString();
case "{REVDATE}": // Revision Date
if (RevDate == null || RevDate == "") return DateTime.Now.ToShortDateString();
return RevDate;
case "{REV}": // Revision Number
// 16-bit had very specific code to check for first character
// == to a ' ' (space) and if so, start Rev from second character.
if (Rev !=null && Rev != "" && Rev[0] == ' ') return Rev.Substring(1, Rev.Length - 1);
return Rev;
}
if (!_MissingTokens.Contains(match.Value))

View File

@ -168,7 +168,9 @@ namespace Volian.Print.Library
Console.WriteLine("{0},{1},'{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText);
//Console.WriteLine("{0},{1},'{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content);
float retval = yLocation;
if (MyItemInfo.FormatStepData.CenterOneLineOnly && MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null && Height<(1.01F*IParagraph.Leading))
// Check if only one line, i.e. "Height < (1.2F * IParagraph.Leading". The Leading can be for six or seven lines per inch, so the 1.2
// multiplier accounts for both.
if (MyItemInfo.FormatStepData.CenterOneLineOnly && MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null && Height < (1.2F * IParagraph.Leading))
IParagraph.Alignment = Element.ALIGN_CENTER;
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugText, yBottomMargin);
if (retval == 0) // problem occurred - paragraph was not able to be printed on page
@ -326,6 +328,7 @@ namespace Volian.Print.Library
//if (YVeryTop < yTopMost) Console.WriteLine("{0},{1},{2}", MyItemInfo.DBSequence, yTopMost, YVeryTop);
yTopMost = Math.Min(yTopMost,YVeryTop);
yPageStart = yTopMargin + yTopMost - 2 * SixLinesPerInch;
if (EmptyTopMostPart) yPageStart += SixLinesPerInch;
myMsg = docstyle.Continue.Top.Message;
if (myMsg != null && myMsg != "")
{
@ -373,7 +376,28 @@ namespace Volian.Print.Library
}
return yPageStart;
}
private vlnParagraph TopMostChild
{
get
{
if (ChildrenAbove.Count>0) return ChildrenAbove[0].TopMostChild;
return this;
}
}
private bool EmptyTopMostPart
{
get
{
if (TopMostChild.PartsAbove.Count == 0) return false;
foreach (vlnPrintObject po in TopMostChild.PartsAbove)
{
vlnHeader hd = po as vlnHeader;
if (hd == null) return false;
if (hd.Text != "") return false;
}
return true;
}
}
private void OutputOtherPageSteps(PdfContentByte cb, float YTopMost, float yPageStart, float yTopMargin, float yBottomMargin)
{
// Find any items remaining in MyPageHelper.MyParagraphs that should be printed on this page.
@ -1063,15 +1087,10 @@ namespace Volian.Print.Library
if (bx.TabPos > 0)
xoff += (float)bx.TabPos; // xoff starts as left margin
else
{
xoff += (float)((bx.TxtStart + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin
}
}
else if (formatInfo.MyStepSectionLayoutData.Separator.Location > 0)
{
// if there is a separator location, use it - 16bit code used the separator location as a divisor:
xoff = XOffset + AdjustToCharPosition((float)((para.Width - hdrWidth) / formatInfo.MyStepSectionLayoutData.Separator.Location));
}
else
xoff = XOffset + (para.Width / 2) + (hdrWidth / 2); // XOffset has left margin included
}