Use Selected Slave to create a specific version of the PDFs for MSWord sections.

Replace <U-Text> with DocVersionConfig.Unit_Text
Added logic to handle setting UseISO19005_1 when creating a PDF from an MSWord Section.
Set the plot background to white if not doing compare and transparent if doing a compare.
Use Selected Slave (Unit) to create a specific version of the PDFs for MSWord sections.
This commit is contained in:
Rich 2013-11-07 21:43:47 +00:00
parent b19ce7c128
commit f9ba96fdd8
2 changed files with 21 additions and 9 deletions

View File

@ -650,13 +650,14 @@ namespace VEPROMS.CSLA.Library
{
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
if (sc != null && sc.Section_WordMargin == "Y")
{
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) { ;}
using (Pdf myPdf = Pdf.MakePdf(doc, ss*10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) { ;}
}
else
{
using (Pdf myPdf1 = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
using (Pdf myPdf1 = Pdf.MakePdf(doc, ss*10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) { ;}
}
doc.UpdateDRoUsages(roids);
@ -805,6 +806,13 @@ namespace VEPROMS.CSLA.Library
if (type == null)
type = 0;
// If multiple return values includes X-Y Plot, check to see if it is an X-Y Plot
if (val == null)
{
if(sel.Text == "<U-Text>") val =lookup.DocVersionInfo.DocVersionConfig.Unit_Text;
//val = "<U-ID>",MyDocVersion.DocVersionConfig.Unit_ID);
//text = text.Replace(@"<S\u8209?ID>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID);
//text = text.Replace("<U>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number);
}
if ((type & 4) == 4 && val.StartsWith("<<G"))
type = 4;
string roid = lookup.GetROIDByAccPagID(sel.Text, spPrefix, igPrefix);
@ -919,7 +927,7 @@ namespace VEPROMS.CSLA.Library
//sel.Range.Font.Color = (LBWdColor)WordColor(PrintOverride.OverrideTextColor(System.Drawing.Color.Black));
sel.Range.Font.Color = (LBWdColor)WordColor(OverrideColor == System.Drawing.Color.Transparent ? System.Drawing.Color.Black : OverrideColor);
sect.MSWordPageCount = myDoc.Length;
fileName = CreatePDF(fileName, openPdf);
fileName = CreatePDF(fileName, openPdf,MSWordToPDF.DebugStatus);
CloseDocument();
if (CloseWordWhenDone)
{
@ -1204,11 +1212,14 @@ namespace VEPROMS.CSLA.Library
grfx.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
grfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
grfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
grfx.Clear(System.Drawing.Color.Transparent);
grfx.Clear(MSWordToPDF.DebugStatus==1 ? System.Drawing.Color.Transparent : System.Drawing.Color.White);
//grfx.Clear(System.Drawing.Color.SlateGray);
XYPlots.XYPlot.BlackColor = MSWordToPDF.OverrideColor == Color.Red ? Color.Red : Color.Black;
XYPlots.XYPlot myPlot = new XYPlots.XYPlot(xyPlot);
myPlot.SetMargins(0, 0, 0, 0);
myPlot.Process(new VG.VGOut_Graphics(grfx));
VG.IVGOutput vgOut = new VG.VGOut_Graphics(grfx);
vgOut.DebugStatus = MSWordToPDF.DebugStatus;
myPlot.Process(vgOut);
grfx.Dispose();
GraphicsUnit gu = new GraphicsUnit();
retval = mf.GetBounds(ref gu);
@ -1345,11 +1356,11 @@ namespace VEPROMS.CSLA.Library
if (executeResult) return sel;
return null;
}
private static string CreatePDF(string fileName, bool openPdf)
private static string CreatePDF(string fileName, bool openPdf, int DebugStatus)
{
//return MyApp.CreatePDF(@"C:\Temp\" + fileName + ".pdf", openPdf);
//return MyApp.CreatePDF(VlnSettings.TemporaryFolder + "\\" + fileName + ".pdf", openPdf);
return MyApp.CreatePDF(fileName + ".pdf", openPdf);
return MyApp.CreatePDF(fileName + ".pdf", openPdf, DebugStatus);
}
}
}

View File

@ -71,13 +71,14 @@ namespace VEPROMS.CSLA.Library
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
PdfInfo myPdf = null;
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
if (sc != null && sc.Section_WordMargin == "Y")
{
myPdf = Get(sect.MyContent.MyEntry.DocID, MSWordToPDF.DebugStatus, 0, 0, 0, 0);
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0);
}
else
{
myPdf = Get(sect.MyContent.MyEntry.DocID, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth);
}
if (myPdf != null) return myPdf;