Support PSNotOnFirst pagelist flag so that pagelist item not printed on first page of section
Adjustments for centerline y-positioning when there is a double box Add check so that centering single item (note/caution) works for Calvert; fix pagelist Section/metasection titles usage for first metasection; adjust starting y-position if doing a doublebox; if the y location of bottom message would go below bottom margin, reset to bottom margin; do rno bottom continue message Added Bottom continue message support for RNO column; Draw Horizontal line if no doublehls as first item on page; support pagenumbering GroupedByLevel; Support PSNotFirst pagelist flag; Don’t put out <NO TITLE> as pagelist item if formatflag is not No Title printing; process Procdescriptor for Calvert (only check 1st character of eopnum for ‘@’); handle @@ in pagelist items
This commit is contained in:
@@ -45,6 +45,12 @@ namespace Volian.Print.Library
|
||||
get { return _BottomMessage; }
|
||||
set { _BottomMessage = value; }
|
||||
}
|
||||
private vlnText _BottomMessageR; // Added if there are 2 messages, in AER AND RNO (for BGE)
|
||||
public vlnText BottomMessageR
|
||||
{
|
||||
get { return _BottomMessageR; }
|
||||
set { _BottomMessageR = value; }
|
||||
}
|
||||
Dictionary<int, vlnParagraph> _MyParagraphs = new Dictionary<int, vlnParagraph>();
|
||||
public Dictionary<int, vlnParagraph> MyParagraphs
|
||||
{
|
||||
@@ -159,13 +165,32 @@ namespace Volian.Print.Library
|
||||
}
|
||||
if (MySection.MyDocStyle.StructureStyle.Style==null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0)
|
||||
CurrentTOCPageNumber++;
|
||||
if (MySection.MyDocStyle.CenterLineX != null && MySection.ColumnMode > 0)
|
||||
DrawCenterLine(writer.DirectContent, MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0, MySection.MyDocStyle.CenterLineYTop ?? 0, MySection.MyDocStyle.CenterLineYBottom ?? 0);
|
||||
if (MySection.MyDocStyle.CenterLineX != null)
|
||||
{
|
||||
if ((MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)
|
||||
DrawHorizontal(writer.DirectContent, (float)MySection.MyDocStyle.Layout.LeftMargin, (float)MySection.MyDocStyle.Layout.PageWidth, (float)MySection.MyDocStyle.CenterLineYTop);
|
||||
if (MySection.ColumnMode > 0)
|
||||
DrawCenterLine(writer.DirectContent, MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0, MySection.MyDocStyle.CenterLineYTop ?? 0, MySection.MyDocStyle.CenterLineYBottom ?? 0);
|
||||
}
|
||||
PageListTopCheckOffHeader = null;
|
||||
PageListLastCheckOffHeader = null;
|
||||
YMultiplier = 1;
|
||||
PrintedAPage = true;
|
||||
}
|
||||
private void DrawHorizontal(PdfContentByte cb, float left, float right, float yoff)
|
||||
{
|
||||
// if there are gaps, check to be sure top isn't a double line box. If it's a box, don't draw the top line.
|
||||
if (MyGaps != null && MyGaps.Count > 0 && MyGaps[0].YTop == (float)MySection.MyDocStyle.CenterLineYTop) return;
|
||||
cb.SaveState();
|
||||
if (PageListLayer != null) cb.BeginLayer(PageListLayer);
|
||||
cb.SetColorStroke(new Color(PrintOverride.SvgColor));
|
||||
//cb.SetColorStroke(lineColor);
|
||||
cb.MoveTo(left, yoff);
|
||||
cb.LineTo(right, yoff);
|
||||
cb.Stroke();
|
||||
if (PageListLayer != null) cb.EndLayer();
|
||||
cb.RestoreState();
|
||||
}
|
||||
private Gaps _MyGaps;
|
||||
public Gaps MyGaps
|
||||
{
|
||||
@@ -207,7 +232,7 @@ namespace Volian.Print.Library
|
||||
// the end message for EOP procedure 15.2 was at the very bottom of the page.
|
||||
// the remaining center line was drawn past the page boarder. there was no need
|
||||
// to print it for cases like that
|
||||
if (ylast > yBottom)
|
||||
if (ylast > yBottom)
|
||||
cb.LineTo(xLoc, yBottom);
|
||||
cb.Stroke();
|
||||
if (PageListLayer != null) cb.EndLayer();
|
||||
@@ -367,6 +392,11 @@ namespace Volian.Print.Library
|
||||
BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp);
|
||||
BottomMessage = null; // Only output it once.
|
||||
}
|
||||
if (BottomMessageR != null)
|
||||
{
|
||||
BottomMessageR.ToPdf(cb, 0, ref tmp, ref tmp);
|
||||
BottomMessageR = null; // Only output it once.
|
||||
}
|
||||
}
|
||||
public void DrawBottomMessage(PdfContentByte cb)
|
||||
{
|
||||
@@ -705,6 +735,7 @@ namespace Volian.Print.Library
|
||||
case E_NumberingSequence.WithinEachSection:
|
||||
key = key + "." + MySection.ItemID;
|
||||
break;
|
||||
case E_NumberingSequence.GroupedByLevel:
|
||||
case E_NumberingSequence.Like6_ButDoesntNeedSubsection:
|
||||
if (MySection.MyParent.IsSection)
|
||||
key = key + "." + MySection.MyParent.ItemID;
|
||||
@@ -828,6 +859,14 @@ namespace Volian.Print.Library
|
||||
//if (pageItem.Token.Contains("HLSTEXT"))
|
||||
// Console.WriteLine("{0} - PageList Token", pageItem.Token);
|
||||
|
||||
// the pagelist 'justify="{PSNotFirst}"' flag only puts item out if not on first page of section, check for this
|
||||
if (((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSNotFirst) == VEPROMS.CSLA.Library.E_Justify.PSNotFirst)
|
||||
&& PrintedSectionPage == 0)
|
||||
{
|
||||
PrintedSectionPage++;
|
||||
continue;
|
||||
}
|
||||
|
||||
VE_Font useFontForCheckOffHeader = null;
|
||||
if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0))))
|
||||
{
|
||||
@@ -1069,8 +1108,13 @@ namespace Volian.Print.Library
|
||||
//float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12;
|
||||
float linelen = tlen * (float)pageItem.Font.CPI / 12;
|
||||
string title = section.MyProcedure.MyContent.Text;
|
||||
if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title = title.ToUpper();
|
||||
plstr = SplitTitle(svgGroup, pageItem, title, (int)linelen, token, plstr); //,rowAdj);
|
||||
if (title.Contains("<NO TITLE>") && !section.ActiveFormat.PlantFormat.FormatData.ProcData.PrintNoTitle)
|
||||
plstr = "";
|
||||
else
|
||||
{
|
||||
if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title = title.ToUpper();
|
||||
plstr = SplitTitle(svgGroup, pageItem, title, (int)linelen, token, plstr); //,rowAdj);
|
||||
}
|
||||
break;
|
||||
case "{COVERTITLE1}":
|
||||
case "[COVERTITLE1]":
|
||||
@@ -1224,6 +1268,17 @@ namespace Volian.Print.Library
|
||||
}
|
||||
if (pd.MatchProcNumber == "@")
|
||||
{
|
||||
// 16bit code looked like it only checked for the first character, but this code looks at
|
||||
// all characters. It was not working correctly for BGE. Didn't want to change it for other
|
||||
// plants that have been delivered - so added special code for BGE.
|
||||
if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert)
|
||||
{
|
||||
if (Regex.IsMatch(procnum.Substring(0,1),"[A-Za-z]"))
|
||||
plstr = pd.ProcDescr1;
|
||||
else
|
||||
plstr = "";
|
||||
break;
|
||||
}
|
||||
if (Regex.IsMatch(procnum, "^[A-Za-z]+$"))
|
||||
plstr = pd.ProcDescr1;
|
||||
else
|
||||
@@ -1389,13 +1444,22 @@ namespace Volian.Print.Library
|
||||
if (len == null || len == 0 || ItemInfo.StripRtfFormatting(title).Length < len)
|
||||
{
|
||||
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, ""); // this would have been done in proctitle1
|
||||
plstr = plstr.Replace(match, title);
|
||||
plstr = plstr.Replace(match, title).Replace("@@","");
|
||||
//svgGroup.Add(PageItemToSvgText(pageItem, title));
|
||||
return plstr;
|
||||
}
|
||||
|
||||
// BGE has a '@@' in its section number/title pagelist item for eops. If the title goes onto two lines,
|
||||
// the '@@' marked the starting location for the title. Process this differently than other split titles:
|
||||
if (plstr.Contains("@@"))
|
||||
{
|
||||
DoSpecialSectNumTitle(svgGroup, pageItem, title, len, match, plstr);
|
||||
return ""; // all resolved pagelist items were already added to svgGroup for printing.
|
||||
}
|
||||
|
||||
// Otherwise determine how many line to split the text into
|
||||
List<string> titleLines = SplitText(title, (int)len);
|
||||
|
||||
|
||||
// Adjust y location based on which pagelist token & how many lines. Proctitle1 is adjusted if
|
||||
// there are more than 2 lines (proctitle1 should have it's own y location that is used if there are 1 or 2 lines.)
|
||||
float yOffset = (pageItem.Token.Contains("1") && titleLines.Count <= 2) ? 0 : (-6 * (titleLines.Count - 1));
|
||||
@@ -1425,6 +1489,26 @@ namespace Volian.Print.Library
|
||||
}
|
||||
return plstr;
|
||||
}
|
||||
|
||||
private void DoSpecialSectNumTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr)
|
||||
{
|
||||
// first add anything up to the "@@" to the svgGroup:
|
||||
string befAts = plstr.Substring(0, plstr.IndexOf("@@"));
|
||||
svgGroup.Add(PageItemToSvgText(pageItem, befAts, 0));
|
||||
|
||||
// get the new xoffset. This will be the column value + the size of 'stuff' before the '@@'
|
||||
float xoff = (float)pageItem.Col;
|
||||
xoff += (befAts.Length * pageItem.Font.CharsToTwips);
|
||||
|
||||
float yoff = (float)pageItem.Row;
|
||||
|
||||
List<string> titleLines = SplitText(title, (int)len);
|
||||
foreach (string line in titleLines)
|
||||
{
|
||||
svgGroup.Add(PageItemToSvgText(pageItem.Token, yoff, xoff, (E_Justify)pageItem.Justify, pageItem.Font, line, MySection));
|
||||
yoff += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12);
|
||||
}
|
||||
}
|
||||
private string SplitTitleAndUnit(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string token, string plstr)
|
||||
{
|
||||
List<string> titleLines = SplitText(title, (int)len);
|
||||
|
Reference in New Issue
Block a user