This commit is contained in:
Kathy Ruffing 2010-08-10 10:48:56 +00:00
parent b3ac6b5e82
commit 959c2e7d16
2 changed files with 71 additions and 49 deletions

View File

@ -44,6 +44,7 @@ namespace PrintMSWord
this.tbRev = new System.Windows.Forms.TextBox(); this.tbRev = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.lbProcs = new System.Windows.Forms.ListBox(); this.lbProcs = new System.Windows.Forms.ListBox();
this.pDFsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
@ -53,11 +54,11 @@ namespace PrintMSWord
// //
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem, this.fileToolStripMenuItem,
this.pDFToolStripMenuItem}); this.pDFToolStripMenuItem,
this.pDFsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2); this.menuStrip1.Size = new System.Drawing.Size(844, 24);
this.menuStrip1.Size = new System.Drawing.Size(1125, 28);
this.menuStrip1.TabIndex = 0; this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1"; this.menuStrip1.Text = "menuStrip1";
// //
@ -66,19 +67,19 @@ namespace PrintMSWord
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exitToolStripMenuItem}); this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 24); this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "&File"; this.fileToolStripMenuItem.Text = "&File";
// //
// exitToolStripMenuItem // exitToolStripMenuItem
// //
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(102, 24); this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Text = "E&xit";
// //
// pDFToolStripMenuItem // pDFToolStripMenuItem
// //
this.pDFToolStripMenuItem.Name = "pDFToolStripMenuItem"; this.pDFToolStripMenuItem.Name = "pDFToolStripMenuItem";
this.pDFToolStripMenuItem.Size = new System.Drawing.Size(47, 24); this.pDFToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
this.pDFToolStripMenuItem.Text = "PDF"; this.pDFToolStripMenuItem.Text = "PDF";
this.pDFToolStripMenuItem.Click += new System.EventHandler(this.pDFToolStripMenuItem_Click); this.pDFToolStripMenuItem.Click += new System.EventHandler(this.pDFToolStripMenuItem_Click);
// //
@ -86,17 +87,16 @@ namespace PrintMSWord
// //
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsslStatus}); this.tsslStatus});
this.statusStrip1.Location = new System.Drawing.Point(0, 390); this.statusStrip1.Location = new System.Drawing.Point(0, 315);
this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0); this.statusStrip1.Size = new System.Drawing.Size(844, 22);
this.statusStrip1.Size = new System.Drawing.Size(1125, 25);
this.statusStrip1.TabIndex = 1; this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1"; this.statusStrip1.Text = "statusStrip1";
// //
// tsslStatus // tsslStatus
// //
this.tsslStatus.Name = "tsslStatus"; this.tsslStatus.Name = "tsslStatus";
this.tsslStatus.Size = new System.Drawing.Size(50, 20); this.tsslStatus.Size = new System.Drawing.Size(39, 17);
this.tsslStatus.Text = "Ready"; this.tsslStatus.Text = "Ready";
// //
// panel1 // panel1
@ -110,10 +110,9 @@ namespace PrintMSWord
this.panel1.Controls.Add(this.tbRev); this.panel1.Controls.Add(this.tbRev);
this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Right; this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
this.panel1.Location = new System.Drawing.Point(646, 28); this.panel1.Location = new System.Drawing.Point(485, 24);
this.panel1.Margin = new System.Windows.Forms.Padding(4);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(479, 362); this.panel1.Size = new System.Drawing.Size(359, 291);
this.panel1.TabIndex = 2; this.panel1.TabIndex = 2;
// //
// cbDebugOutput // cbDebugOutput
@ -122,10 +121,13 @@ namespace PrintMSWord
// //
// //
this.cbDebugOutput.BackgroundStyle.Class = ""; this.cbDebugOutput.BackgroundStyle.Class = "";
this.cbDebugOutput.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.cbDebugOutput.Checked = true;
this.cbDebugOutput.Location = new System.Drawing.Point(11, 39); this.cbDebugOutput.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbDebugOutput.CheckValue = "Y";
this.cbDebugOutput.Location = new System.Drawing.Point(8, 32);
this.cbDebugOutput.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cbDebugOutput.Name = "cbDebugOutput"; this.cbDebugOutput.Name = "cbDebugOutput";
this.cbDebugOutput.Size = new System.Drawing.Size(147, 23); this.cbDebugOutput.Size = new System.Drawing.Size(110, 19);
this.cbDebugOutput.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.cbDebugOutput.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbDebugOutput.TabIndex = 9; this.cbDebugOutput.TabIndex = 9;
this.cbDebugOutput.Text = "Debug Output"; this.cbDebugOutput.Text = "Debug Output";
@ -136,21 +138,19 @@ namespace PrintMSWord
this.tbTimings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 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.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.tbTimings.Location = new System.Drawing.Point(0, 69); this.tbTimings.Location = new System.Drawing.Point(0, 56);
this.tbTimings.Margin = new System.Windows.Forms.Padding(4);
this.tbTimings.Multiline = true; this.tbTimings.Multiline = true;
this.tbTimings.Name = "tbTimings"; this.tbTimings.Name = "tbTimings";
this.tbTimings.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.tbTimings.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbTimings.Size = new System.Drawing.Size(477, 292); this.tbTimings.Size = new System.Drawing.Size(359, 235);
this.tbTimings.TabIndex = 8; this.tbTimings.TabIndex = 8;
// //
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(240, 39); this.label3.Location = new System.Drawing.Point(180, 32);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(77, 17); this.label3.Size = new System.Drawing.Size(59, 13);
this.label3.TabIndex = 5; this.label3.TabIndex = 5;
this.label3.Text = "Watermark"; this.label3.Text = "Watermark";
// //
@ -164,47 +164,44 @@ namespace PrintMSWord
"Sample", "Sample",
"Reference", "Reference",
"Information Only"}); "Information Only"});
this.cbWatermark.Location = new System.Drawing.Point(327, 36); this.cbWatermark.Location = new System.Drawing.Point(245, 29);
this.cbWatermark.Margin = new System.Windows.Forms.Padding(4);
this.cbWatermark.Name = "cbWatermark"; this.cbWatermark.Name = "cbWatermark";
this.cbWatermark.Size = new System.Drawing.Size(132, 24); this.cbWatermark.Size = new System.Drawing.Size(100, 21);
this.cbWatermark.TabIndex = 4; this.cbWatermark.TabIndex = 4;
this.cbWatermark.Text = "(None)"; this.cbWatermark.Text = "(None)";
// //
// tbRevDate // tbRevDate
// //
this.tbRevDate.AcceptsReturn = true; this.tbRevDate.AcceptsReturn = true;
this.tbRevDate.Location = new System.Drawing.Point(327, 4); this.tbRevDate.Location = new System.Drawing.Point(245, 3);
this.tbRevDate.Margin = new System.Windows.Forms.Padding(4);
this.tbRevDate.Name = "tbRevDate"; this.tbRevDate.Name = "tbRevDate";
this.tbRevDate.Size = new System.Drawing.Size(132, 22); this.tbRevDate.Size = new System.Drawing.Size(100, 20);
this.tbRevDate.TabIndex = 3; this.tbRevDate.TabIndex = 3;
this.tbRevDate.Text = "07/27/10";
// //
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(240, 7); this.label2.Location = new System.Drawing.Point(180, 6);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 17); this.label2.Size = new System.Drawing.Size(30, 13);
this.label2.TabIndex = 2; this.label2.TabIndex = 2;
this.label2.Text = "Date"; this.label2.Text = "Date";
// //
// tbRev // tbRev
// //
this.tbRev.Location = new System.Drawing.Point(95, 4); this.tbRev.Location = new System.Drawing.Point(71, 3);
this.tbRev.Margin = new System.Windows.Forms.Padding(4);
this.tbRev.Name = "tbRev"; this.tbRev.Name = "tbRev";
this.tbRev.Size = new System.Drawing.Size(132, 22); this.tbRev.Size = new System.Drawing.Size(100, 20);
this.tbRev.TabIndex = 1; this.tbRev.TabIndex = 1;
this.tbRev.Text = "25";
// //
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(8, 7); this.label1.Location = new System.Drawing.Point(6, 6);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(33, 17); this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "Rev"; this.label1.Text = "Rev";
// //
@ -212,25 +209,29 @@ namespace PrintMSWord
// //
this.lbProcs.Dock = System.Windows.Forms.DockStyle.Fill; this.lbProcs.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbProcs.FormattingEnabled = true; this.lbProcs.FormattingEnabled = true;
this.lbProcs.ItemHeight = 16; this.lbProcs.Location = new System.Drawing.Point(0, 24);
this.lbProcs.Location = new System.Drawing.Point(0, 28);
this.lbProcs.Margin = new System.Windows.Forms.Padding(4);
this.lbProcs.Name = "lbProcs"; this.lbProcs.Name = "lbProcs";
this.lbProcs.Size = new System.Drawing.Size(646, 356); this.lbProcs.Size = new System.Drawing.Size(485, 290);
this.lbProcs.TabIndex = 3; this.lbProcs.TabIndex = 3;
this.lbProcs.DoubleClick += new System.EventHandler(this.lbProcs_DoubleClick); this.lbProcs.DoubleClick += new System.EventHandler(this.lbProcs_DoubleClick);
// //
// pDFsToolStripMenuItem
//
this.pDFsToolStripMenuItem.Name = "pDFsToolStripMenuItem";
this.pDFsToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
this.pDFsToolStripMenuItem.Text = "PDFs";
this.pDFsToolStripMenuItem.Click += new System.EventHandler(this.pDFsToolStripMenuItem_Click);
//
// frmPrintMSWord // frmPrintMSWord
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1125, 415); this.ClientSize = new System.Drawing.Size(844, 337);
this.Controls.Add(this.lbProcs); this.Controls.Add(this.lbProcs);
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
this.Controls.Add(this.statusStrip1); this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1); this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "frmPrintMSWord"; this.Name = "frmPrintMSWord";
this.Text = "PrintMSWord"; this.Text = "PrintMSWord";
this.Load += new System.EventHandler(this.frmPrintMSWord_Load); this.Load += new System.EventHandler(this.frmPrintMSWord_Load);
@ -263,5 +264,6 @@ namespace PrintMSWord
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tbTimings; private System.Windows.Forms.TextBox tbTimings;
private DevComponents.DotNetBar.Controls.CheckBoxX cbDebugOutput; private DevComponents.DotNetBar.Controls.CheckBoxX cbDebugOutput;
private System.Windows.Forms.ToolStripMenuItem pDFsToolStripMenuItem;
} }
} }

View File

@ -42,13 +42,20 @@ namespace PrintMSWord
} }
private void CreatePDF() private void CreatePDF()
{ {
ProcedureInfo myProcedure = MyProcedure;
Volian.Print.Library.Rtf2Pdf.PdfDebug = true; Volian.Print.Library.Rtf2Pdf.PdfDebug = true;
tbTimings.Text = ""; tbTimings.Text = "";
Cursor saveCursor = this.Cursor; Cursor saveCursor = this.Cursor;
this.Cursor = Cursors.WaitCursor; this.Cursor = Cursors.WaitCursor;
//ProcedureConfig.PrintWatermark pw = MyProcedure.ProcedureConfig.Print_Watermark; //ProcedureConfig.PrintWatermark pw = MyProcedure.ProcedureConfig.Print_Watermark;
PromsPrinter pp = new PromsPrinter(MyProcedure, tbRev.Text, tbRevDate.Text, cbWatermark.Text, cbDebugOutput.Checked, @"C:\TEMP\16Bit",true); CreatePDF(myProcedure,true);
this.Cursor = saveCursor;
}
private void CreatePDF(ProcedureInfo myProcedure, bool openPdf)
{
PromsPrinter pp = new PromsPrinter(myProcedure, tbRev.Text, tbRevDate.Text, cbWatermark.Text, cbDebugOutput.Checked, @"C:\TEMP\16Bit",openPdf);
pp.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged); pp.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
_ElapsedTime = new Dictionary<PromsPrinterStatusType, TimeSpan>(); _ElapsedTime = new Dictionary<PromsPrinterStatusType, TimeSpan>();
DateTime tStart = DateTime.Now; DateTime tStart = DateTime.Now;
@ -56,9 +63,8 @@ namespace PrintMSWord
DateTime tEnd = DateTime.Now; DateTime tEnd = DateTime.Now;
_ElapsedTime.Add(PromsPrinterStatusType.Total, DateTime.Now - tStart); _ElapsedTime.Add(PromsPrinterStatusType.Total, DateTime.Now - tStart);
MyStatus = pdfFile + " created."; MyStatus = pdfFile + " created.";
this.Cursor = saveCursor;
ShowElapsedTime(); ShowElapsedTime();
MyStatus = string.Format("{0} created in {1:0.} milliseconds",pdfFile,(TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds)); MyStatus = string.Format("{0} created in {1:0.} milliseconds", pdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));
} }
private void ShowElapsedTime() private void ShowElapsedTime()
{ {
@ -90,5 +96,19 @@ namespace PrintMSWord
DocVersionInfo dvi = GetDocVersionWithContent(); DocVersionInfo dvi = GetDocVersionWithContent();
lbProcs.DataSource = dvi.Procedures; lbProcs.DataSource = dvi.Procedures;
} }
private void pDFsToolStripMenuItem_Click(object sender, EventArgs e)
{
Volian.Print.Library.Rtf2Pdf.PdfDebug = true;
tbTimings.Text = "";
Cursor saveCursor = this.Cursor;
this.Cursor = Cursors.WaitCursor;
//ProcedureConfig.PrintWatermark pw = MyProcedure.ProcedureConfig.Print_Watermark;
ItemInfoList myItems = lbProcs.DataSource as ItemInfoList;
foreach(ItemInfo myItem in myItems)
CreatePDF(myItem.MyProcedure,false);
this.Cursor = saveCursor;
}
} }
} }