Browse Source

优化打印

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

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

5
   </startup>
5
   </startup>
6
   <appSettings>
6
   <appSettings>
7
     <!--0正式 1测试-->
7
     <!--0正式 1测试-->
8
-    <add key="IsDebug" value="1" />
8
+    <add key="IsDebug" value="0" />
9
     <add key="OutputVideoLog" value="0"/>
9
     <add key="OutputVideoLog" value="0"/>
10
     <!--图片压缩等级-->
10
     <!--图片压缩等级-->
11
     <add key="ImageCompressionLevel" value="30" />
11
     <add key="ImageCompressionLevel" value="30" />
34
     <!--上传每片大小 Mb-->
34
     <!--上传每片大小 Mb-->
35
     <add key="UploadSliceLen" value="1" />
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
     <add key="ClientSettingsProvider.ServiceUri" value="" />
39
     <add key="ClientSettingsProvider.ServiceUri" value="" />
40
   </appSettings>
40
   </appSettings>
41
   <system.web>
41
   <system.web>

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

243
                 //}
243
                 //}
244
                 #endregion
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
             //FileToolsCommon.CreateFile(imgPath);
97
             //FileToolsCommon.CreateFile(imgPath);
98
             //string pdf = imgPath + "\\101.pdf";
98
             //string pdf = imgPath + "\\101.pdf";
99
             //PDF位置
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
             int PrinterNum = Convert.ToInt32(txbNumberOfCopies.Text);
111
             int PrinterNum = Convert.ToInt32(txbNumberOfCopies.Text);
104
             StrList.Add(PrinterNum.ToString());
112
             StrList.Add(PrinterNum.ToString());
149
                 //iTextSharp.text.Rectangle page = new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.A4., 250f);//cs
157
                 //iTextSharp.text.Rectangle page = new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.A4., 250f);//cs
150
                 ////设置纸张横向
158
                 ////设置纸张横向
151
                 //document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
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
                 document.Open();
163
                 document.Open();
164
                 iTextSharp.text.Image image;
164
                 iTextSharp.text.Image image;
165
                 for (int i = 0; i < APP.PageDrawList.Count; i++)
165
                 for (int i = 0; i < APP.PageDrawList.Count; i++)

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

49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
50
 //通过使用 "*",如下所示:
50
 //通过使用 "*",如下所示:
51
 // [assembly: AssemblyVersion("1.0.*")]
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
         public void Initialize()
185
         public void Initialize()
186
         {
186
         {
187
             #region 数据初始化
187
             #region 数据初始化
188
+            string pathTemp = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
189
+            FileToolsCommon.CreateDirectory(pathTemp);
188
             APP.pageData.pagenum = 0;
190
             APP.pageData.pagenum = 0;
189
             APP.pageData.currpage = APP.pageData.pagenum;
191
             APP.pageData.currpage = APP.pageData.pagenum;
190
             btnStop.IsEnabled = false;//停止录制按钮不可点击
192
             btnStop.IsEnabled = false;//停止录制按钮不可点击
3563
             imgCanvas.Source = null;
3565
             imgCanvas.Source = null;
3564
             imgDocumentation.Source = null;
3566
             imgDocumentation.Source = null;
3565
             imgPPT.Source = null;
3567
             imgPPT.Source = null;
3568
+            if(APP.pageData.pagenum == 1)
3569
+            {
3570
+                APP.PageDrawList = new List<Model_DrawData>();
3571
+            }
3566
             ///画板模型增加一页
3572
             ///画板模型增加一页
3567
             Model_DrawData model_DrawData = new Model_DrawData
3573
             Model_DrawData model_DrawData = new Model_DrawData
3568
             {
3574
             {

Loading…
Cancel
Save