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