pagination fixes for IP3 asterisk box & rno separator

This commit is contained in:
2015-03-17 15:01:56 +00:00
parent 9c464278f3
commit 77da149ce7
2 changed files with 28 additions and 14 deletions

View File

@@ -274,8 +274,6 @@ namespace Volian.Print.Library
}
}
if (_Match16BitPagination) mySize = YSize;
float ySize7LPI = YSize; // +SixLinesPerInch;
if (_Match16BitPagination) ySize7LPI += SixLinesPerInch;
string firstStep = "No";
if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null)
firstStep = "Yes";
@@ -293,6 +291,10 @@ namespace Volian.Print.Library
KeepStepsOnPage = false;
bool KeepWithHeader = isFirstChild && nearTheTop;
if (BreakHighLevelStepWithSection) KeepWithHeader = true;
// for a HLS that has an asterisk box with the rno separator IN the box, adjust the size by 2 lines to account for box.
if (MyItemInfo.IsStep && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0 &&
(MyItemInfo.RNOs==null ||MyItemInfo.RNOs.Count==0))
mySize += (2*SixLinesPerInch);
if (!ManualPageBreak && (mySize + yEndMsg <= yWithinMargins + yExtra) || // Don't Paginate if there is enough room, will fit on page
(mySize <= yWithinMargins + yExtra && SpecialCaseForRobinson()))
//if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins + SixLinesPerInch) // Don't Paginate if there is enough room, will fit on page
@@ -318,6 +320,11 @@ namespace Volian.Print.Library
// If this format flag is not set, or not printing the first page of the section with this flag,
// this next page size is the same as current page size.
float yPageSizeNextPage = yPageSize;
mySize = YSize; // reset in case mySize changed for current page is compressed
// for a HLS that has an asterisk box with the rno separator IN the box, adjust the size by 2 lines to account for box.
if (MyItemInfo.IsStep && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0 &&
(MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0))
mySize += (2 * SixLinesPerInch);
//if (firstStep == "No")
// ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
if (MyPageHelper.DidFirstPageDocStyle && (MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) > 0)
@@ -367,7 +374,9 @@ namespace Volian.Print.Library
}
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && yPageSizeNextPage < yWithinMargins + 3*72 && MyItemInfo.MyPrevious == null)
KeepStepsOnPage = true;
if (!KeepWithHeader && !KeepStepsOnPage && YSize - SixLinesPerInch + yEndMsg <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break
float mySize7LPI = mySize; // +SixLinesPerInch;
if (_Match16BitPagination) mySize7LPI += SixLinesPerInch;
if (!KeepWithHeader && !KeepStepsOnPage && mySize - SixLinesPerInch + yEndMsg <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break
{
// Don't want extra line before step
//Console.WriteLine("'PageBreak',2,'Yes','HLS will fit on 1 Page',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath);
@@ -386,7 +395,7 @@ namespace Volian.Print.Library
// ySize7LPI includes a blank line after the step which we don't want to include in the page break test.
else if (!KeepStepsOnPage && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CompressSteps
&& (ySize7LPI - SixLinesPerInch + yEndMsg) < (yPageSizeNextPage * SixLinesPerInch / _SevenLinesPerInch))
&& (mySize7LPI - SixLinesPerInch + yEndMsg) < (yPageSizeNextPage * SixLinesPerInch / _SevenLinesPerInch))
{
// ooooooooo ooooo ooooooooo. ooooo
// d"""""""8' `888' `888 `Y88. `888'
@@ -565,12 +574,16 @@ namespace Volian.Print.Library
{
if (breakOrNot != "No")
{
bool hasBox = MyItemInfo.IsStep && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0;
bool rnoSepIn = (MyItemInfo.RNOs==null ||MyItemInfo.RNOs.Count==0);
// DebugPagination.WriteLine("{0}", MyItemInfo.DBSequence); //,instance);
if (DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2},'{3}','{4}',{5},{6},{7},{8},{9}",
if (DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2},'{3}','{4}',{5},{6},{7},{8},{9},{10},{11}",
MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber - (breakOrNot == "Yes" ? 0 : 1),
MyItemInfo.ShortPath, instance,
(manualPageBreak ? "Manual " : "") + message, breakOrNot,
MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize));
MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize),
hasBox, rnoSepIn
);
}
// Console.WriteLine("{0},{1}", MyItemInfo.DBSequence, IsFirstSubStep(MyItemInfo)); //,instance);
}