Commit 9296f369 by 施晓雨

1

parent 7051bb21
......@@ -75,14 +75,25 @@
this.btnSelectPfx = new System.Windows.Forms.Button();
this.tbxOffsetY = new System.Windows.Forms.TextBox();
this.btnSelectFile = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.button2 = new System.Windows.Forms.Button();
this.label24 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label25 = new System.Windows.Forms.Label();
this.label26 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.textBox3 = new System.Windows.Forms.TextBox();
this.button4 = new System.Windows.Forms.Button();
this.label27 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(1059, 109);
this.button1.Location = new System.Drawing.Point(1035, 493);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
......@@ -91,7 +102,7 @@
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(888, 41);
this.textBox1.Location = new System.Drawing.Point(1021, 372);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 2;
......@@ -99,7 +110,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(805, 45);
this.label2.Location = new System.Drawing.Point(938, 376);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(59, 12);
this.label2.TabIndex = 3;
......@@ -210,7 +221,7 @@
this.groupBox1.Size = new System.Drawing.Size(441, 475);
this.groupBox1.TabIndex = 12;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "操作参数";
this.groupBox1.Text = "单功能操作参数";
//
// label20
//
......@@ -536,11 +547,110 @@
this.btnSelectFile.UseVisualStyleBackColor = true;
this.btnSelectFile.Click += new System.EventHandler(this.btnSelectFile_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.label27);
this.groupBox3.Controls.Add(this.button4);
this.groupBox3.Controls.Add(this.textBox2);
this.groupBox3.Controls.Add(this.textBox3);
this.groupBox3.Controls.Add(this.button3);
this.groupBox3.Controls.Add(this.button2);
this.groupBox3.Controls.Add(this.label26);
this.groupBox3.Controls.Add(this.label24);
this.groupBox3.Controls.Add(this.label25);
this.groupBox3.Dock = System.Windows.Forms.DockStyle.Left;
this.groupBox3.Location = new System.Drawing.Point(441, 0);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(366, 657);
this.groupBox3.TabIndex = 13;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "组合功能操作";
//
// button2
//
this.button2.Location = new System.Drawing.Point(317, 30);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(32, 23);
this.button2.TabIndex = 5;
this.button2.Text = "...";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.btnSelectFile_Click);
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(81, 54);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(161, 12);
this.label24.TabIndex = 6;
this.label24.Text = "可以选择文件或填写Http地址";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(83, 30);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(218, 21);
this.textBox2.TabIndex = 4;
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(18, 33);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(47, 12);
this.label25.TabIndex = 1;
this.label25.Text = "PDF路径";
//
// label26
//
this.label26.AutoSize = true;
this.label26.Location = new System.Drawing.Point(18, 185);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(53, 12);
this.label26.TabIndex = 1;
this.label26.Text = "保存路径";
//
// button3
//
this.button3.Location = new System.Drawing.Point(317, 182);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(32, 23);
this.button3.TabIndex = 5;
this.button3.Text = "...";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.btnSelectSaveFolder_Click);
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(83, 182);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(218, 21);
this.textBox3.TabIndex = 4;
//
// button4
//
this.button4.Location = new System.Drawing.Point(20, 227);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 23);
this.button4.TabIndex = 6;
this.button4.Text = "执行";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.btnStamp_Click);
//
// label27
//
this.label27.Location = new System.Drawing.Point(18, 90);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(331, 60);
this.label27.TabIndex = 7;
this.label27.Text = "执行过程参数以数组形式写在代码中,请参考代码,对文件进行组合操作";
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1185, 657);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.panel1);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox1);
......@@ -552,6 +662,8 @@
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -606,6 +718,16 @@
private System.Windows.Forms.TextBox tbxSaveFolder;
private System.Windows.Forms.Button btnSelectSaveFolder;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label25;
}
}
......@@ -85,6 +85,8 @@ namespace Kivii.Pdf.Test
return;
}
PdfReader reader = null;
try
{
if (tbxPdfFilePath.Text.StartsWith("http", StringComparison.CurrentCultureIgnoreCase))
{
reader = new PdfReader(new Uri(tbxPdfFilePath.Text));
......@@ -93,18 +95,20 @@ namespace Kivii.Pdf.Test
{
reader = new PdfReader(tbxPdfFilePath.Text);
}
try
{
var saveFilePath = System.IO.Path.Combine(tbxSaveFolder.Text, System.IO.Path.GetFileNameWithoutExtension(tbxPdfFilePath.Text) +"_"+setting.StampType.ToString() +".pdf");
var saveFilePath = System.IO.Path.Combine(tbxSaveFolder.Text, System.IO.Path.GetFileNameWithoutExtension(tbxPdfFilePath.Text) + "_" + setting.StampType.ToString() + ".pdf");
if (System.IO.File.Exists(saveFilePath)) System.IO.File.Delete(saveFilePath);
var result = reader.Stamp(setting, saveFilePath);
reader.Close();
MessageBox.Show($"操作结果:{result}");
}
catch (Exception ex)
{
MessageBox.Show($"发生错误:{ex.Message}");
}
finally
{
reader?.Close();
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment