diff --git a/PROMS/Volian.Print.Library/Grid2Pdf.cs b/PROMS/Volian.Print.Library/Grid2Pdf.cs index 97ad7d93..51ecec9a 100644 --- a/PROMS/Volian.Print.Library/Grid2Pdf.cs +++ b/PROMS/Volian.Print.Library/Grid2Pdf.cs @@ -1050,6 +1050,7 @@ public string Path } public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) { + // B2021-137 first print the table shading, then print the table with the borders and text foreach (vlnCell myCell in this) { // B2020-034 - the topPlacementAdjust is used to position the text vertically in the table cells. @@ -1068,7 +1069,28 @@ public string Path if (largestFontSize > 18) // C2021-005 Only need when cell text has the empty box symbol which WCN format override the size to 20pts topPlacementAdjust = (int)ItemInfo.Get(myCell.MyTable.ItemID).ActiveFormat.MyStepSectionLayoutData.OverrideTableTopIndent; } - myCell.ToPdf(myColumnText, left, top, topPlacementAdjust); + myCell.ToPdf(myColumnText, left, top, topPlacementAdjust, true); // B2021-137 only do the table shading + } + // do the borders + foreach (vlnCell myCell in this) + { + // B2020-034 - the topPlacementAdjust is used to position the text vertically in the table cells. + // B2020-082 - AEP Production - American Electric Power - D. C. Cook + // / Current (Post FLEX) - U1 NOP NOT [EOPs] - ES-3.3.SProcedure Body.S9..S1..S1..T1. + // Table did not print properly. Cell text was truncated. + float largestFontSize = GetLargestFontSize(myCell); // C2021-005 get the largest font size for the cell text + int topPlacementAdjust = (myCell.MyPara.Font.Size == 12 && + myCell.MyPara.Font.Familyname != "Courier New" && + myCell.MyPara.Font.Familyname != "VESymbFix") ? 1 : 3; // for font size of 12 set to one, else set to 3 + if (largestFontSize != 12) // C2021-005 adjust the text positon based on the font size change + topPlacementAdjust -= (int)(largestFontSize - 12); // C2021-005 adjust placement based on font size change + // B2020-140 for Wolf Creek check boxes in tables were printing too high in the table cells - added format variable to overide topPlacementAdjust + if (myCell.MyPara != null && ItemInfo.Get(myCell.MyTable.ItemID).ActiveFormat.MyStepSectionLayoutData.OverrideTableTopIndent != null) + { + if (largestFontSize > 18) // C2021-005 Only need when cell text has the empty box symbol which WCN format override the size to 20pts + topPlacementAdjust = (int)ItemInfo.Get(myCell.MyTable.ItemID).ActiveFormat.MyStepSectionLayoutData.OverrideTableTopIndent; + } + myCell.ToPdf(myColumnText, left, top, topPlacementAdjust, false); // B2021-137 Now do the borders and text } } #endregion @@ -1441,7 +1463,9 @@ public string Path cb.RestoreState(); } //RHM 20180319 End of Add - public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top, int topPlacementAdjust) + // B2021-137 Added doShading parameter + // We call this twice. The first time to print the shading the second time to print the borders and text + public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top, int topPlacementAdjust, bool doShading) { myColumnText.Canvas.SaveState(); VlnSvgPageHelper _MyPageHelper = myColumnText.Canvas.PdfWriter.PageEvent as VlnSvgPageHelper; @@ -1454,7 +1478,12 @@ public string Path { h = YAdjust_h + mult * MyTable.RowTop[r2 + 1] - y; } - ShadingToPdf(myColumnText, left, top, x, w, y, h); // C2021-004 Table Cell Shading + if (doShading) + { + // B2021-137 do the shading then jump out + ShadingToPdf(myColumnText, left, top, x, w, y, h); // C2021-004 Table Cell Shading + return; + } BordersToPdf(myColumnText, left, top, x, w, y, h ); float hAdjust = VeritcalTextAlignment(h,_MyPageHelper.YMultiplier); iTextSharp.text.pdf.ColumnText myColumnText1 = new iTextSharp.text.pdf.ColumnText(myColumnText.Canvas);