Logic to determine if a transition was acceptable was running into a limit. The limit was removed.
Changed logic so that Compare Check Box is visible if the PDF Output folder contains a folder named "Compare". Pagination within a step was changed to more accurately fill a page taking account for continue messages at the top and bottom of the page. Logic was added to try to find a place to break a step, if the minimum break location cannot be found using the standard logic. Added YTopMost output to debug text on compare PDFs.
This commit is contained in:
@@ -312,16 +312,38 @@ namespace Volian.Print.Library
|
||||
if (myFirstPieceSize < ySpaceOnCurPage) yLowerLimit = Math.Max(myFirstPieceSize + yStart, yLowerLimit);
|
||||
//while ((YSize - yTop) >= ySpaceOnCurPage)
|
||||
// Pagination Fix Break1LineShort3b
|
||||
DocStyle docstyle = MyItemInfo.MyDocStyle;
|
||||
string myBottomMsg = docstyle.Continue.Bottom.Message;
|
||||
float myBottomMsgSpace = ((myBottomMsg ?? "") != "") ? 2 * SixLinesPerInch : 0;
|
||||
switch (docstyle.Continue.Bottom.Location)
|
||||
{
|
||||
case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page
|
||||
myBottomMsgSpace = 0;
|
||||
break;
|
||||
}
|
||||
string myTopMsg = docstyle.Continue.Top.Message;
|
||||
float myTopMsgSpace = ((myTopMsg ?? "") != "") ? 2 * SixLinesPerInch : 0;
|
||||
while ((YSize - yTop) > ySpaceOnCurPage)
|
||||
{
|
||||
ySpaceOnCurPage -= myBottomMsgSpace;
|
||||
vlnParagraph paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList);
|
||||
if (paraBreak == null) break;
|
||||
if (paraBreak == null)
|
||||
{
|
||||
_MyLog.ErrorFormat("<<< ERROR >>> Cannot find a place to break\r\n==>'Cannot Find Place to Break',{0},'{1}','{2}'"
|
||||
, MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath);
|
||||
break;
|
||||
}
|
||||
// yTopNew is y Location of this page break. YTopMost is top of HLS, including any Cautions/Notes/Boxes/etc
|
||||
float yTopNew = paraBreak.YTopMost - YTopMost;
|
||||
//float yTopNew = paraBreak.YVeryTop - YTopMost;
|
||||
//float yTopNew = paraBreak.YTopMost - YTopMost;
|
||||
float yTopNew = Math.Min(paraBreak.YTopMost, paraBreak.YVeryTop) - YTopMost;
|
||||
RemoveProcessedParagraphs(myList, yTopNew - yTop);
|
||||
yTop = yTopNew;
|
||||
MyPageHelper.ParaBreaks.Add(paraBreak);
|
||||
ySpaceOnCurPage = yPageSize - 2 * SixLinesPerInch; // Allow for continue message and blank line.
|
||||
ySpaceOnCurPage = yPageSize - (myTopMsgSpace + SixLinesPerInch); // Allow for continue message and blank line.
|
||||
//ySpaceOnCurPage = yPageSize - (myTopMsgSpace + SixLinesPerInch); // Allow for continue message and blank line.
|
||||
//if (paraBreak.YTopMost != paraBreak.YVeryTop && MyPageHelper.TopMessage == null && MyPageHelper.BottomMessage == null)
|
||||
// ySpaceOnCurPage = yPageSize;
|
||||
//ySpaceOnCurPage = yPageSize; // Allow for continue message and blank line.
|
||||
//DocStyle docstyle = MyItemInfo.MyDocStyle;
|
||||
//string myMsg = docstyle.Continue.Bottom.Message;
|
||||
@@ -341,6 +363,7 @@ namespace Volian.Print.Library
|
||||
/// <returns></returns>
|
||||
private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList)
|
||||
{
|
||||
vlnParagraph minPara = null;
|
||||
foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest.
|
||||
{
|
||||
foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation
|
||||
@@ -349,6 +372,8 @@ namespace Volian.Print.Library
|
||||
// The top of this step will fit onto page (-yLocation < yWithinMargins)
|
||||
float wcnChkLstBorder = myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate &&
|
||||
(myPara.MyItemInfo.MyHLS.FormatStepData.Suffix ?? "") != "" ? 2*SixLinesPerInch : 0;
|
||||
if (minPara == null || minPara.YTop > myPara.YTop)
|
||||
minPara = myPara;
|
||||
if (wcnChkLstBorder -yLocation <= yUpperLimit) // Fix for OFN-RJ-23
|
||||
//if (-yLocation < yUpperLimit) // Before
|
||||
//if (-yLocation < yWithinMargins && myList[stepLevel][yLocation].MyItemInfo.MyPrevious != null)
|
||||
@@ -373,7 +398,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return minPara;
|
||||
}
|
||||
|
||||
//private void WalkStepLevel(float yTopMost)
|
||||
|
@@ -572,7 +572,10 @@ namespace Volian.Print.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} DBSequence={5}", DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData==null?"NoStepData":MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.DBSequence);
|
||||
return string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} DBSequence={5} YTopMost={6} ",
|
||||
DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType,
|
||||
MyItemInfo.FormatStepData==null?"NoStepData":MyItemInfo.FormatStepData.Type,
|
||||
MyItemInfo.StepLevel, MyItemInfo.DBSequence,YTopMost);
|
||||
}
|
||||
}
|
||||
private void ResetDocStyleAndValues(ref float yTopMargin, ref float yBottomMargin)
|
||||
|
Reference in New Issue
Block a user