Table shrinking support

This commit is contained in:
Rich
2015-05-27 18:48:14 +00:00
parent cf79062b90
commit 37e2227919
5 changed files with 430 additions and 43 deletions

View File

@@ -403,7 +403,8 @@ namespace Volian.Print.Library
KeepStepsOnPage = true;
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
float tableSpaceAvailable = TableSpaceAvailable;// RHM20150525 - Table Scrunch
if (!KeepWithHeader && !KeepStepsOnPage && mySize - SixLinesPerInch + yEndMsg - tableSpaceAvailable <= 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);
@@ -422,7 +423,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
&& (mySize7LPI - SixLinesPerInch + yEndMsg) < (yPageSizeNextPage * SixLinesPerInch / _SevenLinesPerInch))
&& (mySize7LPI - SixLinesPerInch + yEndMsg - tableSpaceAvailable) < (yPageSizeNextPage * SixLinesPerInch / _SevenLinesPerInch))// RHM20150525 - Table Scrunch
{
// ooooooooo ooooo ooooooooo. ooooo
// d"""""""8' `888' `888 `Y88. `888'
@@ -1316,6 +1317,19 @@ namespace Volian.Print.Library
// DebugPagination.WriteLine("'StepLevel',{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}", YVeryTop - yTopMost, YSize, YBottomMost - yTopMost, item.ItemID, item.DBSequence, item.StepLevel, item.MyContent.Type % 10000,
// parent.MyContent.Type % 10000, item.HasCautionOrNote ? 1 : 0, parent.Cautions == null ? 0 : 1);
//}
public float TableSpaceAvailable// RHM20150525 - Table Scrunch
{
get
{
float retval = 0;
if(_ChildrenBelow!= null)
foreach (vlnParagraph pgh in _ChildrenBelow)
retval += pgh.TableSpaceAvailable;
if (MyGrid != null)
retval += MyGrid.SpaceAvailable;
return retval;
}
}
}
public partial class VlnSvgPageHelper : SvgPageHelper
{