Commit 7051bb21 by 施晓雨

更新版本,加入大小标记功能

parent 24e127ca
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Kivii.Pdf.V4.0, Version=5.5.2020.6200, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Pdf.V4.0, Version=5.5.2020.6210, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Kivii.Pdf.5.5.2020.6200\lib\net40\Kivii.Pdf.V4.0.dll</HintPath> <HintPath>packages\Kivii.Pdf.5.5.2020.6210\lib\net40\Kivii.Pdf.V4.0.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnStamp = new System.Windows.Forms.Button(); this.btnStamp = new System.Windows.Forms.Button();
this.tbxSaveFilePath = new System.Windows.Forms.TextBox(); this.tbxSaveFolder = new System.Windows.Forms.TextBox();
this.btnSelectSaveFilePath = new System.Windows.Forms.Button(); this.btnSelectSaveFolder = new System.Windows.Forms.Button();
this.label23 = new System.Windows.Forms.Label(); this.label23 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label20 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label();
...@@ -118,8 +118,8 @@ ...@@ -118,8 +118,8 @@
// groupBox2 // groupBox2
// //
this.groupBox2.Controls.Add(this.btnStamp); this.groupBox2.Controls.Add(this.btnStamp);
this.groupBox2.Controls.Add(this.tbxSaveFilePath); this.groupBox2.Controls.Add(this.tbxSaveFolder);
this.groupBox2.Controls.Add(this.btnSelectSaveFilePath); this.groupBox2.Controls.Add(this.btnSelectSaveFolder);
this.groupBox2.Controls.Add(this.label23); this.groupBox2.Controls.Add(this.label23);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox2.Location = new System.Drawing.Point(0, 475); this.groupBox2.Location = new System.Drawing.Point(0, 475);
...@@ -139,22 +139,22 @@ ...@@ -139,22 +139,22 @@
this.btnStamp.UseVisualStyleBackColor = true; this.btnStamp.UseVisualStyleBackColor = true;
this.btnStamp.Click += new System.EventHandler(this.btnStamp_Click); this.btnStamp.Click += new System.EventHandler(this.btnStamp_Click);
// //
// tbxSaveFilePath // tbxSaveFolder
// //
this.tbxSaveFilePath.Location = new System.Drawing.Point(77, 20); this.tbxSaveFolder.Location = new System.Drawing.Point(77, 20);
this.tbxSaveFilePath.Name = "tbxSaveFilePath"; this.tbxSaveFolder.Name = "tbxSaveFolder";
this.tbxSaveFilePath.Size = new System.Drawing.Size(308, 21); this.tbxSaveFolder.Size = new System.Drawing.Size(308, 21);
this.tbxSaveFilePath.TabIndex = 4; this.tbxSaveFolder.TabIndex = 4;
// //
// btnSelectSaveFilePath // btnSelectSaveFolder
// //
this.btnSelectSaveFilePath.Location = new System.Drawing.Point(393, 20); this.btnSelectSaveFolder.Location = new System.Drawing.Point(393, 20);
this.btnSelectSaveFilePath.Name = "btnSelectSaveFilePath"; this.btnSelectSaveFolder.Name = "btnSelectSaveFolder";
this.btnSelectSaveFilePath.Size = new System.Drawing.Size(32, 23); this.btnSelectSaveFolder.Size = new System.Drawing.Size(32, 23);
this.btnSelectSaveFilePath.TabIndex = 5; this.btnSelectSaveFolder.TabIndex = 5;
this.btnSelectSaveFilePath.Text = "..."; this.btnSelectSaveFolder.Text = "...";
this.btnSelectSaveFilePath.UseVisualStyleBackColor = true; this.btnSelectSaveFolder.UseVisualStyleBackColor = true;
this.btnSelectSaveFilePath.Click += new System.EventHandler(this.btnSelectSaveFilePath_Click); this.btnSelectSaveFolder.Click += new System.EventHandler(this.btnSelectSaveFolder_Click);
// //
// label23 // label23
// //
...@@ -348,7 +348,8 @@ ...@@ -348,7 +348,8 @@
"Paging-骑缝章", "Paging-骑缝章",
"Signature-数据签章", "Signature-数据签章",
"Replace-替换图片", "Replace-替换图片",
"WaterMark-水印"}); "WaterMark-水印",
"SizeMark-图片大小标记"});
this.cbxStampType.Location = new System.Drawing.Point(77, 112); this.cbxStampType.Location = new System.Drawing.Point(77, 112);
this.cbxStampType.Name = "cbxStampType"; this.cbxStampType.Name = "cbxStampType";
this.cbxStampType.Size = new System.Drawing.Size(141, 20); this.cbxStampType.Size = new System.Drawing.Size(141, 20);
...@@ -602,8 +603,8 @@ ...@@ -602,8 +603,8 @@
private System.Windows.Forms.Button btnSelectFile; private System.Windows.Forms.Button btnSelectFile;
private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button btnStamp; private System.Windows.Forms.Button btnStamp;
private System.Windows.Forms.TextBox tbxSaveFilePath; private System.Windows.Forms.TextBox tbxSaveFolder;
private System.Windows.Forms.Button btnSelectSaveFilePath; private System.Windows.Forms.Button btnSelectSaveFolder;
private System.Windows.Forms.Label label23; private System.Windows.Forms.Label label23;
} }
} }
......
...@@ -22,6 +22,7 @@ namespace Kivii.Pdf.Test ...@@ -22,6 +22,7 @@ namespace Kivii.Pdf.Test
ofd.Filter = "Pdf文件|*.pdf"; ofd.Filter = "Pdf文件|*.pdf";
if (ofd.ShowDialog() != DialogResult.OK) return; if (ofd.ShowDialog() != DialogResult.OK) return;
tbxPdfFilePath.Text = ofd.FileName; tbxPdfFilePath.Text = ofd.FileName;
tbxSaveFolder.Text = System.IO.Path.GetDirectoryName(ofd.FileName);
} }
private void btnSelectStamp_Click(object sender, EventArgs e) private void btnSelectStamp_Click(object sender, EventArgs e)
...@@ -41,12 +42,11 @@ namespace Kivii.Pdf.Test ...@@ -41,12 +42,11 @@ namespace Kivii.Pdf.Test
tbxSignatureFilePath.Text = ofd.FileName; tbxSignatureFilePath.Text = ofd.FileName;
} }
private void btnSelectSaveFilePath_Click(object sender, EventArgs e) private void btnSelectSaveFolder_Click(object sender, EventArgs e)
{ {
SaveFileDialog sfd = new SaveFileDialog(); FolderBrowserDialog sfd = new FolderBrowserDialog();
sfd.Filter = "Pdf文件|*.pdf";
if (sfd.ShowDialog() != DialogResult.OK) return; if (sfd.ShowDialog() != DialogResult.OK) return;
tbxSaveFilePath.Text = sfd.FileName; tbxSaveFolder.Text = sfd.SelectedPath;
} }
...@@ -95,7 +95,9 @@ namespace Kivii.Pdf.Test ...@@ -95,7 +95,9 @@ namespace Kivii.Pdf.Test
} }
try try
{ {
var result = reader.Stamp(setting, tbxSaveFilePath.Text); 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(); reader.Close();
MessageBox.Show($"操作结果:{result}"); MessageBox.Show($"操作结果:{result}");
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Kivii.Pdf" version="5.5.2020.6200" targetFramework="net40" /> <package id="Kivii.Pdf" version="5.5.2020.6210" targetFramework="net40" />
</packages> </packages>
\ No newline at end of file
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