Support compressed foldout pages
This commit is contained in:
parent
c788b25864
commit
a600afd472
@ -38,6 +38,12 @@ namespace Volian.Print.Library
|
||||
/// This variable is used to match 16 bit pagination
|
||||
/// </summary>
|
||||
private bool _Match16BitPagination = false;
|
||||
private bool _CompressFoldout = false;
|
||||
public bool CompressFoldout
|
||||
{
|
||||
get { return _CompressFoldout; }
|
||||
set { _CompressFoldout = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Dtermines if the current step is preceded by a Page Break
|
||||
/// </summary>
|
||||
@ -193,14 +199,14 @@ namespace Volian.Print.Library
|
||||
if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild)
|
||||
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)
|
||||
{
|
||||
float vpHeight = SixLinesPerInch;
|
||||
foreach (vlnParagraph vp in MyPageHelper.NotesToFootNotes) vpHeight += vp.Height;
|
||||
ySectionEndMsg += vpHeight;
|
||||
}
|
||||
if (ySizeIncludingFirstStep < yWithinMargins && ySizeIncludingFirst > yWithinMargins && yWithinMargins > (yPageSize/2))
|
||||
if (ySizeIncludingFirstStep < yWithinMargins && ySizeIncludingFirst > yWithinMargins && yWithinMargins > (yPageSize / 2))
|
||||
ySizeIncludingFirst = ySizeIncludingFirstStep;
|
||||
if (!KeepStepsOnPage && (ySizeIncludingFirst + ySectionEndMsg) >
|
||||
(yLocation - (MyItemInfo.MyDocStyle.Layout.FooterLength + yBottomMargin)) && !nearTheTop)
|
||||
@ -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
|
||||
// `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);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (ChildrenBelow.Count > 0)
|
||||
{
|
||||
vlnParagraph firstHLS = ChildrenBelow[0];
|
||||
if (firstHLS.MyItemInfo.IsHigh)
|
||||
firstHLS.BreakHighLevelStepWithSection = true;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level
|
||||
|
@ -1252,6 +1252,9 @@ namespace Volian.Print.Library
|
||||
MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch;
|
||||
CompressPartOfPage = false;
|
||||
}
|
||||
if(CompressFoldout)
|
||||
MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch;
|
||||
|
||||
///else
|
||||
/// MyPageHelper.YMultiplier = 1;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user