@@ -22,7 +22,7 @@ public partial class Form1 : Form
2222 DataTable dtPos = new DataTable ( ) ; //PDF各文件印章位置表
2323 DataTable dtYz = new DataTable ( ) ; //PDF列表
2424 string sourcePath = "" , outputPath = "" , imgPath = "" , previewPath = "" , signText = "" , password = "" ;
25- int wjType = 1 , qfzType = 0 , yzType = 0 , djType = 0 , qmType = 0 , wzType = 3 , size = 40 , rotation = 0 , opacity = 100 , wz = 50 , yzr = 10 , maximg = 250 ;
25+ int wjType = 1 , qfzType = 0 , yzType = 0 , djType = 0 , qmType = 0 , wzType = 3 , size = 40 , rotation = 0 , opacity = 100 , wz = 50 , yzr = 10 , maximg = 250 , maxfgs = 20 ;
2626 Bitmap imgYz = null ;
2727 X509Certificate2 cert = null ; //证书
2828
@@ -139,6 +139,10 @@ private void button1_Click(object sender, EventArgs e)
139139 {
140140 MessageBox . Show ( "骑缝章位置设置错误,请输入100以内的整数。" ) ;
141141 }
142+ else if ( ! int . TryParse ( textMaxFgs . Text , out maxfgs ) )
143+ {
144+ MessageBox . Show ( "最大分割数设置错误,请输入正确的整数。" ) ;
145+ }
142146 else
143147 {
144148 pdfGz ( ) ;
@@ -459,7 +463,7 @@ private bool PDFWatermark(string inputfilepath, string outputfilepath)
459463
460464 if ( qfzType != 1 && qfzPages > 1 )
461465 {
462- int max = 20 ; //骑缝章最大分割数
466+ int max = maxfgs ; //骑缝章最大分割数
463467 int ss = qfzPages / max + 1 ;
464468 int sy = qfzPages - ss * max / 2 ;
465469 int sys = sy / ss ;
0 commit comments