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:
parent
60ed4a9e31
commit
e9f746a883
@ -5420,6 +5420,7 @@ Union All
|
||||
join Items I on Z.PreviousID = I.ItemID
|
||||
)
|
||||
insert into @Parents select ItemID, ContentID from Itemz where Relationship > 0
|
||||
OPTION (MAXRECURSION 10000)
|
||||
RETURN
|
||||
END
|
||||
GO
|
||||
|
@ -164,7 +164,7 @@ namespace VEPROMS
|
||||
// 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))
|
||||
txbPDFLocation.Text = VlnSettings.TemporaryFolder;
|
||||
|
||||
SetCompareVisibility();
|
||||
// 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.
|
||||
// If yes, the Change bar tab is the selected tab.
|
||||
@ -225,6 +225,16 @@ namespace VEPROMS
|
||||
btnDuplxOff.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
|
||||
// This checkbox is now labeled as "Compare PDF"
|
||||
// If the PDF location has a Compare folder or we are in Debug Mode
|
||||
@ -234,11 +244,6 @@ namespace VEPROMS
|
||||
cmpfldr += "Compare";
|
||||
cbxDebug.Visible = Directory.Exists(cmpfldr) || 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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user