This commit is contained in:
2010-07-14 16:17:39 +00:00
parent 2bf01da344
commit ebd566dcb2
11 changed files with 1058 additions and 468 deletions

View File

@@ -32,13 +32,11 @@ namespace PrintMSWord
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pDFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.analyzeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.panel1 = new System.Windows.Forms.Panel();
this.cbDebugOutput = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.tbTimings = new System.Windows.Forms.TextBox();
this.tbPageCount = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.cbWatermark = new System.Windows.Forms.ComboBox();
this.tbRevDate = new System.Windows.Forms.TextBox();
@@ -55,11 +53,11 @@ namespace PrintMSWord
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.pDFToolStripMenuItem,
this.analyzeToolStripMenuItem});
this.pDFToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(844, 24);
this.menuStrip1.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2);
this.menuStrip1.Size = new System.Drawing.Size(1125, 28);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
@@ -68,50 +66,43 @@ namespace PrintMSWord
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 24);
this.fileToolStripMenuItem.Text = "&File";
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(102, 24);
this.exitToolStripMenuItem.Text = "E&xit";
//
// pDFToolStripMenuItem
//
this.pDFToolStripMenuItem.Name = "pDFToolStripMenuItem";
this.pDFToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
this.pDFToolStripMenuItem.Size = new System.Drawing.Size(47, 24);
this.pDFToolStripMenuItem.Text = "PDF";
this.pDFToolStripMenuItem.Click += new System.EventHandler(this.pDFToolStripMenuItem_Click);
//
// analyzeToolStripMenuItem
//
this.analyzeToolStripMenuItem.Name = "analyzeToolStripMenuItem";
this.analyzeToolStripMenuItem.Size = new System.Drawing.Size(60, 20);
this.analyzeToolStripMenuItem.Text = "Analyze";
this.analyzeToolStripMenuItem.Click += new System.EventHandler(this.analyzeToolStripMenuItem_Click);
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsslStatus});
this.statusStrip1.Location = new System.Drawing.Point(0, 315);
this.statusStrip1.Location = new System.Drawing.Point(0, 390);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(844, 22);
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0);
this.statusStrip1.Size = new System.Drawing.Size(1125, 25);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// tsslStatus
//
this.tsslStatus.Name = "tsslStatus";
this.tsslStatus.Size = new System.Drawing.Size(39, 17);
this.tsslStatus.Size = new System.Drawing.Size(50, 20);
this.tsslStatus.Text = "Ready";
//
// panel1
//
this.panel1.Controls.Add(this.cbDebugOutput);
this.panel1.Controls.Add(this.tbTimings);
this.panel1.Controls.Add(this.tbPageCount);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.cbWatermark);
this.panel1.Controls.Add(this.tbRevDate);
@@ -119,47 +110,47 @@ namespace PrintMSWord
this.panel1.Controls.Add(this.tbRev);
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
this.panel1.Location = new System.Drawing.Point(485, 24);
this.panel1.Location = new System.Drawing.Point(646, 28);
this.panel1.Margin = new System.Windows.Forms.Padding(4);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(359, 291);
this.panel1.Size = new System.Drawing.Size(479, 362);
this.panel1.TabIndex = 2;
//
// cbDebugOutput
//
//
//
//
this.cbDebugOutput.BackgroundStyle.Class = "";
this.cbDebugOutput.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cbDebugOutput.Location = new System.Drawing.Point(11, 39);
this.cbDebugOutput.Name = "cbDebugOutput";
this.cbDebugOutput.Size = new System.Drawing.Size(147, 23);
this.cbDebugOutput.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbDebugOutput.TabIndex = 9;
this.cbDebugOutput.Text = "Debug Output";
//
// tbTimings
//
this.tbTimings.AcceptsReturn = true;
this.tbTimings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbTimings.Location = new System.Drawing.Point(0, 56);
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbTimings.Location = new System.Drawing.Point(0, 69);
this.tbTimings.Margin = new System.Windows.Forms.Padding(4);
this.tbTimings.Multiline = true;
this.tbTimings.Name = "tbTimings";
this.tbTimings.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbTimings.Size = new System.Drawing.Size(359, 235);
this.tbTimings.Size = new System.Drawing.Size(477, 292);
this.tbTimings.TabIndex = 8;
//
// tbPageCount
//
this.tbPageCount.AcceptsReturn = true;
this.tbPageCount.Location = new System.Drawing.Point(71, 29);
this.tbPageCount.Name = "tbPageCount";
this.tbPageCount.Size = new System.Drawing.Size(100, 20);
this.tbPageCount.TabIndex = 7;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 32);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(63, 13);
this.label4.TabIndex = 6;
this.label4.Text = "Page Count";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(180, 32);
this.label3.Location = new System.Drawing.Point(240, 39);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(59, 13);
this.label3.Size = new System.Drawing.Size(77, 17);
this.label3.TabIndex = 5;
this.label3.Text = "Watermark";
//
@@ -173,42 +164,47 @@ namespace PrintMSWord
"Sample",
"Reference",
"Information Only"});
this.cbWatermark.Location = new System.Drawing.Point(245, 29);
this.cbWatermark.Location = new System.Drawing.Point(327, 36);
this.cbWatermark.Margin = new System.Windows.Forms.Padding(4);
this.cbWatermark.Name = "cbWatermark";
this.cbWatermark.Size = new System.Drawing.Size(100, 21);
this.cbWatermark.Size = new System.Drawing.Size(132, 24);
this.cbWatermark.TabIndex = 4;
this.cbWatermark.Text = "(none)";
this.cbWatermark.Text = "(None)";
//
// tbRevDate
//
this.tbRevDate.AcceptsReturn = true;
this.tbRevDate.Location = new System.Drawing.Point(245, 3);
this.tbRevDate.Location = new System.Drawing.Point(327, 4);
this.tbRevDate.Margin = new System.Windows.Forms.Padding(4);
this.tbRevDate.Name = "tbRevDate";
this.tbRevDate.Size = new System.Drawing.Size(100, 20);
this.tbRevDate.Size = new System.Drawing.Size(132, 22);
this.tbRevDate.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(180, 6);
this.label2.Location = new System.Drawing.Point(240, 7);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(30, 13);
this.label2.Size = new System.Drawing.Size(38, 17);
this.label2.TabIndex = 2;
this.label2.Text = "Date";
//
// tbRev
//
this.tbRev.Location = new System.Drawing.Point(71, 3);
this.tbRev.Location = new System.Drawing.Point(95, 4);
this.tbRev.Margin = new System.Windows.Forms.Padding(4);
this.tbRev.Name = "tbRev";
this.tbRev.Size = new System.Drawing.Size(100, 20);
this.tbRev.Size = new System.Drawing.Size(132, 22);
this.tbRev.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 6);
this.label1.Location = new System.Drawing.Point(8, 7);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.Size = new System.Drawing.Size(33, 17);
this.label1.TabIndex = 0;
this.label1.Text = "Rev";
//
@@ -216,23 +212,25 @@ namespace PrintMSWord
//
this.lbProcs.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbProcs.FormattingEnabled = true;
this.lbProcs.Location = new System.Drawing.Point(0, 24);
this.lbProcs.ItemHeight = 16;
this.lbProcs.Location = new System.Drawing.Point(0, 28);
this.lbProcs.Margin = new System.Windows.Forms.Padding(4);
this.lbProcs.Name = "lbProcs";
this.lbProcs.Size = new System.Drawing.Size(485, 290);
this.lbProcs.Size = new System.Drawing.Size(646, 356);
this.lbProcs.TabIndex = 3;
this.lbProcs.DoubleClick += new System.EventHandler(this.lbProcs_DoubleClick);
this.lbProcs.SelectedValueChanged += new System.EventHandler(this.lbProcs_SelectedValueChanged);
//
// frmPrintMSWord
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(844, 337);
this.ClientSize = new System.Drawing.Size(1125, 415);
this.Controls.Add(this.lbProcs);
this.Controls.Add(this.panel1);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "frmPrintMSWord";
this.Text = "PrintMSWord";
this.Load += new System.EventHandler(this.frmPrintMSWord_Load);
@@ -253,7 +251,6 @@ namespace PrintMSWord
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem pDFToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem analyzeToolStripMenuItem;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel tsslStatus;
private System.Windows.Forms.Panel panel1;
@@ -264,8 +261,7 @@ namespace PrintMSWord
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox tbRev;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tbPageCount;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox tbTimings;
private DevComponents.DotNetBar.Controls.CheckBoxX cbDebugOutput;
}
}

View File

@@ -8,6 +8,7 @@ using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using System.IO;
using Volian.Svg.Library;
using Volian.Print.Library;
namespace PrintMSWord
{
@@ -22,30 +23,6 @@ namespace PrintMSWord
get { return tsslStatus.Text; }
set { tsslStatus.Text = value; Application.DoEvents(); }
}
private frmAnalyze _MyAnalyze;
public frmAnalyze MyAnalyze
{
get
{
if (_MyAnalyze == null)
_MyAnalyze = new frmAnalyze();
return _MyAnalyze;
}
set { _MyAnalyze = value; }
}
private void analyzeToolStripMenuItem_Click(object sender, EventArgs e)
{
MyAnalyze.Show();
}
private void frmPrintMSWord_Load(object sender, EventArgs e)
{
FileInfo xmlFile = new FileInfo("Proms2010Print.xml");
if (xmlFile.Exists)
_MyProms2010Print = SvgSerializer<Proms2010Print>.ReadFile(xmlFile.FullName);
DocVersionInfo docVersion = GetDocVersionWithContent();
lbProcs.DataSource = docVersion.Procedures;
}
Proms2010Print _MyProms2010Print;
private DocVersionInfo GetDocVersionWithContent()
{
DocVersionInfoList dvList = DocVersionInfoList.Get();
@@ -63,18 +40,18 @@ namespace PrintMSWord
{
CreatePDF();
}
private void CreatePDF()
{
Volian.Print.Library.Rtf2Pdf.PdfDebug = true;
tbTimings.Text = "";
Cursor saveCursor = this.Cursor;
this.Cursor = Cursors.WaitCursor;
Proms2010Procedure prProc = _MyProms2010Print.GetProcedure(MyProcedure);
PromsPrinter pp = new PromsPrinter(MyProcedure, prProc.Rev, prProc.RevDate, cbWatermark.Text);
ProcedureConfig.PrintWatermark pw = MyProcedure.ProcedureConfig.Print_Watermark;
PromsPrinter pp = new PromsPrinter(MyProcedure, tbRev.Text, tbRevDate.Text, pw.ToString(),cbDebugOutput.Checked, @"C:\TEMP\16Bit");
pp.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
_ElapsedTime = new Dictionary<PromsPrinterStatusType, TimeSpan>();
DateTime tStart = DateTime.Now;
string pdfFile = pp.Print(@"C:\TEMP\32Bit", _MyProms2010Print, null, this);
string pdfFile = pp.Print(@"C:\TEMP\32Bit");
DateTime tEnd = DateTime.Now;
_ElapsedTime.Add(PromsPrinterStatusType.Total, DateTime.Now - tStart);
MyStatus = pdfFile + " created.";
@@ -103,21 +80,14 @@ namespace PrintMSWord
//tbTimings.Text += string.Format("{0},{1},'{2}','{3}'", TimeSpan.FromTicks(args.When.Ticks -_StartTime.Ticks).TotalSeconds, delta.TotalMilliseconds, args.Type, args.MyStatus);
_LastTime = args.When;
}
private void lbProcs_SelectedValueChanged(object sender, EventArgs e)
{
//ProcedureInfo proc = lbProcs.SelectedValue as ProcedureInfo;
if (MyProcedure == null) return;
if (_MyProms2010Print == null) return;
Proms2010Procedure prProc = _MyProms2010Print.GetProcedure(MyProcedure);
tbRev.Text = prProc == null ? "" : prProc.Rev;
tbRevDate.Text = prProc == null ? "" : prProc.RevDate;
tbPageCount.Text = prProc == null ? "" : prProc.PageCount.ToString();
}
private void pDFToolStripMenuItem_Click(object sender, EventArgs e)
{
CreatePDF();
}
private void frmPrintMSWord_Load(object sender, EventArgs e)
{
DocVersionInfo dvi = GetDocVersionWithContent();
lbProcs.DataSource = dvi.Procedures;
}
}
}