Eliminate Forced pagination problems in IP2 Bck

Resize figures when figure is bigger than page
Remove {NULLDOCCURPAGE} when processing page numbers
This commit is contained in:
2014-10-14 13:39:52 +00:00
parent f994210ea6
commit 4ebc193d09
3 changed files with 38 additions and 3 deletions

View File

@@ -243,12 +243,31 @@ namespace Volian.Print.Library
// ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
if (MyPageHelper.DidFirstPageDocStyle && (MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) > 0)
yPageSizeNextPage = GetYPageSizeUseOnAllButFirstPage();
if (KeepStepsOnPage && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnLowerStepLevel && YSize == ySizeIncludingFirst && YSize + yEndMsg > yWithinMargins)
if (KeepStepsOnPage
&& !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnLowerStepLevel
&& YSize == ySizeIncludingFirst
&& YSize + yEndMsg > yWithinMargins)
{
// If the first step is the size of the entire step and the step has an end message then don't try to break the step
KeepStepsOnPage = false;
//_MyLog.WarnFormat("Kick Step to Next Page {0},{1}", MyItemInfo.ItemID, MyItemInfo.ShortPath);
}
if (yWithinMargins < SixLinesPerInch) KeepStepsOnPage = false; // if there is no room to print, don't keep steps on the page
// The following was added for IP2 background printing. There were situations where there was a HLS and its paragraph was
// put on next page (IP2 bck: E-3/References), and a paragraph was writing into the footer (FR-H.1 step 2.2.3.1. KBR 10/14/14)
if (KeepStepsOnPage
&& MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnLowerStepLevel
&& YSize == ySizeIncludingFirst
&& ((ChildrenBelow.Count >= 1 && ChildrenBelow[0].MyItemInfo.IsParagraph && ChildrenBelow[0].ChildrenBelow.Count == 0)
|| ChildrenBelow.Count == 0))
{
KeepStepsOnPage = false;
}
// Keep figure (the only figure, i.e. count==1) with its parent.
if (ChildrenBelow.Count == 1 && ChildrenBelow[0].MyItemInfo.IsFigure) KeepStepsOnPage = false;
if (!KeepWithHeader && !KeepStepsOnPage && YSize - SixLinesPerInch + yEndMsg <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break
{
// Don't want extra line before step