diff --git a/PROMS/Formats/fmtall/vcb1all.xml b/PROMS/Formats/fmtall/vcb1all.xml index b81c2732..125418d6 100644 Binary files a/PROMS/Formats/fmtall/vcb1all.xml and b/PROMS/Formats/fmtall/vcb1all.xml differ diff --git a/PROMS/Formats/genmacall/vcb1.svg b/PROMS/Formats/genmacall/vcb1.svg index c5ba44b8..ff709e95 100644 Binary files a/PROMS/Formats/genmacall/vcb1.svg and b/PROMS/Formats/genmacall/vcb1.svg differ diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index ef5adfc5..fc7807bc 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -1043,6 +1043,18 @@ namespace Volian.Print.Library /* * Check if tokens for handling page counts ({PAGE} {OF} etc). if so, do templates. */ + if (args.MyText.Contains("{METACURPAGE}") || args.MyText.Contains("{METATOTPAGE}")) + { + ItemInfo top = MySection; + while (top.MyParent != null && !top.MyParent.IsProcedure) + { + top = top.MyParent; + } + string key = "DocCurPage." + top.ItemID; + string txt = args.MyText.Replace("{METACURPAGE}", "{PAGE}").Replace("{METATOTPAGE}", "{OF}"); + MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); + return string.Empty; + } if (args.MyText.Contains("{DOCCURPAGE}") || args.MyText.Contains("{DOCTOTPAGE}")) { string key = "DocCurPage." + MySection.ItemID; @@ -1655,10 +1667,18 @@ namespace Volian.Print.Library plstr = plstr.Replace(token, ""); //svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayText)); break; - case "{METASECTIONTITLE}": + case "{METASECTIONTITLE}": // This will print the top level section title (versus level above current) case "[METASECTIONTITLE]": if (section.MyParent.IsSection) - plstr = SplitTitle(svgGroup, pageItem, section.MyParent.DisplayText, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionTitleLength, token, plstr); + { + // get top most section: + ItemInfo top = section; + while (top.MyParent != null && !top.MyParent.IsProcedure) + { + top = top.MyParent; + } + plstr = SplitTitle(svgGroup, pageItem, top.DisplayText, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionTitleLength, token, plstr); + } else plstr = plstr.Replace(token, ""); break; @@ -1668,10 +1688,18 @@ namespace Volian.Print.Library _sectLevelNumTtlDiff = (int)pageItem.Row; //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber))); break; - case "{METASECTIONNUMBER}": + case "{METASECTIONNUMBER}": // This will print the top level section number case "[METASECTIONNUMBER]": if (section.MyParent.IsSection) - plstr = plstr.Replace(token, section.MyParent.DisplayNumber); + { + // get top most section: + ItemInfo top = section; + while (top.MyParent != null && !top.MyParent.IsProcedure) + { + top = top.MyParent; + } + plstr = plstr.Replace(token, top.DisplayNumber); + } else plstr = plstr.Replace(token, ""); break;