This commit is contained in:
parent
71d5d8551e
commit
42af3e3e76
@ -41,6 +41,8 @@ namespace Volian.Print.Library
|
|||||||
const string BoxDouble = "\x2557.\x2550.\x2554.\x2551. . .\x255D.\x255A. .\x2550. . ";
|
const string BoxDouble = "\x2557.\x2550.\x2554.\x2551. . .\x255D.\x255A. .\x2550. . ";
|
||||||
const string BoxFPLNote = "\x2557.\x2550\xad.\x2554\xad.\x2551. . .\x255d.\x255a\xad. .\x2550\xad. . ";
|
const string BoxFPLNote = "\x2557.\x2550\xad.\x2554\xad.\x2551. . .\x255d.\x255a\xad. .\x2550\xad. . ";
|
||||||
const string BoxFPLCaution = "\x2588.\x2580.\x2588.\x2588. . .\x2588.\x2588. .\x2584. . ";
|
const string BoxFPLCaution = "\x2588.\x2580.\x2588.\x2588. . .\x2588.\x2588. .\x2584. . ";
|
||||||
|
const string BoxAsterisk = " *.* .* . . . . *.* . .* . . ";
|
||||||
|
|
||||||
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
|
public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin)
|
||||||
{
|
{
|
||||||
if (MyBox == null) return yPageStart;
|
if (MyBox == null) return yPageStart;
|
||||||
@ -99,6 +101,45 @@ namespace Volian.Print.Library
|
|||||||
float YbxAdjust = 6.5F;
|
float YbxAdjust = 6.5F;
|
||||||
cb.Rectangle(left + llxOffset, bottom - YbxAdjust + (lineThickness / 2), right - left, (Height - lineThickness + 2*YbxAdjust) * MyPageHelper.YMultiplier);
|
cb.Rectangle(left + llxOffset, bottom - YbxAdjust + (lineThickness / 2), right - left, (Height - lineThickness + 2*YbxAdjust) * MyPageHelper.YMultiplier);
|
||||||
break;
|
break;
|
||||||
|
case BoxAsterisk:
|
||||||
|
// this box is not drawn, it is a series of asterisks drawn above and below text.
|
||||||
|
// For this box, there are no vertical edges (RGE uses this box type)
|
||||||
|
top = CalculateYOffset(yPageStart, yTopMargin);
|
||||||
|
bottom = top - Height;
|
||||||
|
VE_Font vf = MyParent.MyItemInfo.FormatStepData.Font;
|
||||||
|
|
||||||
|
// Top line first:
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append(MyBox.BXULC);
|
||||||
|
float size = (float)(MyBox.BXULC.Length * (72/vf.CPI));
|
||||||
|
while (size < MyBox.End)
|
||||||
|
{
|
||||||
|
sb.Append(MyBox.BXHorz);
|
||||||
|
size = size + (float)(MyBox.BXHorz.Length * (72/vf.CPI));
|
||||||
|
}
|
||||||
|
// Tack on the right upper corner. For some reason, the upper right corner in the
|
||||||
|
// formats had the first character as a space, this would put two spaces in a row
|
||||||
|
// at the end of the string, so remove the space before tacking on the upper right
|
||||||
|
// corner:
|
||||||
|
string bxstr = sb.ToString().TrimEnd() + MyBox.BXURC;
|
||||||
|
size = size + (float)((MyBox.BXURC.Length) * (72/vf.CPI));
|
||||||
|
Rtf = GetRtf(bxstr, vf);
|
||||||
|
Rtf2Pdf.TextAt(cb, IParagraph, left, top, size, 100, "", yBottomMargin);
|
||||||
|
|
||||||
|
// Bottom line now
|
||||||
|
sb.Remove(0, sb.Length);
|
||||||
|
sb.Append(MyBox.BXLLC);
|
||||||
|
size = (float)(MyBox.BXLLC.Length * (72 / vf.CPI));
|
||||||
|
while (size < MyBox.End)
|
||||||
|
{
|
||||||
|
sb.Append(MyBox.BXHorz);
|
||||||
|
size = size + (float)(MyBox.BXHorz.Length * (72 / vf.CPI));
|
||||||
|
}
|
||||||
|
bxstr = sb.ToString().TrimEnd() + MyBox.BXLRC;
|
||||||
|
size = size + (float)((MyBox.BXLRC.Length) * (72/vf.CPI));
|
||||||
|
Rtf = GetRtf(bxstr, vf);
|
||||||
|
Rtf2Pdf.TextAt(cb, IParagraph, left, bottom, size, 100, "", yBottomMargin);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// For other than thick, thin and double.
|
// For other than thick, thin and double.
|
||||||
if (!_UnimplementedBoxStyles.Contains(MyBox.BoxStyle))
|
if (!_UnimplementedBoxStyles.Contains(MyBox.BoxStyle))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user