This commit is contained in:
parent
c1d863e1ac
commit
48b677486e
@ -636,8 +636,12 @@ namespace Volian.Print.Library
|
|||||||
case "{OF}": // Total Page Count for this section
|
case "{OF}": // Total Page Count for this section
|
||||||
return CurrentPageOf.ToString();
|
return CurrentPageOf.ToString();
|
||||||
case "{REVDATE}": // Revision Date
|
case "{REVDATE}": // Revision Date
|
||||||
|
if (RevDate == null || RevDate == "") return DateTime.Now.ToShortDateString();
|
||||||
return RevDate;
|
return RevDate;
|
||||||
case "{REV}": // Revision Number
|
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;
|
return Rev;
|
||||||
}
|
}
|
||||||
if (!_MissingTokens.Contains(match.Value))
|
if (!_MissingTokens.Contains(match.Value))
|
||||||
|
@ -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, FormattedText);
|
||||||
//Console.WriteLine("{0},{1},'{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content);
|
//Console.WriteLine("{0},{1},'{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content);
|
||||||
float retval = yLocation;
|
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;
|
IParagraph.Alignment = Element.ALIGN_CENTER;
|
||||||
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugText, yBottomMargin);
|
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
|
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);
|
//if (YVeryTop < yTopMost) Console.WriteLine("{0},{1},{2}", MyItemInfo.DBSequence, yTopMost, YVeryTop);
|
||||||
yTopMost = Math.Min(yTopMost,YVeryTop);
|
yTopMost = Math.Min(yTopMost,YVeryTop);
|
||||||
yPageStart = yTopMargin + yTopMost - 2 * SixLinesPerInch;
|
yPageStart = yTopMargin + yTopMost - 2 * SixLinesPerInch;
|
||||||
|
if (EmptyTopMostPart) yPageStart += SixLinesPerInch;
|
||||||
myMsg = docstyle.Continue.Top.Message;
|
myMsg = docstyle.Continue.Top.Message;
|
||||||
if (myMsg != null && myMsg != "")
|
if (myMsg != null && myMsg != "")
|
||||||
{
|
{
|
||||||
@ -373,7 +376,28 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
return yPageStart;
|
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)
|
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.
|
// 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)
|
if (bx.TabPos > 0)
|
||||||
xoff += (float)bx.TabPos; // xoff starts as left margin
|
xoff += (float)bx.TabPos; // xoff starts as left margin
|
||||||
else
|
else
|
||||||
{
|
|
||||||
xoff += (float)((bx.TxtStart + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin
|
xoff += (float)((bx.TxtStart + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (formatInfo.MyStepSectionLayoutData.Separator.Location > 0)
|
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));
|
xoff = XOffset + AdjustToCharPosition((float)((para.Width - hdrWidth) / formatInfo.MyStepSectionLayoutData.Separator.Location));
|
||||||
}
|
|
||||||
else
|
else
|
||||||
xoff = XOffset + (para.Width / 2) + (hdrWidth / 2); // XOffset has left margin included
|
xoff = XOffset + (para.Width / 2) + (hdrWidth / 2); // XOffset has left margin included
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user