Support compressed foldout pages

This commit is contained in:
Rich 2015-03-19 13:13:57 +00:00
parent c788b25864
commit a600afd472
2 changed files with 40 additions and 11 deletions

View File

@ -38,6 +38,12 @@ namespace Volian.Print.Library
/// This variable is used to match 16 bit pagination /// This variable is used to match 16 bit pagination
/// </summary> /// </summary>
private bool _Match16BitPagination = false; private bool _Match16BitPagination = false;
private bool _CompressFoldout = false;
public bool CompressFoldout
{
get { return _CompressFoldout; }
set { _CompressFoldout = value; }
}
/// <summary> /// <summary>
/// Dtermines if the current step is preceded by a Page Break /// Dtermines if the current step is preceded by a Page Break
/// </summary> /// </summary>
@ -193,16 +199,16 @@ namespace Volian.Print.Library
if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild) if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild)
KeepStepsOnPage = false; KeepStepsOnPage = false;
if (ySizeIncludingFirst == YSize) KeepStepsOnPage = false; if (ySizeIncludingFirst == YSize) KeepStepsOnPage = false;
float ySectionEndMsg = !_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1 && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; float ySectionEndMsg = !_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1 && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0)
{ {
float vpHeight = SixLinesPerInch; float vpHeight = SixLinesPerInch;
foreach (vlnParagraph vp in MyPageHelper.NotesToFootNotes) vpHeight += vp.Height; foreach (vlnParagraph vp in MyPageHelper.NotesToFootNotes) vpHeight += vp.Height;
ySectionEndMsg += vpHeight; ySectionEndMsg += vpHeight;
} }
if (ySizeIncludingFirstStep < yWithinMargins && ySizeIncludingFirst > yWithinMargins && yWithinMargins > (yPageSize/2)) if (ySizeIncludingFirstStep < yWithinMargins && ySizeIncludingFirst > yWithinMargins && yWithinMargins > (yPageSize / 2))
ySizeIncludingFirst = ySizeIncludingFirstStep; ySizeIncludingFirst = ySizeIncludingFirstStep;
if (!KeepStepsOnPage && (ySizeIncludingFirst + ySectionEndMsg) > if (!KeepStepsOnPage && (ySizeIncludingFirst + ySectionEndMsg) >
(yLocation - (MyItemInfo.MyDocStyle.Layout.FooterLength + yBottomMargin)) && !nearTheTop) (yLocation - (MyItemInfo.MyDocStyle.Layout.FooterLength + yBottomMargin)) && !nearTheTop)
{ {
if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert || if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert ||
@ -216,16 +222,36 @@ namespace Volian.Print.Library
// `88b ooo 888 888 888 888 888 . 888 888 888 888 888 888 888 888 888 o. )88b oo .d8P 888 .o 888 .o8 888 . 888 888 888 888 888 o. )88b // `88b ooo 888 888 888 888 888 . 888 888 888 888 888 888 888 888 888 o. )88b oo .d8P 888 .o 888 .o8 888 . 888 888 888 888 888 o. )88b
// `Y8bood8P' `Y8bod8P' o888o o888o "888" o888o o888o o888o `V88V"V8P' `Y8bod8P' `V88V"V8P' 8""888P' 8""88888P' `Y8bod8P' `Y8bod8P' "888" o888o `Y8bod8P' o888o o888o 8""888P' // `Y8bood8P' `Y8bod8P' o888o o888o "888" o888o o888o o888o `V88V"V8P' `Y8bod8P' `V88V"V8P' 8""888P' 8""88888P' `Y8bod8P' `Y8bod8P' "888" o888o `Y8bod8P' o888o o888o 8""888P'
ShowPageBreak(4, "Page Break Before Continuous Step Section", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); ShowPageBreak(4, "Page Break Before Continuous Step Section", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
return 1; return 1;
}
}
if (ChildrenBelow.Count > 0)
{
vlnParagraph firstHLS = ChildrenBelow[0];
if (firstHLS.MyItemInfo.IsHigh)
firstHLS.BreakHighLevelStepWithSection = true;
} }
} }
if (ChildrenBelow.Count > 0)
{
vlnParagraph firstHLS = ChildrenBelow[0];
if (firstHLS.MyItemInfo.IsHigh)
firstHLS.BreakHighLevelStepWithSection = true;
}
}
// Compress Foldout
//
// .oooooo. oooooooooooo oooo .o8 .
// d8P' `Y8b `888' `8 `888 "888 .o8
// 888 .ooooo. ooo. .oo. .oo. oo.ooooo. oooo d8b .ooooo. .oooo.o .oooo.o 888 .ooooo. 888 .oooo888 .ooooo. oooo oooo .o888oo
// 888 d88' `88b `888P"Y88bP"Y88b 888' `88b `888""8P d88' `88b d88( "8 d88( "8 888oooo8 d88' `88b 888 d88' `888 d88' `88b `888 `888 888
// 888 888 888 888 888 888 888 888 888 888ooo888 `"Y88b. `"Y88b. 888 " 888 888 888 888 888 888 888 888 888 888
// `88b ooo 888 888 888 888 888 888 888 888 888 .o o. )88b o. )88b 888 888 888 888 888 888 888 888 888 888 888 .
// `Y8bood8P' `Y8bod8P' o888o o888o o888o 888bod8P' d888b `Y8bod8P' 8""888P' 8""888P' o888o `Y8bod8P' o888o `Y8bod88P" `Y8bod8P' `V88V"V8P' "888"
// 888
// o888o
// This is a foldout pages
// The format supports compression
// The contents exceeds the length of the page
// The Contents fit at seven lines per inch
if (MyItemInfo.DisplayText.ToUpper().StartsWith("FOLDOUT")
&& MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CompressSteps
&& mySize > yPageSize
&& mySize <= yPageSize * SixLinesPerInch / _SevenLinesPerInch)
CompressFoldout = true;
return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page
} }
if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level

View File

@ -1252,6 +1252,9 @@ namespace Volian.Print.Library
MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch;
CompressPartOfPage = false; CompressPartOfPage = false;
} }
if(CompressFoldout)
MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch;
///else ///else
/// MyPageHelper.YMultiplier = 1; /// MyPageHelper.YMultiplier = 1;
break; break;