Fixed issue of blank pages would sometimes have a line down the center

This commit is contained in:
John Jenko 2014-09-25 13:04:06 +00:00
parent 7b2b53bf02
commit ef426ca3e3

View File

@ -189,7 +189,7 @@ namespace Volian.Print.Library
}
else if (!OnFoldoutPage)
{
if (DidFirstPageDocStyle) ResetDocStyleAndValues();
if (DidFirstPageDocStyle) SetDocStyleAndValues();
AddBookmarks(writer);
MyPageCounts.CanIncrement = true;
base.OnEndPage(writer, document);
@ -225,7 +225,7 @@ namespace Volian.Print.Library
}
}
if (MySection.MyDocStyle.CenterLineX != null)
if (MySection.MyDocStyle.CenterLineX != null && !onBlankPage)
{
if ((MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)
DrawHorizontal(writer.DirectContent, (float)MySection.MyDocStyle.Layout.LeftMargin, (float)MySection.MyDocStyle.Layout.PageWidth, (float)MySection.MyDocStyle.CenterLineYTop);
@ -406,7 +406,7 @@ namespace Volian.Print.Library
cb.RestoreState();
}
private bool ResetDocStyleAndValues()
private bool SetDocStyleAndValues()
{
// if this document style has another style that is for pages other than first, we need to
// reset the document style off of this section AND reset docstyle values used
@ -647,8 +647,10 @@ namespace Volian.Print.Library
_MySection = value;
MySectionTitle = ((_MySection.DisplayNumber ?? "")=="" ? "" : _MySection.DisplayNumber + " - ") + _MySection.DisplayText;
bool forceLoadSvg = false;
if (value.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && value.MyDocStyle.ResetFirstPageOnSection)
DidFirstPageDocStyle = false;
if (DidFirstPageDocStyle)
forceLoadSvg = ResetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this)
forceLoadSvg = SetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this)
Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg);
if (sectSvg != null) MySvg = sectSvg;
_YTopMargin = null;
@ -1718,7 +1720,14 @@ namespace Volian.Print.Library
plstr = plstr.Replace(match, line);
else
{
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
//if (cnt == 1)
//{
// plstr = plstr.Replace(match, line);
// svgGroup.Add(PageItemToSvgText(pageItem, plstr, yOffset));
// plstr = "";
//}
//else
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
plstr = plstr.Replace(match, "");
}
yOffset += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12);