C2018-023 added a “/NW” switch for use with the automated print testing (batch file) to turn off the inclusion of Word attachment text in the metafile
This commit is contained in:
@@ -776,7 +776,7 @@ namespace VEPROMS.CSLA.Library
|
||||
public static string ToPDFReplaceROs(DocumentInfo doc, List<string> roids, ItemInfo sect, VolianStatusChange statusChange)
|
||||
{
|
||||
//ItemInfo sect = doc.DocumentEntries[0].MyContent.ContentItems[0];
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) Volian.Base.Library.BaselineMetaFile.WriteLine("WrdSec SecNum=\"{0}\" SecTitle=\"{1}\" Itemid={2}", sect.MyActiveSection.DisplayNumber, sect.MyActiveSection.DisplayText, sect.ItemID);
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("WrdSec SecNum=\"{0}\" SecTitle=\"{1}\" Itemid={2}", sect.MyActiveSection.DisplayNumber, sect.MyActiveSection.DisplayText, sect.ItemID);
|
||||
return ToPDFReplaceROs(sect, false, roids, statusChange);
|
||||
}
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -847,10 +847,10 @@ namespace VEPROMS.CSLA.Library
|
||||
//_MyLog.Error("Could not Adjust Margins", ex);
|
||||
}
|
||||
string txtForBaseline = ""; // C2018-018 save the contents of Word sections - after resolving RO values
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) Volian.Base.Library.BaselineMetaFile.WriteLine("++BgnTxt++");
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("++BgnTxt++");
|
||||
LBSelection sel = MyApp.Selection;
|
||||
sel.WholeStory();
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) txtForBaseline = sel.Text;
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = sel.Text;
|
||||
LBSelection selxy = hasRos ? FindXyPlot() : null; // look for XY Plot language typed into word section (not an RO)
|
||||
string pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png";
|
||||
if (File.Exists(pngFile)) File.Delete(pngFile);
|
||||
@@ -861,7 +861,7 @@ namespace VEPROMS.CSLA.Library
|
||||
string xyplot = selxy.Text;
|
||||
xyplot = xyplot.Replace("`", "\xB0");
|
||||
xyplot = xyplot.Replace("\xF8", "\xB0");
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen)
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText)
|
||||
{
|
||||
txtForBaseline = txtForBaseline.Replace("`", "\xB0");
|
||||
txtForBaseline = txtForBaseline.Replace("\xF8", "\xB0");
|
||||
@@ -870,7 +870,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
xyplot = xyplot.Replace("^", "\x394"); // delta
|
||||
xyplot = xyplot.Replace("\x7F", "\x394"); //delta
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen)
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText)
|
||||
{
|
||||
txtForBaseline = txtForBaseline.Replace("^", "\x394");
|
||||
txtForBaseline = txtForBaseline.Replace("\x7F", "\x394");
|
||||
@@ -944,7 +944,7 @@ namespace VEPROMS.CSLA.Library
|
||||
int lastStart = sel == null ? 0 : sel.Start;
|
||||
while (sel != null)
|
||||
{
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) roTokenForBaseline = sel.Text;
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) roTokenForBaseline = sel.Text;
|
||||
if (statusChange != null) statusChange(VolianStatusType.Update, sel.Start, string.Format("{0} ROs Refreshed", ++roCount));
|
||||
string val = lookup.GetROValueByAccPagID(sel.Text, spPrefix, igPrefix);
|
||||
int? type = lookup.GetROTypeByAccPagID(sel.Text, spPrefix, igPrefix);
|
||||
@@ -1015,13 +1015,13 @@ namespace VEPROMS.CSLA.Library
|
||||
shape.Left = xxx;
|
||||
shape.Top = pt.Y;
|
||||
//_MyLog.WarnFormat("Shape.Left={0}, Shape.Top={1}", shape.Left, shape.Top);
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, string.Format("[{0}]", vals[0]));
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, string.Format("[{0}]", vals[0]));
|
||||
imageROTokenReplaced = true;
|
||||
}
|
||||
if (!imageROTokenReplaced)
|
||||
{
|
||||
sel.Text = string.Format("Bad Image Link (Missing Image File:{0})", vals[0]);
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, sel.Text);
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, sel.Text);
|
||||
}
|
||||
}
|
||||
else if ((int)type == 4) // X-Y Plot
|
||||
@@ -1034,7 +1034,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (convertCaretToDeltaSymbol)
|
||||
val = val.Replace("^", "\x394"); // delta
|
||||
val = val.Replace("\x7F", "\x394"); //delta
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) txtForBaseline = txtForBaseline.Replace(sel.Text, val);
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(sel.Text, val);
|
||||
// An X/Y Plot RO type might have text preceding the Plot Commands
|
||||
int pstart = val.IndexOf("<<G"); // find the starting Plot Command
|
||||
// B2017-217 Added logic so that underscores are not converted to underline
|
||||
@@ -1072,13 +1072,13 @@ namespace VEPROMS.CSLA.Library
|
||||
shape.Left = xxx;
|
||||
shape.Top = pt.Y;
|
||||
sel.WholeStory();
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) Volian.Base.Library.BaselineMetaFile.WriteLine("{0}", TextForBaseline.FixText(txtForBaseline,true));
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("{0}", TextForBaseline.FixText(txtForBaseline, true));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// something is wrong with the X/Y plot RO.
|
||||
// print out the un-processed X/Y plot RO value
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, string.Format("BAD XYPLOT: {0}", val));
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, string.Format("BAD XYPLOT: {0}", val));
|
||||
sel.Text = val;
|
||||
//return null;
|
||||
}
|
||||
@@ -1093,7 +1093,7 @@ namespace VEPROMS.CSLA.Library
|
||||
//AddInfo("\tRO Found {0} = '{1}'", sel.Text, val);
|
||||
// if val is null, then InsertROValue will put in "RO Not Found" for the value
|
||||
float indent = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToTextBoundary);
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, val);
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) txtForBaseline = txtForBaseline.Replace(roTokenForBaseline, val);
|
||||
// B2017-217 Added logic so that underscores are not converted to underline
|
||||
InsertROValue(sel, val, sect.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper, indent, sect.MyActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.ConvertUnderscoreToUnderline);
|
||||
}
|
||||
@@ -1107,7 +1107,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (statusChange != null) statusChange(VolianStatusType.Update, 0, "Creating PDF");
|
||||
sel = MyApp.Selection;
|
||||
sel.WholeStory();
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) Volian.Base.Library.BaselineMetaFile.WriteLine("{0}", TextForBaseline.FixText(txtForBaseline,true));
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("{0}", TextForBaseline.FixText(txtForBaseline, true));
|
||||
//sel.Range.Font.Color = (LBWdColor)WordColor(PrintOverride.OverrideTextColor(System.Drawing.Color.Black));
|
||||
//Console.WriteLine("'{0}' Colors Sel '{1}' Override '{2}' Transparent '{3}' Black '{4}' Red '{5}'", sect.DisplayNumber, sel.Range.Font.Color, OverrideColor, System.Drawing.Color.Transparent, System.Drawing.Color.Black, System.Drawing.Color.Red);
|
||||
if(sel.Range.Font.Color != (LBWdColor)9999999 || OverrideColor == System.Drawing.Color.Red)// B2017-144 If the font color is 9999999 then the color is mixed, and if the override color isn't red, don't change the color.
|
||||
@@ -1127,7 +1127,7 @@ namespace VEPROMS.CSLA.Library
|
||||
CloseAppAfterWait();
|
||||
}
|
||||
if (statusChange != null) statusChange(VolianStatusType.Complete, 0, "");
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen) Volian.Base.Library.BaselineMetaFile.WriteLine("++EndTxt++");
|
||||
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("++EndTxt++");
|
||||
GC.Collect(); //jsj 2-15-2016 - for memeory garbage collection
|
||||
return fileName;
|
||||
}
|
||||
|
Reference in New Issue
Block a user