|
@@ -97,8 +97,16 @@ namespace XHWK.WKTool
|
97
|
97
|
//FileToolsCommon.CreateFile(imgPath);
|
98
|
98
|
//string pdf = imgPath + "\\101.pdf";
|
99
|
99
|
//PDF位置
|
100
|
|
- string SourcePath=FileToolsCommon.GetFileAbsolutePath("/temp/101.pdf");
|
101
|
|
- StrList.Add(SourcePath);
|
|
100
|
+ int ipdf = 102;
|
|
101
|
+ string imgPath = FileToolsCommon.GetFileAbsolutePath("temp/");
|
|
102
|
+ string tempImgPath = imgPath;
|
|
103
|
+ imgPath += "101.pdf";
|
|
104
|
+ while (File.Exists(imgPath))
|
|
105
|
+ {
|
|
106
|
+ imgPath = tempImgPath + ipdf.ToString() + ".pdf";
|
|
107
|
+ ipdf++;
|
|
108
|
+ }
|
|
109
|
+ StrList.Add(imgPath);
|
102
|
110
|
//打印数量
|
103
|
111
|
int PrinterNum = Convert.ToInt32(txbNumberOfCopies.Text);
|
104
|
112
|
StrList.Add(PrinterNum.ToString());
|
|
@@ -149,17 +157,9 @@ namespace XHWK.WKTool
|
149
|
157
|
//iTextSharp.text.Rectangle page = new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.A4., 250f);//cs
|
150
|
158
|
////设置纸张横向
|
151
|
159
|
//document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
|
152
|
|
- int ipdf = 102;
|
153
|
|
- string imgPath = FileToolsCommon.GetFileAbsolutePath("temp/");
|
154
|
|
- string tempImgPath = imgPath;
|
155
|
|
- FileToolsCommon.CreateDirectory(imgPath);
|
156
|
|
- imgPath += "101.pdf";
|
157
|
|
- while(File.Exists(imgPath))
|
158
|
|
- {
|
159
|
|
- imgPath = tempImgPath + ipdf.ToString() + ".pdf";
|
160
|
|
- ipdf++;
|
161
|
|
- }
|
162
|
|
- iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(imgPath, FileMode.Create, FileAccess.ReadWrite));
|
|
160
|
+ List<string> objStr1 = (List<string>)obj;
|
|
161
|
+ string SourcePath1 = objStr1[0];
|
|
162
|
+ iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(SourcePath1, FileMode.Create, FileAccess.ReadWrite));
|
163
|
163
|
document.Open();
|
164
|
164
|
iTextSharp.text.Image image;
|
165
|
165
|
for (int i = 0; i < APP.PageDrawList.Count; i++)
|