This commit is contained in:
2010-07-14 16:17:39 +00:00
parent 2bf01da344
commit ebd566dcb2
11 changed files with 1058 additions and 468 deletions

View File

@@ -25,6 +25,10 @@ namespace Volian.Print.Library
get { return _MyBox; }
set { _MyBox = value; }
}
// the following two fields are used if 'boxed' step, thus
// no 'Box' was defined in format file.
public string DefBox = null;
public float DefEnd = 0;
public vlnBox()
{
}
@@ -44,25 +48,33 @@ namespace Volian.Print.Library
float top = CalculateYOffset(yPageStart, yTopMargin) - (7*MyPageHelper.YMultiplier);
float bottom = top - (Height * MyPageHelper.YMultiplier);
float leftmargin = (float)MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin + 3;
float left = leftmargin + (float)(MyBox.Start ?? 0);
float right = leftmargin + (float)MyBox.End;
float left = (float)(MyBox.Start == null ? MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin : leftmargin + MyBox.Start);
float right = leftmargin + (float)(MyBox.End ?? DefEnd);
iTextSharp.text.Color boxColor = new iTextSharp.text.Color(PrintOverride.OverrideBoxColor(System.Drawing.Color.Black));
cb.SetColorStroke(boxColor);
switch (MyBox.BoxStyle)
if (DefBox != null)
{
case BoxThin:
cb.SetLineWidth(.6F);
cb.Rectangle(left, bottom, right - left, Height*MyPageHelper.YMultiplier);
break;
case BoxThick:
float lineThickness = 6;
cb.SetLineWidth(lineThickness);
cb.Rectangle(left, bottom + (lineThickness/2), right - left, (Height - lineThickness)*MyPageHelper.YMultiplier);
break;
default:
// For other than OHLP/HLP. For those not matching the HLP Boxes
throw new Exception("Missing vlnBox handler");
break;
cb.SetLineWidth(.6F);
cb.Rectangle(left, bottom, right - left, Height * MyPageHelper.YMultiplier);
}
else
{
switch (MyBox.BoxStyle)
{
case BoxThin:
cb.SetLineWidth(.6F);
cb.Rectangle(left, bottom, right - left, Height * MyPageHelper.YMultiplier);
break;
case BoxThick:
float lineThickness = 6;
cb.SetLineWidth(lineThickness);
cb.Rectangle(left+6, bottom + (lineThickness / 2), right - left - 6, (Height - lineThickness) * MyPageHelper.YMultiplier);
break;
default:
// For other than OHLP/HLP. For those not matching the HLP Boxes
throw new Exception("Missing vlnBox handler");
break;
}
}
cb.Stroke();
if (textLayer != null) cb.EndLayer();