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:
Rich 2013-05-21 15:37:19 +00:00
parent 60ed4a9e31
commit e9f746a883
4 changed files with 45 additions and 11 deletions

View File

@ -5420,6 +5420,7 @@ Union All
join Items I on Z.PreviousID = I.ItemID join Items I on Z.PreviousID = I.ItemID
) )
insert into @Parents select ItemID, ContentID from Itemz where Relationship > 0 insert into @Parents select ItemID, ContentID from Itemz where Relationship > 0
OPTION (MAXRECURSION 10000)
RETURN RETURN
END END
GO GO

View File

@ -164,7 +164,7 @@ namespace VEPROMS
// set to a default PDF location if none was specified in the DocVersions property // set to a default PDF location if none was specified in the DocVersions property
if (txbPDFLocation.Text == null || txbPDFLocation.Text.Length == 0 || !Directory.Exists(txbPDFLocation.Text)) if (txbPDFLocation.Text == null || txbPDFLocation.Text.Length == 0 || !Directory.Exists(txbPDFLocation.Text))
txbPDFLocation.Text = VlnSettings.TemporaryFolder; txbPDFLocation.Text = VlnSettings.TemporaryFolder;
SetCompareVisibility();
// if the default setting is 'SelectBeforePrinting', put up a message box to determine whether the user // if the default setting is 'SelectBeforePrinting', put up a message box to determine whether the user
// wants change bars. If not, 'Change Bar' on the Setting tab is 'OFF' and no Change bar tab. // wants change bars. If not, 'Change Bar' on the Setting tab is 'OFF' and no Change bar tab.
// If yes, the Change bar tab is the selected tab. // If yes, the Change bar tab is the selected tab.
@ -225,6 +225,16 @@ namespace VEPROMS
btnDuplxOff.Visible = false; btnDuplxOff.Visible = false;
btnDuplxOn.Visible = false; btnDuplxOn.Visible = false;
} }
SetCompareVisibility();
// default to using OriginalPageBreaks (16bit page breaks) if App.config is set
// to true:
cbxOrPgBrk.Visible = VlnSettings.OriginalPageBreak;
cbxOrPgBrk.Checked = false;
}
private void SetCompareVisibility()
{
// default to print Debug info if App.config is set to debug mode // default to print Debug info if App.config is set to debug mode
// This checkbox is now labeled as "Compare PDF" // This checkbox is now labeled as "Compare PDF"
// If the PDF location has a Compare folder or we are in Debug Mode // If the PDF location has a Compare folder or we are in Debug Mode
@ -234,11 +244,6 @@ namespace VEPROMS
cmpfldr += "Compare"; cmpfldr += "Compare";
cbxDebug.Visible = Directory.Exists(cmpfldr) || VlnSettings.DebugMode; cbxDebug.Visible = Directory.Exists(cmpfldr) || VlnSettings.DebugMode;
cbxDebug.Checked = VlnSettings.DebugMode; cbxDebug.Checked = VlnSettings.DebugMode;
// default to using OriginalPageBreaks (16bit page breaks) if App.config is set
// to true:
cbxOrPgBrk.Visible = VlnSettings.OriginalPageBreak;
cbxOrPgBrk.Checked = false;
} }
private void DlgPrintProcedure_Load(object sender, EventArgs e) private void DlgPrintProcedure_Load(object sender, EventArgs e)

View File

@ -312,16 +312,38 @@ namespace Volian.Print.Library
if (myFirstPieceSize < ySpaceOnCurPage) yLowerLimit = Math.Max(myFirstPieceSize + yStart, yLowerLimit); if (myFirstPieceSize < ySpaceOnCurPage) yLowerLimit = Math.Max(myFirstPieceSize + yStart, yLowerLimit);
//while ((YSize - yTop) >= ySpaceOnCurPage) //while ((YSize - yTop) >= ySpaceOnCurPage)
// Pagination Fix Break1LineShort3b // 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) while ((YSize - yTop) > ySpaceOnCurPage)
{ {
ySpaceOnCurPage -= myBottomMsgSpace;
vlnParagraph paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList); 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 // 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); RemoveProcessedParagraphs(myList, yTopNew - yTop);
yTop = yTopNew; yTop = yTopNew;
MyPageHelper.ParaBreaks.Add(paraBreak); 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. //ySpaceOnCurPage = yPageSize; // Allow for continue message and blank line.
//DocStyle docstyle = MyItemInfo.MyDocStyle; //DocStyle docstyle = MyItemInfo.MyDocStyle;
//string myMsg = docstyle.Continue.Bottom.Message; //string myMsg = docstyle.Continue.Bottom.Message;
@ -341,6 +363,7 @@ namespace Volian.Print.Library
/// <returns></returns> /// <returns></returns>
private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList) 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 (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest.
{ {
foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation 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) // The top of this step will fit onto page (-yLocation < yWithinMargins)
float wcnChkLstBorder = myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate && float wcnChkLstBorder = myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate &&
(myPara.MyItemInfo.MyHLS.FormatStepData.Suffix ?? "") != "" ? 2*SixLinesPerInch : 0; (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 (wcnChkLstBorder -yLocation <= yUpperLimit) // Fix for OFN-RJ-23
//if (-yLocation < yUpperLimit) // Before //if (-yLocation < yUpperLimit) // Before
//if (-yLocation < yWithinMargins && myList[stepLevel][yLocation].MyItemInfo.MyPrevious != null) //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) //private void WalkStepLevel(float yTopMost)

View File

@ -572,7 +572,10 @@ namespace Volian.Print.Library
{ {
get 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) private void ResetDocStyleAndValues(ref float yTopMargin, ref float yBottomMargin)