F2023-015 logic to insure the correct pagelist is used for sub-sections that start on their own page

F2023-015 logic to make sure the section text on the sub-section that starts on its own page starts printing at the top of the page
This commit is contained in:
John Jenko 2023-01-31 16:02:19 +00:00
parent 80bee667b4
commit 578c3d241d
2 changed files with 15 additions and 2 deletions

View File

@ -443,8 +443,17 @@ namespace Volian.Print.Library
adjMsgY = (float)-MyItemInfo.MyDocStyle.End.Flag * SixLinesPerInch;
if (yEndMsg != 0) yEndMsg += adjMsgY;
}
if (!ManualPageBreak && (mySize + yEndMsg <= yWithinMargins + yExtra) || // Don't Paginate if there is enough room, will fit on page
(mySize <= yWithinMargins + yExtra && SpecialCaseForRobinson()))
// F2023-015 check if on the first step of a sub-section that starts on its own page (separate pagination)
// Beaver Valley as two sub-sections that are printed continuously followed by a third sub-section printed separate.
// without this logic, the first step is printed at the same y-location as if it was on the previous page
bool sepPaginationForSubSection = false;
if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious== null && MyItemInfo.MyActiveSection.IsSubsection)
{
if ((MyItemInfo.MyActiveSection.MyConfig as SectionConfig).Section_Pagination == SectionConfig.SectionPagination.Separate)
sepPaginationForSubSection = true;
}
if (!ManualPageBreak && ((mySize + yEndMsg <= yWithinMargins + yExtra) || // Don't Paginate if there is enough room, will fit on page
(mySize <= yWithinMargins + yExtra && SpecialCaseForRobinson())) && !sepPaginationForSubSection)
//if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins + SixLinesPerInch) // Don't Paginate if there is enough room, will fit on page
{
// ooooo ooooo ooooo .oooooo..o o8o oooo oooo .o88o. o8o .

View File

@ -1778,6 +1778,10 @@ namespace Volian.Print.Library
//_MyLog.InfoFormat("NewPage 10 {0}", cb.PdfWriter.CurrentPageNumber);
if (MyItemInfo.IsSection && MyParent != null && MyParent.MyItemInfo.IsSection && (MyItemInfo as SectionInfo).IsSeparatePagination())
{
// F2023-015 for Beaver Valley as two sub-sections that are printed continuously followed by a third sub-section printed
// with separate pagination. This section type uses a different pagelist for the pages after the first page.
// Needed to call ResetDocStyleAndValues to set the new page with the other pagelist sytle.
ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
RefreshDocStyle();
yTopMargin = PDFPageSize.PaperSizePoints(MyItemInfo.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize) - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.TopMargin; // C2018-003 fixed use of getting the active section // C2020-002 paper size is now set in the format files
yBottomMargin = Math.Max(0, yTopMargin - (float)MyItemInfo.ActiveSection.MyDocStyle.Layout.PageLength); // C2018-003 fixed use of getting the active section