Browse Source

优化打印

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
624aae266c

+ 3
- 3
XHWK.WKTool/App.config View File

@@ -5,7 +5,7 @@
5 5
   </startup>
6 6
   <appSettings>
7 7
     <!--0正式 1测试-->
8
-    <add key="IsDebug" value="1" />
8
+    <add key="IsDebug" value="0" />
9 9
     <add key="OutputVideoLog" value="0"/>
10 10
     <!--图片压缩等级-->
11 11
     <add key="ImageCompressionLevel" value="30" />
@@ -34,8 +34,8 @@
34 34
     <!--上传每片大小 Mb-->
35 35
     <add key="UploadSliceLen" value="1" />
36 36
     <!--版本号-->
37
-    <add key="VersionCode" value="35" />
38
-    <add key="VersionName" value="1.3.4" />
37
+    <add key="VersionCode" value="37" />
38
+    <add key="VersionName" value="1.3.6" />
39 39
     <add key="ClientSettingsProvider.ServiceUri" value="" />
40 40
   </appSettings>
41 41
   <system.web>

+ 10
- 10
XHWK.WKTool/App.cs View File

@@ -243,16 +243,16 @@ namespace XHWK.WKTool
243 243
                 //}
244 244
                 #endregion
245 245
 
246
-                //try
247
-                //{
248
-                //    if(Directory.Exists(AppDomain.CurrentDomain.BaseDirectory+"temp"))//清除临时文件
249
-                //    {
250
-                //        Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "temp",true);
251
-                //    }
252
-                //}
253
-                //catch (Exception)
254
-                //{
255
-                //}
246
+                try
247
+                {
248
+                    if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "temp"))//清除临时文件
249
+                    {
250
+                        Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "temp", true);
251
+                    }
252
+                }
253
+                catch (Exception)
254
+                {
255
+                }
256 256
 
257 257
                 //如果本地文件为空,弹出弹窗 输密匙
258 258
                 //本地文件不为空, 解析

+ 13
- 13
XHWK.WKTool/PrintWindow.xaml.cs View File

@@ -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++)

+ 2
- 2
XHWK.WKTool/Properties/AssemblyInfo.cs View File

@@ -49,5 +49,5 @@ using System.Windows;
49 49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
50 50
 //通过使用 "*",如下所示:
51 51
 // [assembly: AssemblyVersion("1.0.*")]
52
-[assembly: AssemblyVersion("1.3.4.0")]
53
-[assembly: AssemblyFileVersion("1.3.4.0")]
52
+[assembly: AssemblyVersion("1.3.6.0")]
53
+[assembly: AssemblyFileVersion("1.3.6.0")]

+ 6
- 0
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

@@ -185,6 +185,8 @@ namespace XHWK.WKTool
185 185
         public void Initialize()
186 186
         {
187 187
             #region 数据初始化
188
+            string pathTemp = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
189
+            FileToolsCommon.CreateDirectory(pathTemp);
188 190
             APP.pageData.pagenum = 0;
189 191
             APP.pageData.currpage = APP.pageData.pagenum;
190 192
             btnStop.IsEnabled = false;//停止录制按钮不可点击
@@ -3563,6 +3565,10 @@ namespace XHWK.WKTool
3563 3565
             imgCanvas.Source = null;
3564 3566
             imgDocumentation.Source = null;
3565 3567
             imgPPT.Source = null;
3568
+            if(APP.pageData.pagenum == 1)
3569
+            {
3570
+                APP.PageDrawList = new List<Model_DrawData>();
3571
+            }
3566 3572
             ///画板模型增加一页
3567 3573
             Model_DrawData model_DrawData = new Model_DrawData
3568 3574
             {

Loading…
Cancel
Save