For IP3, Use RNOSepLineLength to draw the separator line.
This commit is contained in:
parent
e675a1ca4a
commit
17801bf257
@ -22,6 +22,13 @@ namespace Volian.Print.Library
|
||||
get { return _ExtendChangeBar; }
|
||||
set { _ExtendChangeBar = value; }
|
||||
}
|
||||
private float _XLength = 0;
|
||||
public float XLength
|
||||
{
|
||||
get { return _XLength; }
|
||||
set { _XLength = value; }
|
||||
}
|
||||
|
||||
/* if flag set and separator defined then output separator */
|
||||
/*if separator is a control-A use RNOSepLine*/
|
||||
public vlnRNOSeparator(vlnParagraph parent, PdfContentByte cb, string sepStr, float xoffset, float yoffset, FormatInfo formatInfo, bool extendChangeBar)
|
||||
@ -29,19 +36,44 @@ namespace Volian.Print.Library
|
||||
ExtendChangeBar = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeBarToRNOSep ? extendChangeBar : false;
|
||||
YOffset = yoffset;
|
||||
XOffset = xoffset;
|
||||
XLength = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.RNOSepLineLength??0;
|
||||
_MyParent = parent;
|
||||
if (sepStr != null)
|
||||
Rtf = GetRtf(sepStr, formatInfo.PlantFormat.FormatData.Font);
|
||||
else
|
||||
Rtf = "--------------------------"; //TODO - What should this be: is this Ctrl-A?
|
||||
MyFont = formatInfo.PlantFormat.FormatData.Font;
|
||||
Width = sepStr.Length * MyFont.CharsToTwips + _WidthAdjust;
|
||||
if (XLength == 0)
|
||||
{
|
||||
if (sepStr != null)
|
||||
Rtf = GetRtf(sepStr, formatInfo.PlantFormat.FormatData.Font);
|
||||
else
|
||||
Rtf = "--------------------------"; //TODO - What should this be: is this Ctrl-A?
|
||||
Width = sepStr.Length * MyFont.CharsToTwips + _WidthAdjust;
|
||||
}
|
||||
else
|
||||
{
|
||||
Width = XLength;
|
||||
Height = SixLinesPerInch;
|
||||
}
|
||||
}
|
||||
public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin)
|
||||
{
|
||||
MyContentByte = cb;
|
||||
float yLocation = CalculateYOffset(yPageStart, yTopMargin);
|
||||
Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, "", yBottomMargin);
|
||||
if (XLength != 0)
|
||||
{
|
||||
cb.SaveState();
|
||||
VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper;
|
||||
PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer;
|
||||
if (textLayer != null) cb.BeginLayer(textLayer);
|
||||
iTextSharp.text.Color lineColor = new iTextSharp.text.Color(PrintOverride.OverrideChangeBarColor(System.Drawing.Color.Black));
|
||||
cb.SetColorStroke(lineColor);
|
||||
cb.SetLineWidth(.5F);
|
||||
cb.MoveTo(XOffset/* + xAdj */, yLocation-7);
|
||||
cb.LineTo(XOffset + XLength, yLocation-7);
|
||||
cb.Stroke();
|
||||
if (textLayer != null) cb.EndLayer();
|
||||
cb.RestoreState();
|
||||
}
|
||||
else
|
||||
Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, "", yBottomMargin);
|
||||
return yPageStart;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user