Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Pdf.Test
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
示例代码
Kivii.Pdf.Test
Commits
7051bb21
Commit
7051bb21
authored
Jun 21, 2020
by
施晓雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新版本,加入大小标记功能
parent
24e127ca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
28 deletions
+32
-28
Kivii.Pdf.Test.csproj
Kivii.Pdf.Test.csproj
+2
-2
frmMain.Designer.cs
frmMain.Designer.cs
+21
-20
frmMain.cs
frmMain.cs
+7
-5
packages.config
packages.config
+2
-1
No files found.
Kivii.Pdf.Test.csproj
View file @
7051bb21
...
...
@@ -32,8 +32,8 @@
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Kivii.Pdf.V4.0, Version=5.5.2020.62
0
0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\Kivii.Pdf.5.5.2020.62
0
0\lib\net40\Kivii.Pdf.V4.0.dll
</HintPath>
<Reference
Include=
"Kivii.Pdf.V4.0, Version=5.5.2020.62
1
0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\Kivii.Pdf.5.5.2020.62
1
0\lib\net40\Kivii.Pdf.V4.0.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
...
...
frmMain.Designer.cs
View file @
7051bb21
...
...
@@ -34,8 +34,8 @@
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnStamp
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tbxSaveF
ilePath
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btnSelectSaveF
ilePath
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tbxSaveF
older
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btnSelectSaveF
older
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label23
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
label20
=
new
System
.
Windows
.
Forms
.
Label
();
...
...
@@ -118,8 +118,8 @@
// groupBox2
//
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnStamp
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
tbxSaveF
ilePath
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnSelectSaveF
ilePath
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
tbxSaveF
older
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnSelectSaveF
older
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
label23
);
this
.
groupBox2
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
475
);
...
...
@@ -139,22 +139,22 @@
this
.
btnStamp
.
UseVisualStyleBackColor
=
true
;
this
.
btnStamp
.
Click
+=
new
System
.
EventHandler
(
this
.
btnStamp_Click
);
//
// tbxSaveF
ilePath
// tbxSaveF
older
//
this
.
tbxSaveF
ilePath
.
Location
=
new
System
.
Drawing
.
Point
(
77
,
20
);
this
.
tbxSaveF
ilePath
.
Name
=
"tbxSaveFilePath
"
;
this
.
tbxSaveF
ilePath
.
Size
=
new
System
.
Drawing
.
Size
(
308
,
21
);
this
.
tbxSaveF
ilePath
.
TabIndex
=
4
;
this
.
tbxSaveF
older
.
Location
=
new
System
.
Drawing
.
Point
(
77
,
20
);
this
.
tbxSaveF
older
.
Name
=
"tbxSaveFolder
"
;
this
.
tbxSaveF
older
.
Size
=
new
System
.
Drawing
.
Size
(
308
,
21
);
this
.
tbxSaveF
older
.
TabIndex
=
4
;
//
// btnSelectSaveF
ilePath
// btnSelectSaveF
older
//
this
.
btnSelectSaveF
ilePath
.
Location
=
new
System
.
Drawing
.
Point
(
393
,
20
);
this
.
btnSelectSaveF
ilePath
.
Name
=
"btnSelectSaveFilePath
"
;
this
.
btnSelectSaveF
ilePath
.
Size
=
new
System
.
Drawing
.
Size
(
32
,
23
);
this
.
btnSelectSaveF
ilePath
.
TabIndex
=
5
;
this
.
btnSelectSaveF
ilePath
.
Text
=
"..."
;
this
.
btnSelectSaveF
ilePath
.
UseVisualStyleBackColor
=
true
;
this
.
btnSelectSaveF
ilePath
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSelectSaveFilePath
_Click
);
this
.
btnSelectSaveF
older
.
Location
=
new
System
.
Drawing
.
Point
(
393
,
20
);
this
.
btnSelectSaveF
older
.
Name
=
"btnSelectSaveFolder
"
;
this
.
btnSelectSaveF
older
.
Size
=
new
System
.
Drawing
.
Size
(
32
,
23
);
this
.
btnSelectSaveF
older
.
TabIndex
=
5
;
this
.
btnSelectSaveF
older
.
Text
=
"..."
;
this
.
btnSelectSaveF
older
.
UseVisualStyleBackColor
=
true
;
this
.
btnSelectSaveF
older
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSelectSaveFolder
_Click
);
//
// label23
//
...
...
@@ -348,7 +348,8 @@
"Paging-骑缝章"
,
"Signature-数据签章"
,
"Replace-替换图片"
,
"WaterMark-水印"
});
"WaterMark-水印"
,
"SizeMark-图片大小标记"
});
this
.
cbxStampType
.
Location
=
new
System
.
Drawing
.
Point
(
77
,
112
);
this
.
cbxStampType
.
Name
=
"cbxStampType"
;
this
.
cbxStampType
.
Size
=
new
System
.
Drawing
.
Size
(
141
,
20
);
...
...
@@ -602,8 +603,8 @@
private
System
.
Windows
.
Forms
.
Button
btnSelectFile
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox2
;
private
System
.
Windows
.
Forms
.
Button
btnStamp
;
private
System
.
Windows
.
Forms
.
TextBox
tbxSaveF
ilePath
;
private
System
.
Windows
.
Forms
.
Button
btnSelectSaveF
ilePath
;
private
System
.
Windows
.
Forms
.
TextBox
tbxSaveF
older
;
private
System
.
Windows
.
Forms
.
Button
btnSelectSaveF
older
;
private
System
.
Windows
.
Forms
.
Label
label23
;
}
}
...
...
frmMain.cs
View file @
7051bb21
...
...
@@ -22,6 +22,7 @@ namespace Kivii.Pdf.Test
ofd
.
Filter
=
"Pdf文件|*.pdf"
;
if
(
ofd
.
ShowDialog
()
!=
DialogResult
.
OK
)
return
;
tbxPdfFilePath
.
Text
=
ofd
.
FileName
;
tbxSaveFolder
.
Text
=
System
.
IO
.
Path
.
GetDirectoryName
(
ofd
.
FileName
);
}
private
void
btnSelectStamp_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -41,12 +42,11 @@ namespace Kivii.Pdf.Test
tbxSignatureFilePath
.
Text
=
ofd
.
FileName
;
}
private
void
btnSelectSaveF
ilePath
_Click
(
object
sender
,
EventArgs
e
)
private
void
btnSelectSaveF
older
_Click
(
object
sender
,
EventArgs
e
)
{
SaveFileDialog
sfd
=
new
SaveFileDialog
();
sfd
.
Filter
=
"Pdf文件|*.pdf"
;
FolderBrowserDialog
sfd
=
new
FolderBrowserDialog
();
if
(
sfd
.
ShowDialog
()
!=
DialogResult
.
OK
)
return
;
tbxSaveF
ilePath
.
Text
=
sfd
.
FileName
;
tbxSaveF
older
.
Text
=
sfd
.
SelectedPath
;
}
...
...
@@ -95,7 +95,9 @@ namespace Kivii.Pdf.Test
}
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
();
MessageBox
.
Show
(
$"操作结果:
{
result
}
"
);
}
...
...
packages.config
View file @
7051bb21
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Kivii.Pdf"
version
=
"5.5.2020.62
0
0"
targetFramework
=
"net40"
/>
<
package
id
=
"Kivii.Pdf"
version
=
"5.5.2020.62
1
0"
targetFramework
=
"net40"
/>
</
packages
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment