C2018-004 logic to print meta file information

C2018-009 logic to print PROMS version on PDF pages
This commit is contained in:
2018-04-12 20:33:52 +00:00
parent 72a91a6431
commit ff796c7e1c
8 changed files with 215 additions and 35 deletions

View File

@@ -473,6 +473,8 @@ i = 0;
cb.SetColorStroke(new Color(PrintOverride.SvgColor));
if (MySection.MyDocStyle.CLineWidth != null && MySection.MyDocStyle.CLineWidth != 0) cb.SetLineWidth((float)MySection.MyDocStyle.CLineWidth);
//cb.SetColorStroke(lineColor);
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("HorzLn X1={0} Y={1} X2={2}", left, yoff, right);
cb.MoveTo(left, yoff);
cb.LineTo(right, yoff);
cb.Stroke();
@@ -511,6 +513,8 @@ i = 0;
{
foreach (Gap gap in MyGaps)
{
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("CntrLn X={0} Top={1} Btm={2}", xLoc, ylast, gap.YTop - (gap.YTop - gap.YBottom) * YMultiplier);
cb.LineTo(xLoc, gap.YTop);
cb.MoveTo(xLoc, gap.YTop - (gap.YTop - gap.YBottom) * YMultiplier);
ylast = gap.YTop - (gap.YTop - gap.YBottom) * YMultiplier;
@@ -521,8 +525,12 @@ i = 0;
// 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)
{
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("CntrLn X={0} Top={1} Btm={2}", xLoc, ylast, yBottom);
cb.LineTo(xLoc, yBottom);
}
cb.Stroke();
if (PageListLayer != null) cb.EndLayer();
cb.RestoreState();
@@ -1249,8 +1257,10 @@ i = 0;
public Dictionary<string, bool> PgLogicals;
private void AddPageListItems(Volian.Svg.Library.Svg mySvg, VEPROMS.CSLA.Library.PageStyle pageStyle, VEPROMS.CSLA.Library.SectionInfo section, bool forceLoad)
{
//Console.WriteLine("{0}", section.ActiveFormat.Name);
//Console.WriteLine("{0} pgstyle {1} section", pageStyle.Name,section.DisplayText);
SectionConfig sc = section.MyConfig as SectionConfig;
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("SecNum=\"{0}\" SecTitle=\"{1}\" DocStyle=\"{2}\" Format=\"{3}\" ItemID={4}", section.DisplayNumber, section.DisplayText, section.MyDocStyle.Name, sc.FormatSelection, section.ItemID);
Volian.Base.Library.BaselineMetaFile.WriteLine(" Pagination=\"{0}\" MSWordPgCnt={1} NumPages={2} WordMargin={3}", sc.Section_Pagination, section.MSWordPageCount, (string.IsNullOrEmpty(sc.Section_NumPages)) ? "0" : sc.Section_NumPages, (string.IsNullOrEmpty(sc.Section_WordMargin))?"N":sc.Section_WordMargin);
if (PgLogicals == null) PgLogicals = new Dictionary<string, bool>();
else PgLogicals.Clear();
@@ -1260,8 +1270,8 @@ i = 0;
SectionConfig.SectionPagination sPag = SectionConfig.SectionPagination.Separate;
if (section.IsStepSection && section.MyPrevious != null && section.MyPrevious.IsStepSection && section.MyContent.Number.ToUpper() != "FOLDOUT")
{
SectionConfig sc = section.MyConfig as SectionConfig;
sPag = sc.Section_Pagination;
SectionConfig sc1 = section.MyConfig as SectionConfig;
sPag = sc1.Section_Pagination;
}
SvgGroup svgGroup = new SvgGroup();
@@ -1403,7 +1413,11 @@ i = 0;
SvgText st = new SvgText(new System.Drawing.PointF(300, 300), "Non-printing {PAGE}", VE_Font.GetWinSysFont("Arial", 10), System.Drawing.Color.Black);
svgGroup.Add(st);
}
if (svgGroup.Count>0) mySvg.Add(svgGroup);
// C2018-004 create meta file for baseline compares
if (svgGroup.Count > 0)
mySvg.Add(svgGroup);
else
Volian.Base.Library.BaselineMetaFile.WriteLine("No Pagelist Information");
}
private string ROLookup(string accpageid, string multiid, string deflt)
{
@@ -2486,6 +2500,8 @@ i = 0;
svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT);
svgText.Y = new SvgMeasurement(row, E_MeasurementUnits.PT);
if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, Rtf2Pdf.FixText(svgText.Text));
return svgText;
}
private SvgPart PageItemToSvgText(VEPROMS.CSLA.Library.PageItem pageItem, string text, float yOffset)
@@ -2527,6 +2543,8 @@ i = 0;
svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); // new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT);
svgText.Y = new SvgMeasurement((float)(yOffset + pageItem.Row ?? 0), E_MeasurementUnits.PT);
if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, Rtf2Pdf.FixText(svgText.Text));
return svgText;
}
private SvgPart PageItemToSvgText(string token, float row, float col, E_Justify just, VE_Font font, string text, SectionInfo MySection)
@@ -2568,6 +2586,8 @@ i = 0;
svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); // new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT);
svgText.Y = new SvgMeasurement(row, E_MeasurementUnits.PT);
if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, Rtf2Pdf.FixText(svgText.Text));
return svgText;
}
private static List<string> _MissingTokens = new List<string>();