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) else if (!OnFoldoutPage)
{ {
if (DidFirstPageDocStyle) ResetDocStyleAndValues(); if (DidFirstPageDocStyle) SetDocStyleAndValues();
AddBookmarks(writer); AddBookmarks(writer);
MyPageCounts.CanIncrement = true; MyPageCounts.CanIncrement = true;
base.OnEndPage(writer, document); 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) 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); 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(); 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 // 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 // reset the document style off of this section AND reset docstyle values used
@ -647,8 +647,10 @@ namespace Volian.Print.Library
_MySection = value; _MySection = value;
MySectionTitle = ((_MySection.DisplayNumber ?? "")=="" ? "" : _MySection.DisplayNumber + " - ") + _MySection.DisplayText; MySectionTitle = ((_MySection.DisplayNumber ?? "")=="" ? "" : _MySection.DisplayNumber + " - ") + _MySection.DisplayText;
bool forceLoadSvg = false; bool forceLoadSvg = false;
if (value.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate && value.MyDocStyle.ResetFirstPageOnSection)
DidFirstPageDocStyle = false;
if (DidFirstPageDocStyle) 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); Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg);
if (sectSvg != null) MySvg = sectSvg; if (sectSvg != null) MySvg = sectSvg;
_YTopMargin = null; _YTopMargin = null;
@ -1718,6 +1720,13 @@ namespace Volian.Print.Library
plstr = plstr.Replace(match, line); plstr = plstr.Replace(match, line);
else else
{ {
//if (cnt == 1)
//{
// plstr = plstr.Replace(match, line);
// svgGroup.Add(PageItemToSvgText(pageItem, plstr, yOffset));
// plstr = "";
//}
//else
svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset)); svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset));
plstr = plstr.Replace(match, ""); plstr = plstr.Replace(match, "");
} }