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

@@ -795,7 +795,11 @@ namespace Volian.Print.Library
yPageStart = yTopMargin + YVeryTop;
yLocation = yPageStart - YOffset; // yLocation is physical location from bottom of page.
}
if (yLocation - Height < 24) _MyLog.WarnFormat("Very Low {0},{1},{2},{3},{4},{5}",MyItemInfo.ShortPath,MyItemInfo.ItemID,yLocation,Height,yLocation-Height,yTopMargin - MyItemInfo.MyDocStyle.Layout.PageLength);
if (yLocation - Height < 24)
{
if (DebugPagination.IsOpen)
DebugPagination.WriteLine("Very Low {0},{1},{2},{3},{4},{5}", MyItemInfo.ShortPath, MyItemInfo.ItemID, yLocation, Height, yLocation - Height, yTopMargin - MyItemInfo.MyDocStyle.Layout.PageLength);
}
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo + string.Format(",YLines = {0}",YSize/SixLinesPerInch), yBottomMargin);
if (retval == 0) // problem occurred - paragraph was not able to be printed on page
{ // pagination logic needs to be fixed.
@@ -1918,6 +1922,13 @@ namespace Volian.Print.Library
get { return _Suffix; }
set { _Suffix = value; }
}
private float RoughSizeOfPage
{
get
{
return (float)(MyItemInfo.MyDocStyle.Layout.PageLength - MyItemInfo.MyDocStyle.Layout.TopMargin - MyItemInfo.MyDocStyle.Layout.FooterLength);
}
}
public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent, bool loadChildren)
{
Prefix = prefix;
@@ -2393,7 +2404,10 @@ namespace Volian.Print.Library
string[] vals = val.Split("\n".ToCharArray());
Width = Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) * MyItemInfo.FormatStepData.Font.CharsToTwips;
int lines = Int32.Parse(vals[2], System.Globalization.NumberStyles.AllowHexSpecifier);
Height = lines * SixLinesPerInch;
// Check that the Height of figure isn't too big to fit on the page, if it is
// set the Height to the printable part of page - Height of the HLS and an extra line
// for between HLS & figure.
Height = Math.Min(lines * SixLinesPerInch, RoughSizeOfPage - MyParent.Height - SixLinesPerInch);
//yForCheckoff = yoff + Height - SixLinesPerInch;
if (dropCheckoff)
yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text