This commit is contained in:
Kathy Ruffing 2011-06-16 10:38:24 +00:00
parent 82900d18f0
commit c37687639d

View File

@ -37,6 +37,7 @@ namespace Volian.Print.Library
}
public const string BoxThin = "\x2510.\x2500.\x250c.\x2502. . .\x2518.\x2514. .\x2500. . ";
const string BoxThick = "\x2584.\x2584.\x2584.\x2588. . .\x2580.\x2580. .\x2580. . ";
const string BoxDouble = "\x2557.\x2550.\x2554.\x2551. . .\x255D.\x255A. .\x2550. . ";
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
{
cb.SaveState();
@ -58,24 +59,34 @@ namespace Volian.Print.Library
}
else
{
const float llxOffset = 3;
float lineThickness = 0;
switch (MyBox.BoxStyle)
{
case BoxThin:
lineThickness = .6F;
cb.SetLineWidth(lineThickness);
cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier);
break;
case BoxThick:
lineThickness = 6;
cb.SetLineWidth(lineThickness);
cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier);
break;
case BoxDouble:
lineThickness = .6F;
cb.SetLineWidth(lineThickness);
// outer rectangle (rectangle's are defined as x,y,w,h)
cb.Rectangle(left + llxOffset - lineThickness * 1.5F, bottom - lineThickness, right - left + lineThickness * 3, (Height + lineThickness * 2) * MyPageHelper.YMultiplier);
// inner rectangle
cb.Rectangle(left + llxOffset + lineThickness, bottom + lineThickness * 1.5F, right - left - lineThickness * 2, (Height - lineThickness * 3) * MyPageHelper.YMultiplier);
break;
default:
// For other than OHLP/HLP. For those not matching the HLP Boxes
// For other than thick, thin and double.
Console.WriteLine("NO BOXES");
break;
//throw new Exception("Missing vlnBox handler");
}
const float llxOffset = 3;
cb.SetLineWidth(lineThickness);
cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier);
}
cb.Stroke();
if (textLayer != null) cb.EndLayer();