Changed logic to properly output checkoff header "INITIALS"
This commit is contained in:
@@ -818,8 +818,52 @@ namespace Volian.Print.Library
|
||||
{ // pagination logic needs to be fixed.
|
||||
ForcePagination(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation, ref retval);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MyItemInfo.IsStepSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (MyItemInfo.ActiveSection as SectionInfo).HasInitials)
|
||||
{
|
||||
if (MyPageHelper.PrintInitials(cb,yLocation,(float) MyItemInfo.MyDocStyle.Layout.LeftMargin))
|
||||
{
|
||||
//if(yLocation != yTopMargin)
|
||||
// Console.WriteLine("'{0}',{1},'{2}',{3},{4},{5},{6}", MyItemInfo.MyProcedure.DisplayNumber, MyItemInfo.ItemID
|
||||
// , MyItemInfo.DisplayNumber, yLocation,yTopMargin,MyItemInfo.HasCautionOrNote,MyPageHelper.CurrentPageNumber+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
public static void TextAt(PdfContentByte cb,VlnSvgPageHelper myPageHelper,PageItem pi,float yloc, float leftMargin)
|
||||
{
|
||||
System.Drawing.Color sysColor = PrintOverride.OverrideSvgColor(System.Drawing.Color.Black);
|
||||
cb.SaveState();
|
||||
if (myPageHelper.PageListLayer != null) cb.BeginLayer(myPageHelper.PageListLayer);
|
||||
ColumnText ct = new ColumnText(cb);
|
||||
iTextSharp.text.Font font;
|
||||
int fontStyle = 0;
|
||||
bool underline = false;
|
||||
if (pi == null)
|
||||
{
|
||||
_MyLog.WarnFormat("Error in Initials");
|
||||
ct.SetSimpleColumn(450 + leftMargin, yloc + 6.9F, 550 + leftMargin, yloc - 50);
|
||||
font = FontFactory.GetFont("Arial", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 10F);
|
||||
}
|
||||
else
|
||||
{
|
||||
ct.SetSimpleColumn((float)pi.Col + leftMargin, yloc + 6.9F, (float)pi.Col + 100 + leftMargin, yloc - 50);
|
||||
fontStyle = (pi.Font.WindowsFont.Bold ? iTextSharp.text.Font.BOLD : 0) + (pi.Font.WindowsFont.Italic ? iTextSharp.text.Font.ITALIC : 0);
|
||||
font = FontFactory.GetFont(pi.Font.Family, BaseFont.IDENTITY_H, BaseFont.EMBEDDED,(float) pi.Font.Size,fontStyle);
|
||||
underline = pi.Font.WindowsFont.Underline;
|
||||
}
|
||||
Chunk chk = new Chunk("INITIALS", font);
|
||||
if(underline)
|
||||
chk.SetUnderline(new iTextSharp.text.Color(sysColor), 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
|
||||
Phrase ph = new Phrase(chk);
|
||||
ct.AddElement(ph);
|
||||
cb.SetColorFill(new iTextSharp.text.Color(sysColor));
|
||||
ct.Go();
|
||||
if (myPageHelper.PageListLayer != null) cb.EndLayer();
|
||||
cb.RestoreState();
|
||||
}
|
||||
private bool _PrintHeader = false;
|
||||
public bool PrintHeader
|
||||
{
|
||||
@@ -4270,9 +4314,7 @@ namespace Volian.Print.Library
|
||||
// For Calvert STP/OP: see if this section has checkoffs by looking in the section config:
|
||||
//SectionInfo si= SectionInfo.Get(itemInfo.ActiveSection.ItemID);
|
||||
SectionInfo si = itemInfo.ActiveSection.GetSectionInfo();
|
||||
SectionConfig sectCfg = si.MyConfig as SectionConfig;
|
||||
int sc = sectCfg.Section_CheckoffListSelection;
|
||||
ChkOff = (sc >= 2) || si.HasStepCheckOffs;
|
||||
ChkOff = si.HasInitials;
|
||||
}
|
||||
if (ChkOff)
|
||||
{
|
||||
|
Reference in New Issue
Block a user