프로젝트

일반

사용자정보

개정판 8c3a888c

ID8c3a888c3dce3f0a1c5e32a2ec30b6f35a4510ab
상위 e25875e0
하위 1bd70f81, 4f5d34a4

김동진이(가) 5년 이상 전에 추가함

issue #1027 web service roll back

Change-Id: I16486234f4e8a940dea38e9877bb122652a09108

차이점 보기:

FinalService/KCOM_FinalService/ConsoleApp1/Program.cs
80 80
        static List<CommonLib.MARKUS_API.FINAL_PDF> _Thread = new List<CommonLib.MARKUS_API.FINAL_PDF>();
81 81
        private static void Pdf_EndFinal(object sender, MarkupToPDF.EndFinalEventArgs e)
82 82
        {
83
            CommonLib.MARKUS_API.FINAL_PDF _item = (sender as MarkupToPDF.MarkupToPDF).FinalItem;
83
            FINAL_PDF _item = (sender as MarkupToPDF.MarkupToPDF).FinalItem;
84 84

  
85 85
            SetFinalState(_item.ID, FinalStatus.PdfStamp);
86 86

  
FinalService/KCOM_FinalService/KCOM_FinalService/Remoting/RemFinalPDFStation.cs
2 2
using KCOM_FinalService.Common;
3 3
using KCOMDataModel.Common;
4 4
using KCOMDataModel.DataModel;
5
using MarkupToPDF.Common;
6 5
using System;
7 6
using System.Collections.Generic;
8 7
using System.IO;
......
23 22
        string _MyIP = null;
24 23
        int _TypeName = 1;
25 24
        Properties.Settings _SettingPlace = null;
26
        
27
        Queue<CommonLib.MARKUS_API.FINAL_PDF> _WorkItem = new Queue<CommonLib.MARKUS_API.FINAL_PDF>();
28
        List<CommonLib.MARKUS_API.FINAL_PDF> _Thread = new List<CommonLib.MARKUS_API.FINAL_PDF>();
25

  
26
        Queue<FINAL_PDF> _WorkItem = new Queue<FINAL_PDF>();
27
        List<FINAL_PDF> _Thread = new List<FINAL_PDF>();
29 28
        #endregion
30 29

  
31 30
        public RemFinalPDFStation()
......
52 51
        {
53 52
            try
54 53
            {
55
                _TypeName = 1;
54
                //_MyIP = System.Net.Dns.Resolve(System.Net.Dns.GetHostName()).AddressList[0].ToString();
55
                using (KCOMDataModel.DataModel.KCOMEntities _systemEntity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
56
                {
57
#if DEBUG
58
                    _TypeName = 1; //FINAL은 현재 타입이 1임
59
#else
60
                    _TypeName = 1;
61
                    ///TODO: check below code
62
                    ///_TypeName = _systemEntity.SERVICE_PROPERTIES.Where(data => data.SERVICE_ADDRESS == _MyIP).FirstOrDefault().SERVICET_TYPE;
63
#endif
64
                }
56 65

  
57 66
                _Channel = new TcpChannel(Properties.Settings.Default.RemotingPort);
58 67
                System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(_Channel, false);
......
63 72
                if (_Log != null)
64 73
                {
65 74
                    _Log.Write("RemFinalPDFStation  : " + _Log.ToString());
66
                   
75

  
67 76
                }
68 77
            }
69 78
            IFinalPDF.Cache.Attach(this);
70 79
        }
71 80

  
72
        private void SetFinalState(string finalID, CommonLib.MARKUS_API.FinalStatus status)
81
        private void SetFinalState(string finalID, FinalStatus status)
73 82
        {
74
            try
83
            using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
75 84
            {
76
                using (DataController dataController = new DataController())
85
                var finalList = _entity.FINAL_PDF.Where(final => final.ID == finalID);
86

  
87
                if (finalList.Count() > 0)
77 88
                {
78
                    var result = dataController.SetFinalStatus(finalID, status);
89
                    if (status == FinalStatus.Create)
90
                    {
91
                        finalList.First().START_DATETIME = DateTime.Now;
92
                    }
93
                    if (status == FinalStatus.Success)
94
                    {
95
                        finalList.First().END_DATETIME = DateTime.Now;
96
                    }
97

  
98
                    finalList.First().STATUS = (int)status;
99
                    _entity.SaveChanges();
79 100
                }
80
            }
81
            catch (Exception)
82
            {
83
                throw;
84
            }            
101
            };
85 102
        }
86 103

  
87 104
        public void Dispose()
......
94 111

  
95 112
        public FinalPDFResult Notify(string ProjectNo, string FinalID)
96 113
        {
97
            using (DataController dc = new DataController())
114
            using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
98 115
            {
99
                var finalList = dc.GetFinalpdfs(FinalID);
100
                FinalPDFProcessStart(finalList);
101
            }            
116
                var finalList = _entity.FINAL_PDF.Where(final => final.ID == FinalID);
117
                FinalPDFProcessStart(finalList.ToList());
118
            }
102 119

  
103 120
            ///TODO: why return FinalPDFResult?
104 121
            return new FinalPDFResult();
105 122
        }
106 123

  
107
        private void FinalPDFProcessStart(List<CommonLib.MARKUS_API.FINAL_PDF> lstFinalPDF)
124
        private void FinalPDFProcessStart(List<FINAL_PDF> lstFinalPDF)
108 125
        {
109
            if (lstFinalPDF.Count () >0)
126
            if (lstFinalPDF.Count() > 0)
110 127
            {
111 128
                foreach (var item in lstFinalPDF)
112 129
                {
......
124 141
            //CurrentCountUpdater(); 잠시보류
125 142

  
126 143

  
127
            while (_WorkItem.Count () > 0)
144
            while (_WorkItem.Count() > 0)
128 145
            {
129 146
                if (_Thread.Count() < Properties.Settings.Default.MultipleFinalCount)
130 147
                {
131
                    CommonLib.MARKUS_API.FINAL_PDF _item = _WorkItem.Dequeue();
148
                    FINAL_PDF _item = _WorkItem.Dequeue();
132 149
                    if (_item.STATUS == (int)FinalStatus.Insert)
133 150
                    {
134 151
                        _item.STATUS = (int)(FinalStatus.Wait);
152
                        using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
153
                        {
154
                            var selectItem = _entity.FINAL_PDF.Where(data => data.ID == _item.ID).FirstOrDefault();
135 155

  
136
                        SetFinalState(_item.ID, CommonLib.MARKUS_API.FinalStatus.Wait);
156
                            selectItem.STATUS = (int)(FinalStatus.Wait);
157

  
158
                            _entity.SaveChanges();
159
                        }
137 160
                    }
138 161
                    var _identPathItem = _Thread.Where(item => item.DOCINFO_ID == _item.DOCINFO_ID);
139 162

  
140
                    if (_identPathItem.Count () > 0)
163
                    if (_identPathItem.Count() > 0)
141 164
                    {
142 165
                        _WorkItem.Enqueue(_item);
143 166
                    }
......
162 185
                        _markuptoPDF.EndFinal += new EventHandler<MarkupToPDF.EndFinalEventArgs>(_markuptoPDF_EndFinal);
163 186
                        Thread _stathread = new Thread(new ParameterizedThreadStart(_markuptoPDF.MakeFinalPDF));
164 187
                        _stathread.Name = _item.ID.ToString();
165
                        SetFinalState(_item.ID, CommonLib.MARKUS_API.FinalStatus.Create);
188
                        SetFinalState(_item.ID, IFinalPDF.FinalStatus.Create);
166 189
                        //_stathread.Priority = ThreadPriority.Normal;
167 190
                        _stathread.SetApartmentState(ApartmentState.STA);
168 191
                        _stathread.Start(_item);
......
178 201

  
179 202
            if (_T.Count() > 0)
180 203
            {
181
                CommonLib.MARKUS_API.FINAL_PDF _item = _T.First();
204
                FINAL_PDF _item = _T.First();
182 205

  
183
                SetFinalState(_item.ID, CommonLib.MARKUS_API.FinalStatus.PdfStamp);
206
                SetFinalState(_item.ID, FinalStatus.PdfStamp);
184 207

  
185 208
                try
186 209
                {
187 210
                    string soapurl = CommonLib.Common.GetConfigString("UpLoadServiceUrl", "URL", "");
188 211

  
189
                    if(!string.IsNullOrEmpty(soapurl))
212
                    if (!string.IsNullOrEmpty(soapurl))
190 213
                    {
191 214
                        //Legacy IF
192 215
                        KeyValuePair<bool, string> result = UploadFinal.UploadFinal.UploadFinalPDF(e.FinalPDFPath.Replace(@"\\172.20.121.220\comment3\finalPDF\", ""), e.OriginPDFName, e.FinalPDF, soapurl);
193 216
                        if (result.Key)
194 217
                        {
195
                            SetFinalState(_item.ID, CommonLib.MARKUS_API.FinalStatus.Success);
218
                            SetFinalState(_item.ID, FinalStatus.Success);
196 219
                        }
197 220
                        else
198 221
                        {
199
                            SetFinalState(_item.ID, CommonLib.MARKUS_API.FinalStatus.Error);
222
                            SetFinalState(_item.ID, FinalStatus.Error);
200 223
                            _Log.Write("Upload error .." + e.FinalPDFPath + ",pdfname:" + e.OriginPDFName);
201
                        }                        
224
                        }
202 225
                        _Thread.Remove(_T.First());
203 226
                    }
204 227
                    else
205 228
                    {
206 229
                        ///TODO: 저장할 폴더 위치를 configuration으로 빼주세요
207
                        
230

  
208 231
                        string savepath = CommonLib.Common.GetConfigString("DebugSavePath", "URL", "");
209 232

  
210 233
                        string saveFolder = String.Format(savepath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID);
......
217 240
                        try
218 241
                        {
219 242
                            System.IO.File.Copy(e.FinalPDFPath, saveFolder + e.OriginPDFName, true);
220
                            using (DataController dataController = new DataController())
221
                            {
222
                                string resultpath = CommonLib.Common.GetConfigString("DebugResultUrlPath", "URL", "");
223
                                string url = String.Format(resultpath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
224
                                var result = dataController.SetFinalPDFUrl(_item.PROJECT_NO, _item.DOCUMENT_ID, url);
225
                            }
226
                            SetFinalState(_item.ID, CommonLib.MARKUS_API.FinalStatus.Success);
227
                            _Thread.Remove(_T.First());
228 243
                        }
229 244
                        catch (Exception)
230 245
                        {
231
                            _Log.Write("e.FinalPDFPath:" + e.FinalPDFPath+ ",saveFolder:" + saveFolder+ ",e.OriginPDFName:" + e.OriginPDFName);
232
                        }                        
233
                    }                    
246
                            _Log.Write("e.FinalPDFPath:" + e.FinalPDFPath + ",saveFolder:" + saveFolder + ",e.OriginPDFName:" + e.OriginPDFName);
247
                        }
248

  
249
                        using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(_item.PROJECT_NO).ToString()))
250
                        {
251
                            var item = _entity.DOCUMENT_ITEM.Where(d => d.DOCUMENT_ID == _item.DOCUMENT_ID).FirstOrDefault();
252
                            ///TODO: RESULT FILE 경로 위치를 configuration으로 빼주세요
253
                            string resultpath = CommonLib.Common.GetConfigString("DebugResultUrlPath", "URL", "");
254

  
255
                            item.RESULT_FILE = String.Format(resultpath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
256
                            sendReqLog("RESULT_FILE_PATH", item.RESULT_FILE);
257
                            _entity.SaveChanges();
258
                            SetFinalState(_item.ID, FinalStatus.Success);
259
                            _Thread.Remove(_T.First());
260
                        }
261
                    }
234 262
                }
235 263
                catch (Exception ex)
236 264
                {
237
                    SetFinalState(_item.ID, CommonLib.MARKUS_API.FinalStatus.Error);
265
                    SetFinalState(_item.ID, FinalStatus.Error);
238 266
                    _Log.Write("에러 .." + ex.Message);
239 267
                    _Thread.Remove(_T.First());
240 268
                }
......
275 303

  
276 304
            try
277 305
            {
278
                using (DataController dc = new DataController())
306
                using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
279 307
                {
280
                    var result = dc.SetFinalError(FinalID, Msg);
281
                }                
308
                    instanceFinal = _entity.FINAL_PDF.Where(data => data.ID == FinalID).FirstOrDefault();
309

  
310
                    if (instanceFinal != null)
311
                    {
312
                        instanceFinal.STATUS = (int)FinalStatus.Error;
313
                        instanceFinal.EXCEPTION = DateTime.Now.ToShortDateString() + " " + Msg;
314
                        _entity.SaveChanges();
315
                    }
316
                }
282 317
            }
283 318
            catch (Exception ex)
284 319
            {
......
304 339

  
305 340
            var _T = _Thread.Where(t => t == (sender as MarkupToPDF.MarkupToPDF).FinalItem);
306 341

  
307
            if (_T.Count () > 0)
342
            if (_T.Count() > 0)
308 343
            {
309
                CommonLib.MARKUS_API.FINAL_PDF _Item = _T.First();
344
                FINAL_PDF _Item = _T.First();
310 345
                (sender as MarkupToPDF.MarkupToPDF).FinalMakeError -= new EventHandler<MarkupToPDF.MakeFinalErrorArgs>(_markuptoPDF_FinalMakeError);
311 346
                (sender as MarkupToPDF.MarkupToPDF).EndFinal -= new EventHandler<MarkupToPDF.EndFinalEventArgs>(_markuptoPDF_EndFinal);
312 347
                (sender as MarkupToPDF.MarkupToPDF).Dispose();
......
314 349

  
315 350
                Console.WriteLine(_Item.ID + "의 작업 중 에러가 발생했습니다");
316 351
            }
317
        }            
352
        }
353

  
354
        //private void CurrentCountUpdater()
355
        //{
356
        //    using (KCOMDataModel.DataModel.KCOMEntities _systemEntity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
357
        //    {
358
        //        var items = _systemEntity.SERVICE_PROPERTIES.Where(data => data.SERVICET_TYPE == _TypeName).ToList();
359

  
360
        //        items.Where(data => data.Property == "PROCESS_COUNT").FirstOrDefault().Value = _WorkItems.Count.ToString();
361

  
362
        //        _system.SaveChanges();
363
        //    }
364
        //}
318 365
    }
319 366
}
FinalService/KCOM_FinalService/MarkupToPDF/EventMember.cs
11 11
        public string Error { get; set; }
12 12
        public string FinalPDFPath { get; set; }
13 13
        public string OriginPDFName { get; set; }
14
        public CommonLib.MARKUS_API.FINAL_PDF FinalPDF { get; set; }
14
        public KCOMDataModel.DataModel.FINAL_PDF FinalPDF { get; set; }
15 15

  
16 16
    }
17 17

  
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs
2 2
using iTextSharp.text.pdf;
3 3
using KCOMDataModel.Common;
4 4
using KCOMDataModel.DataModel;
5
using MarkupToPDF.Common;
6 5
using MarkupToPDF.Controls.Common;
7 6
using MarkupToPDF.Serialize.Core;
8 7
using MarkupToPDF.Serialize.S_Control;
......
29 28
        private string _FinalPDFStorgeLocal = null;
30 29
        private string _FinalPDFStorgeRemote = null;
31 30
        private string OriginFileName = null;
32
        public CommonLib.MARKUS_API.FINAL_PDF FinalItem;
33
        public CommonLib.MARKUS_API.DOCINFO DocInfoItem = null;
34
        public List<CommonLib.MARKUS_API.DOCPAGE> DocPageItem = null;
35
        public CommonLib.MARKUS_API.MARKUP_INFO MarkupInfoItem = null;
36
        public List<CommonLib.MARKUS_API.MARKUP_DATA> MarkupDataSet = null;
31
        public FINAL_PDF FinalItem;
32
        public DOCINFO DocInfoItem = null;
33
        public List<DOCPAGE> DocPageItem = null;
34
        public MARKUP_INFO MarkupInfoItem = null;
35
        public List<MARKUP_DATA> MarkupDataSet = null;
37 36
        //private string _PrintPDFStorgeLocal = null;
38 37
        //private string _PrintPDFStorgeRemote = null;
39 38
        public event EventHandler<MakeFinalErrorArgs> FinalMakeError;
......
69 68
            return false;
70 69
        }
71 70

  
72
        private void SetNotice(string finalID , string message)
71
        private void SetNotice(string finalID, string message)
73 72
        {
74 73
            if (FinalMakeError != null)
75 74
            {
......
110 109
            return (size / scaleWidth);
111 110
        }
112 111

  
113
        public List<Point> GetPdfPointSystem(List<Point> point) 
112
        public List<Point> GetPdfPointSystem(List<Point> point)
114 113
        {
115 114
            List<Point> dummy = new List<Point>();
116 115
            foreach (var item in point)
......
138 137
        #region 생성자 & 소멸자
139 138
        public void MakeFinalPDF(object _FinalPDF)
140 139
        {
141
            
142
            CommonLib.MARKUS_API.DOCUMENT_ITEM documentItem;
143
            CommonLib.MARKUS_API.FINAL_PDF FinalPDF = (CommonLib.MARKUS_API.FINAL_PDF)_FinalPDF;
140

  
141
            DOCUMENT_ITEM documentItem;
142
            FINAL_PDF FinalPDF = (FINAL_PDF)_FinalPDF;
144 143
            FinalItem = FinalPDF;
145 144

  
146 145

  
......
150 149
            #region 문서 경로를 가져오는 것과 Status를 Create (1단계) 로 수정
151 150
            try
152 151
            {
153
                using (DataController dc = new DataController())
152
                using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
154 153
                {
155
                    var _properties = dc.GetProperties(FinalPDF.PROJECT_NO);
156
                    if(_properties != null)
154
                    var _properties = _entity.PROPERTIES.Where(pro => pro.PROPERTY == FinalPDF.PROJECT_NO);
155

  
156
                    if (_properties.Count() > 0)
157 157
                    {
158
                        PdfFilePathRoot = _properties.Where(t => t.TYPE == PropertiesType.Const_TileSorcePath).FirstOrDefault().VALUE;
158
                        PdfFilePathRoot = _properties.Where(t => t.TYPE == PropertiesType.Const_TileSorcePath).First().VALUE;
159 159
                        _FinalPDFStorgeLocal = _properties.Where(t => t.TYPE == PropertiesType.Const_FinalPDFStorgeLocal).First().VALUE;
160 160
                        _FinalPDFStorgeRemote = _properties.Where(t => t.TYPE == PropertiesType.Const_FinalPDFStorgeRemote).First().VALUE;
161 161
                    }
......
164 164
                        SetNotice(FinalPDF.ID, "프로퍼티를 가지고 올 수 없습니다.");
165 165
                        return;
166 166
                    }
167
                    dc.SetFinalStatus(FinalPDF.ID, CommonLib.MARKUS_API.FinalStatus.Create);
168
                }                
167

  
168
                    var finalList = _entity.FINAL_PDF.Where(final => final.ID == FinalPDF.ID);
169

  
170
                    if (finalList.Count() > 0)
171
                    {
172
                        finalList.FirstOrDefault().START_DATETIME = DateTime.Now;
173
                        finalList.FirstOrDefault().STATUS = (int)FinalStatus.Create;
174
                        _entity.SaveChanges();
175
                    }
176
                }
169 177
            }
170 178
            catch (Exception ex)
171 179
            {
......
177 185
            #region 문서 복사
178 186
            try
179 187
            {
180
                using (DataController dc = new DataController())
188
                using (CIEntities _entity = new CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(FinalPDF.PROJECT_NO).ToString()))
181 189
                {
182
                    //var _DOCINFO = _entity.DOCINFO.Where(doc => doc.ID == FinalPDF.DOCINFO_ID);
183
                    string project_no = FinalPDF.PROJECT_NO;
184
                    string docinfo_id = FinalPDF.DOCINFO_ID;
190
                    var _DOCINFO = _entity.DOCINFO.Where(doc => doc.ID == FinalPDF.DOCINFO_ID);
185 191

  
186
                    var _DOCINFO = dc.GetDocInfo(project_no, docinfo_id);
187
                    if (_DOCINFO != null)
192
                    if (_DOCINFO.Count() > 0)
188 193
                    {
189
                        DocInfoItem = _DOCINFO;
190
                        DocPageItem = dc.GetDocpage(project_no, docinfo_id);
194
                        DocInfoItem = _DOCINFO.FirstOrDefault();
195
                        DocPageItem = DocInfoItem.DOCPAGE.ToList();
191 196

  
192 197
                        PdfFilePathRoot = PdfFilePathRoot + @"\" + FinalPDF.PROJECT_NO + "_Tile" + @"\"
193 198
                                         + (System.Convert.ToInt64(FinalPDF.DOCUMENT_ID) / 100).ToString()
194 199
                                         + @"\" + FinalPDF.DOCUMENT_ID + @"\";
195 200

  
196
                        MarkupInfoItem = dc.GetMarkupInfo(project_no, docinfo_id);                            
201
                        MarkupInfoItem = DocInfoItem.MARKUP_INFO.Where(data => data.CONSOLIDATE == 1 && data.AVOID_CONSOLIDATE == 0 && data.PART_CONSOLIDATE == 0).FirstOrDefault();
197 202

  
198 203
                        if (MarkupInfoItem == null)
199 204
                        {
......
201 206
                        }
202 207
                        else
203 208
                        {
204
                            MarkupDataSet = dc.GetMarkupData(project_no, docinfo_id);
205
                            if (MarkupDataSet == null)
209
                            if (MarkupInfoItem.MARKUP_INFO_VERSION.Count > 0)
210
                            {
211
                                MarkupDataSet = MarkupInfoItem.MARKUP_INFO_VERSION.OrderBy(d => d.CREATE_DATE).LastOrDefault().MARKUP_DATA.ToList().OrderBy(d => d.PAGENUMBER).ToList();
212
                            }
213
                            else
206 214
                            {
207 215
                                throw new Exception("MARKUP_INFO_VERSION 이 존재 하지 않습니다");
208
                            }                            
209
                        }
210
                        documentItem = dc.GetDocumentItem(project_no, DocInfoItem.DOCUMENT_ID);
211
                        if (documentItem == null)
212
                        {
213
                            throw new Exception("DocInfo와 DocumentItem의 documentItemID가 같지 않습니다. 데이터를 확인해주세요");
216
                            }
214 217
                        }
215
                        var _files = new DirectoryInfo(PdfFilePathRoot).GetFiles("*.pdf"); //해당 폴더에 파일을 
216 218

  
217
                        #region 파일 체크
218
                        if (_files.Count() == 1)
219
                        using (CIEntities _ci_Internal = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(FinalPDF.PROJECT_NO).ToString()))
219 220
                        {
220
                            if (_files.First().Name.ToLower() == GetFileName(HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE).ToLower()))
221
                            documentItem = _ci_Internal.DOCUMENT_ITEM.Where(data => data.DOCUMENT_ID == DocInfoItem.DOCUMENT_ID).FirstOrDefault();
222
                            if (documentItem == null)
221 223
                            {
222
                                OriginFileName = _files.First().Name;
223
                                PdfFilePath = _files.First().CopyTo(TestFile, true);
224
                                throw new Exception("DocInfo와 DocumentItem의 documentItemID가 같지 않습니다. 데이터를 확인해주세요");
224 225
                            }
225
                            else
226

  
227
                            var _files = new DirectoryInfo(PdfFilePathRoot).GetFiles("*.pdf"); //해당 폴더에 파일을 
228

  
229
                            #region 파일 체크
230
                            if (_files.Count() == 1)
226 231
                            {
227
                                throw new Exception("현재 폴더 내 파일명이 데이터베이스와 상이합니다.filename:" + _files.First().Name.ToLower() + ",url:" + HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE).ToLower());
232
                                if (_files.First().Name.ToLower() == GetFileName(HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE).ToLower()))
233
                                {
234
                                    OriginFileName = _files.First().Name;
235
                                    PdfFilePath = _files.First().CopyTo(TestFile, true);
236
                                }
237
                                else
238
                                {
239
                                    throw new Exception("현재 폴더 내 파일명이 데이터베이스와 상이합니다.filename:" + _files.First().Name.ToLower() + ",url:" + HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE).ToLower());
240
                                }
228 241
                            }
229
                        }
230
                        else if (_files.Count() > 1)
231
                        {
232
                            var originalFile = _files.Where(data => data.Name == GetFileName(HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE))).FirstOrDefault();
233

  
234
                            if (originalFile == null)
242
                            else if (_files.Count() > 1)
235 243
                            {
236
                                throw new Exception("해당 폴더에 복수로 PDF들 존재하고 document_Item의 문서는 존재하지 않습니다");
244
                                var originalFile = _files.Where(data => data.Name == GetFileName(HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE))).FirstOrDefault();
245

  
246
                                if (originalFile == null)
247
                                {
248
                                    throw new Exception("해당 폴더에 복수로 PDF들 존재하고 document_Item의 문서는 존재하지 않습니다");
249
                                }
250
                                else
251
                                {
252
                                    OriginFileName = originalFile.Name;
253
                                    PdfFilePath = originalFile.CopyTo(TestFile, true);
254
                                }
237 255
                            }
238 256
                            else
239 257
                            {
240
                                OriginFileName = originalFile.Name;
241
                                PdfFilePath = originalFile.CopyTo(TestFile, true);
258
                                throw new Exception("PDF를 찾지 못하였습니다");
242 259
                            }
243
                        }
244
                        else
245
                        {
246
                            throw new Exception("PDF를 찾지 못하였습니다");
247
                        }
248
                        #endregion
260
                            #endregion
249 261

  
250
                        #region 예외처리
251
                        if (PdfFilePath == null)
252
                        {
253
                            throw new Exception("작업에 필요한 PDF가 정상적으로 복사되지 않았거나 DB정보가 상이합니다");
254
                        }
255
                        if (!PdfFilePath.Exists)
256
                        {
257
                            throw new Exception("PDF원본이 존재하지 않습니다");
262
                            #region 예외처리
263
                            if (PdfFilePath == null)
264
                            {
265
                                throw new Exception("작업에 필요한 PDF가 정상적으로 복사되지 않았거나 DB정보가 상이합니다");
266
                            }
267
                            if (!PdfFilePath.Exists)
268
                            {
269
                                throw new Exception("PDF원본이 존재하지 않습니다");
270
                            }
271
                            #endregion
258 272
                        }
259
                        #endregion
260 273
                    }
261 274
                    else
262 275
                    {
263 276
                        throw new Exception("일치하는 DocInfo가 없습니다");
264 277
                    }
265 278
                }
266
                    
267
                
268 279
            }
269 280
            catch (Exception ex)
270 281
            {
......
285 296

  
286 297
            try
287 298
            {
288
                TestFile = SetFlattingPDF(TestFile);
289
                SetStampInPDF(FinalItem, TestFile, MarkupInfoItem);
290 299

  
291
                if (EndFinal != null)
300
                using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
301
                {
302
                    var finalList = _entity.FINAL_PDF.Where(final => final.ID == FinalPDF.ID);
303

  
304
                    if (finalList.Count() > 0)
292 305
                    {
293
                        EndFinal(this, new EndFinalEventArgs
294
                        {
295
                            OriginPDFName = OriginFileName,
296
                            FinalPDFPath = FinalPDFPath.FullName,
297
                            Error = "",
298
                            Message = "",
299
                            FinalPDF = FinalPDF,
300
                        });
306
                        TestFile = SetFlattingPDF(TestFile);
307
                        //finalList.FirstOrDefault().STATUS = (int)FinalStatus.Insert;
308
                        //_entity.SaveChanges();
309

  
310
                        SetStampInPDF(FinalItem, TestFile, MarkupInfoItem);
311
                        //finalList.FirstOrDefault().STATUS = (int)FinalStatus.PdfStamp;
312
                        //_entity.SaveChanges();
301 313
                    }
314
                }
315
                if (EndFinal != null)
316
                {
317
                    EndFinal(this, new EndFinalEventArgs
318
                    {
319
                        OriginPDFName = OriginFileName,
320
                        FinalPDFPath = FinalPDFPath.FullName,
321
                        Error = "",
322
                        Message = "",
323
                        FinalPDF = FinalPDF,
324
                    });
325
                }
302 326
            }
303 327
            catch (Exception ex)
304 328
            {
......
311 335
        #region PDF
312 336
        public static float scaleWidth = 0;
313 337
        public static float scaleHeight = 0;
314
         
338

  
315 339
        private string SetFlattingPDF(string tempFileInfo)
316 340
        {
317 341
            if (File.Exists(tempFileInfo))
......
324 348
                    var mediaBox = pdfReader.GetPageSize(i);
325 349
                    var cropbox = pdfReader.GetCropBox(i);
326 350

  
351
                    //using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString().ToString()))
352
                    //{
353
                    //    _entity.DOCPAGE.Where(d=>d.DOCINFO_ID == DocInfoItem.DOCPAGE)
354
                    //}
327 355
                    var currentPage = DocPageItem.Where(d => d.PAGE_NUMBER == i).FirstOrDefault();
328 356

  
357
                    //scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / mediaBox.Width;
358
                    //scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / mediaBox.Height;
359
                    //scaleWidth = 2.0832634F;
360
                    //scaleHeight = 3.0F;
361

  
329 362
                    PdfRectangle rect = new PdfRectangle(cropbox, pdfReader.GetPageRotation(i));
363
                    //강인구 수정
364
                    //if (cropbox != null && (cropbox.Width < mediaBox.Width || cropbox.Height < cropbox.Height))
365
                    //if (cropbox != null && (cropbox.Width < mediaBox.Width || cropbox.Height < mediaBox.Height))
366
                    //{
367
                    //    var pageDict = pdfReader.GetPageN(i);
368
                    //    pageDict.Put(PdfName.MEDIABOX, rect);
369
                    //}
330 370
                }
331 371

  
332 372
                var memStream = new MemoryStream();
......
366 406
            var array = memStream.ToArray();
367 407
            File.WriteAllBytes(dest, array);
368 408
        }
369
        
370
        public bool SetStampInPDF(CommonLib.MARKUS_API.FINAL_PDF finaldata, string testFile, CommonLib.MARKUS_API.MARKUP_INFO markupInfo)
409

  
410
        public bool SetStampInPDF(FINAL_PDF finaldata, string testFile, MARKUP_INFO markupInfo)
371 411
        {
372 412
            string pdfFilePath = null;
373
            
413
            List<MEMBER> memberlist = null;
374 414
            FileInfo tempFileInfo = new FileInfo(testFile);
375 415

  
376 416
            if (!Directory.Exists(_FinalPDFStorgeLocal))
......
378 418
                Directory.CreateDirectory(_FinalPDFStorgeLocal);
379 419
            }
380 420
            pdfFilePath = _FinalPDFStorgeLocal + @"\" + tempFileInfo.Name;
381

  
382
            #region 코멘트 적용 + 커버시트
383
            using (Stream pdfStream = new FileInfo(testFile).Open(FileMode.Open, FileAccess.ReadWrite)) //
421
            using (CIEntities cIEntities = new CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(finaldata.PROJECT_NO).ToString()))
384 422
            {
385
                PdfReader pdfReader = new PdfReader(pdfStream);
386
                //List<Dictionary<string, object>> lstoutlineTop = new List<Dictionary<string, object>>();
387
                Dictionary<string, object> bookmark;
388
                List<Dictionary<string, object>> outlines;
389
                outlines = new List<Dictionary<string, object>>();
390
                List<Dictionary<string, object>> root = new List<Dictionary<string, object>>();
391

  
392
                var dic = new Dictionary<string, object>();
393
                foreach (var data in MarkupDataSet)
394
                {
423
                memberlist = cIEntities.MEMBER.ToList();
424
            }
425
            using (KCOMEntities _entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString()))
426
            {
427
                FINAL_PDF pdfLink = _entity.FINAL_PDF.Where(data => data.ID == finaldata.ID).FirstOrDefault();
395 428

  
396
                    string userid = string.Empty;
397
                    string username = string.Empty;
398
                    string userdept = string.Empty;
399
                    using (DataController dataController = new DataController())
429
                #region 코멘트 적용 + 커버시트
430
                using (Stream pdfStream = new FileInfo(testFile).Open(FileMode.Open, FileAccess.ReadWrite)) //
431
                {
432
                    PdfReader pdfReader = new PdfReader(pdfStream);
433
                    //List<Dictionary<string, object>> lstoutlineTop = new List<Dictionary<string, object>>();
434
                    Dictionary<string, object> bookmark;
435
                    List<Dictionary<string, object>> outlines;
436
                    outlines = new List<Dictionary<string, object>>();
437
                    List<Dictionary<string, object>> root = new List<Dictionary<string, object>>();
438

  
439
                    var dic = new Dictionary<string, object>();
440
                    foreach (var data in MarkupDataSet)
400 441
                    {
401
                        var member = dataController.GetCommentMemberInfo(finaldata.PROJECT_NO, data.ID);
402
                        userid = member.ID;
403
                        username = member.NAME;
404
                        userdept = member.DEPARTMENT;
405
                    }
406 442

  
407
                    bookmark = new Dictionary<string, object>();
408
                    bookmark.Add("Title", string.Format("User:{0}[{1}] Commented Page : {2}", username, userdept, data.PAGENUMBER));
409
                    bookmark.Add("Page", data.PAGENUMBER + " Fit");
410
                    bookmark.Add("Action", "GoTo");
411
                    bookmark.Add("Kids", outlines);
412
                    root.Add(bookmark);
413
                }
443
                        string userid = data.MARKUP_INFO_VERSION.MARKUP_INFO.USER_ID;
444

  
445
                        var member = memberlist.Where(u => u.ID == userid).FirstOrDefault();
446
                        string username = member.NAME;
447
                        string userdept = member.DEPARTMENT;
448
                        bookmark = new Dictionary<string, object>();
449
                        bookmark.Add("Title", string.Format("User:{0}[{1}] Commented Page : {2}", username, userdept, data.PAGENUMBER));
450
                        bookmark.Add("Page", data.PAGENUMBER + " Fit");
451
                        bookmark.Add("Action", "GoTo");
452
                        bookmark.Add("Kids", outlines);
453
                        root.Add(bookmark);
454
                    }
414 455

  
415 456

  
416
                using (PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(pdfFilePath, FileMode.Create)))
417
                {
418
                    var _SetColor = new SolidColorBrush(Colors.Red);
457
                    using (PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(pdfFilePath, FileMode.Create)))
458
                    {
459
                        var _SetColor = new SolidColorBrush(Colors.Red);
419 460

  
420
                    string[] delimiterChars = { "|DZ|" };
421
                    string[] delimiterChars2 = { "|" };
461
                        string[] delimiterChars = { "|DZ|" };
462
                        string[] delimiterChars2 = { "|" };
422 463

  
423
                    //pdfStamper.FormFlattening = true; //이미 선처리 작업함
424
                    pdfStamper.SetFullCompression();
425
                    _SetColor = new SolidColorBrush(Colors.Red);
464
                        //pdfStamper.FormFlattening = true; //이미 선처리 작업함
465
                        pdfStamper.SetFullCompression();
466
                        _SetColor = new SolidColorBrush(Colors.Red);
426 467

  
427
                    foreach (var markupItem in MarkupDataSet)
428
                    {
429
                        pdfSize = pdfReader.GetPageSizeWithRotation(markupItem.PAGENUMBER);
430
                        var currentPage = DocPageItem.Where(d => d.PAGE_NUMBER == markupItem.PAGENUMBER).FirstOrDefault();
468
                        foreach (var markupItem in MarkupDataSet)
469
                        {
470
                            pdfSize = pdfReader.GetPageSizeWithRotation(markupItem.PAGENUMBER);
471
                            var currentPage = DocPageItem.Where(d => d.PAGE_NUMBER == markupItem.PAGENUMBER).FirstOrDefault();
431 472

  
432
                        mediaBox = pdfReader.GetPageSize(markupItem.PAGENUMBER);
433
                        var cropBox = pdfReader.GetCropBox(markupItem.PAGENUMBER);
473
                            mediaBox = pdfReader.GetPageSize(markupItem.PAGENUMBER);
474
                            var cropBox = pdfReader.GetCropBox(markupItem.PAGENUMBER);
434 475

  
435
                        //scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / mediaBox.Width;
436
                        //scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / mediaBox.Height;
476
                            //scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / mediaBox.Width;
477
                            //scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / mediaBox.Height;
437 478

  
438
                        //강인구 테스트
439
                        scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width;
440
                        scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height;
479
                            //강인구 테스트
480
                            scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width;
481
                            scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height;
441 482

  
442
                        if (cropBox != null && cropBox.Width < mediaBox.Width || cropBox.Height < mediaBox.Height)
443
                        {
444
                            mediaBox = cropBox;
445
                        }
446
                        using (DataController dc = new DataController())
447
                        {
448
                            dc.SetFinalCurrentPage(finaldata.ID, markupItem.PAGENUMBER);
449
                        }                            
483
                            if (cropBox != null && cropBox.Width < mediaBox.Width || cropBox.Height < mediaBox.Height)
484
                            {
485
                                mediaBox = cropBox;
486
                            }
450 487

  
451
                        string[] markedData = markupItem.DATA.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
488
                            pdfLink.CURRENT_PAGE = markupItem.PAGENUMBER;
489
                            _entity.SaveChanges();
452 490

  
453
                        PdfContentByte contentByte = pdfStamper.GetOverContent(markupItem.PAGENUMBER);
491
                            string[] markedData = markupItem.DATA.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
454 492

  
493
                            PdfContentByte contentByte = pdfStamper.GetOverContent(markupItem.PAGENUMBER);
455 494

  
456
                        foreach (var data in markedData)
457
                        {
458
                            var item = JsonSerializerHelper.UnCompressString(data);
459
                            var ControlT = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item);
460 495

  
461
                            try
496
                            foreach (var data in markedData)
462 497
                            {
463
                                switch (ControlT.Name)
498
                                var item = JsonSerializerHelper.UnCompressString(data);
499
                                var ControlT = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item);
500

  
501
                                try
464 502
                                {
465
                                    #region LINE
466
                                    case "LineControl":
467
                                        {
468
                                            using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
503
                                    switch (ControlT.Name)
504
                                    {
505
                                        #region LINE
506
                                        case "LineControl":
469 507
                                            {
470
                                                string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
471
                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
472
                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
473
                                                DoubleCollection DashSize = control.DashSize;
474
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
475

  
476
                                                var Opacity = control.Opac;
477
                                                string UserID = control.UserID;
478
                                                double Interval = control.Interval;
479
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
480
                                                Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, _SetColor, Opacity);
481
                                                switch (control.LineStyleSet)
508
                                                using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
482 509
                                                {
483
                                                    case LineStyleSet.ArrowLine:
484
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
485
                                                        break;
486
                                                    case LineStyleSet.CancelLine:
487
                                                        {
488
                                                            var x = Math.Abs((Math.Abs(StartPoint.X) - Math.Abs(EndPoint.X)));
489
                                                            var y = Math.Abs((Math.Abs(StartPoint.Y) - Math.Abs(EndPoint.Y)));
490

  
491
                                                            if (x > y)
510
                                                    string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
511
                                                    Point StartPoint = GetPdfPointSystem(control.StartPoint);
512
                                                    Point EndPoint = GetPdfPointSystem(control.EndPoint);
513
                                                    DoubleCollection DashSize = control.DashSize;
514
                                                    List<Point> PointSet = GetPdfPointSystem(control.PointSet);
515

  
516
                                                    var Opacity = control.Opac;
517
                                                    string UserID = control.UserID;
518
                                                    double Interval = control.Interval;
519
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
520
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, _SetColor, Opacity);
521
                                                    switch (control.LineStyleSet)
522
                                                    {
523
                                                        case LineStyleSet.ArrowLine:
524
                                                            Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
525
                                                            break;
526
                                                        case LineStyleSet.CancelLine:
492 527
                                                            {
493
                                                                StartPoint = new Point(StartPoint.X, StartPoint.Y - (float)(control.Interval / 3.0));
494
                                                                EndPoint = new Point(EndPoint.X, EndPoint.Y - (float)(control.Interval / 3.0));
495
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, Opacity);
528
                                                                var x = Math.Abs((Math.Abs(StartPoint.X) - Math.Abs(EndPoint.X)));
529
                                                                var y = Math.Abs((Math.Abs(StartPoint.Y) - Math.Abs(EndPoint.Y)));
530

  
531
                                                                if (x > y)
532
                                                                {
533
                                                                    StartPoint = new Point(StartPoint.X, StartPoint.Y - (float)(control.Interval / 3.0));
534
                                                                    EndPoint = new Point(EndPoint.X, EndPoint.Y - (float)(control.Interval / 3.0));
535
                                                                    Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, Opacity);
536
                                                                }
496 537
                                                            }
497
                                                        }
498
                                                        break;
499
                                                    case LineStyleSet.TwinLine:
500
                                                        {
501
                                                            Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
502
                                                            Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
503
                                                        }
504
                                                        break;
505
                                                    case LineStyleSet.DimLine:
506
                                                        {
507
                                                            Controls_PDF.HoneyPDFLib_DrawSet_Arrow.DimAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
508
                                                            Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
509
                                                            Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
510
                                                        }
511
                                                        break;
512
                                                    default:
513
                                                        break;
514
                                                }
538
                                                            break;
539
                                                        case LineStyleSet.TwinLine:
540
                                                            {
541
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
542
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
543
                                                            }
544
                                                            break;
545
                                                        case LineStyleSet.DimLine:
546
                                                            {
547
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.DimAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
548
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
549
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
550
                                                            }
551
                                                            break;
552
                                                        default:
553
                                                            break;
554
                                                    }
515 555

  
516 556

  
557
                                                }
517 558
                                            }
518
                                        }
519
                                        break;
520
                                    #endregion
521
                                    #region ArrowControlMulti
522
                                    case "ArrowControl_Multi":
523
                                        {
524
                                            using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
559
                                            break;
560
                                        #endregion
561
                                        #region ArrowControlMulti
562
                                        case "ArrowControl_Multi":
525 563
                                            {
526
                                                string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
527
                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
528
                                                Point MidPoint = GetPdfPointSystem(control.MidPoint);
529
                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
530
                                                DoubleCollection DashSize = control.DashSize;
531
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
532
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
564
                                                using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
565
                                                {
566
                                                    string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
567
                                                    Point StartPoint = GetPdfPointSystem(control.StartPoint);
568
                                                    Point MidPoint = GetPdfPointSystem(control.MidPoint);
569
                                                    Point EndPoint = GetPdfPointSystem(control.EndPoint);
570
                                                    DoubleCollection DashSize = control.DashSize;
571
                                                    List<Point> PointSet = GetPdfPointSystem(control.PointSet);
572
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
533 573

  
534
                                                double Opacity = control.Opac;
574
                                                    double Opacity = control.Opac;
535 575

  
536
                                                if (EndPoint == MidPoint)
537
                                                {
538
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
539
                                                }
540
                                                else
541
                                                {
542
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, (int)LineSize, contentByte, _SetColor, Opacity);
543
                                                }
576
                                                    if (EndPoint == MidPoint)
577
                                                    {
578
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
579
                                                    }
580
                                                    else
581
                                                    {
582
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, (int)LineSize, contentByte, _SetColor, Opacity);
583
                                                    }
544 584

  
545
                                                Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
585
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
546 586

  
587
                                                }
547 588
                                            }
548
                                        }
549
                                        break;
550
                                    #endregion
551
                                    #region PolyControl
552
                                    case "PolygonControl":
553
                                        using (S_PolyControl control = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
554
                                        {
555
                                            string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
556
                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
557
                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
558
                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
559
                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
560
                                            double Opacity = control.Opac;
561
                                            DoubleCollection DashSize = control.DashSize;
562

  
563
                                            Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
564
                                        }
565
                                        break;
566
                                    #endregion
567
                                    #region ArcControl
568
                                    case "ArcControl":
569
                                        {
570
                                            using (S_ArcControl control = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
589
                                            break;
590
                                        #endregion
591
                                        #region PolyControl
592
                                        case "PolygonControl":
593
                                            using (S_PolyControl control = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
571 594
                                            {
572 595
                                                string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
573 596
                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
574 597
                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
575
                                                Point MidPoint = GetPdfPointSystem(control.MidPoint);
576
                                                DoubleCollection DashSize = control.DashSize;
577 598
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
578

  
579
                                                var Opacity = control.Opac;
580
                                                string UserID = control.UserID;
581 599
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
582
                                                bool IsTransOn = control.IsTransOn;
583

  
584
                                                if (control.IsTransOn)
585
                                                {
586
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
587
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
588
                                                }
589
                                                else
590
                                                {
591
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Arc.DrawArc(StartPoint, MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
592
                                                }
600
                                                double Opacity = control.Opac;
601
                                                DoubleCollection DashSize = control.DashSize;
593 602

  
594
                                            }
595
                                        }
596
                                        break;
597
                                    #endregion
598
                                    #region RectangleControl
599
                                    case "RectangleControl":
600
                                        using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
601
                                        {
602
                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
603
                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
604
                                            var PaintStyle = control.PaintState;
605
                                            double Angle = control.Angle;
606
                                            DoubleCollection DashSize = control.DashSize;
607
                                            double Opacity = control.Opac;
608
                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
609

  
610
                                            Controls_PDF.HoneyPDFLib_DrawSet_Shape.DrawRectangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
611
                                        }
612
                                        break;
613
                                    #endregion
614
                                    #region TriControl
615
                                    case "TriControl":
616
                                        using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
617
                                        {
618
                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
619
                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
620
                                            var PaintStyle = control.Paint;
621
                                            double Angle = control.Angle;
622
                                            //StrokeColor = _SetColor, //색상은 레드
623
                                            DoubleCollection DashSize = control.DashSize;
624
                                            double Opacity = control.Opac;
625
                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
626

  
627
                                            Controls_PDF.HoneyPDFLib_DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
628
                                        }
629
                                        break;
630
                                    #endregion
631
                                    #region CircleControl
632
                                    case "CircleControl":
633
                                        using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
634
                                        {
635
                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
636
                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
637
                                            var StartPoint = GetPdfPointSystem(control.StartPoint);
638
                                            var EndPoint = GetPdfPointSystem(control.EndPoint);
639
                                            var PaintStyle = control.PaintState;
640
                                            double Angle = control.Angle;
641
                                            DoubleCollection DashSize = control.DashSize;
642
                                            double Opacity = control.Opac;
643
                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
644
                                            Controls_PDF.HoneyPDFLib_DrawSet_Shape.DrawCircle(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity, Angle, PointSet);
645

  
646
                                        }
647
                                        break;
648
                                    #endregion
649
                                    #region RectCloudControl
650
                                    case "RectCloudControl":
651
                                        using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
652
                                        {
653
                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
654
                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
655
                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
656
                                            double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
657

  
658
                                            double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
659

  
660
                                            var PaintStyle = control.PaintState;
661
                                            double Opacity = control.Opac;
662
                                            DoubleCollection DashSize = control.DashSize;
663

  
664
                                            //드로잉 방식이 표현되지 않음
665
                                            var rrrr = returnAngle(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
666

  
667
                                            double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
668
                                            bool reverse = (area < 0);
669
                                            if (PaintStyle == PaintSet.None)
670
                                            {
671
                                                Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
672
                                            }
673
                                            else
674
                                            {
675
                                                Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
676
                                            }
677
                                        }
678
                                        break;
679
                                    #endregion
680
                                    #region CloudControl
681
                                    case "CloudControl":
682
                                        using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
683
                                        {
684
                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
685
                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
686
                                            double Toler = control.Toler;
687
                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
688
                                            double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
689
                                            var PaintStyle = control.PaintState;
690
                                            double Opacity = control.Opac;
691
                                            bool isTransOn = control.IsTrans;
692
                                            bool isChain = control.IsChain;
693

  
694
                                            DoubleCollection DashSize = control.DashSize;
695

  
696
                                            if (isChain)
697
                                            {
698 603
                                                Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
699 604
                                            }
700
                                            else
605
                                            break;
606
                                        #endregion
607
                                        #region ArcControl
608
                                        case "ArcControl":
701 609
                                            {
702
                                                if (isTransOn)
610
                                                using (S_ArcControl control = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
703 611
                                                {
704
                                                    double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
705
                                                    bool reverse = (area < 0);
706

  
707
                                                    if (PaintStyle == PaintSet.None)
612
                                                    string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
613
                                                    Point StartPoint = GetPdfPointSystem(control.StartPoint);
614
                                                    Point EndPoint = GetPdfPointSystem(control.EndPoint);
615
                                                    Point MidPoint = GetPdfPointSystem(control.MidPoint);
616
                                                    DoubleCollection DashSize = control.DashSize;
617
                                                    List<Point> PointSet = GetPdfPointSystem(control.PointSet);
618

  
619
                                                    var Opacity = control.Opac;
620
                                                    string UserID = control.UserID;
621
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
622
                                                    bool IsTransOn = control.IsTransOn;
623

  
624
                                                    if (control.IsTransOn)
708 625
                                                    {
709
                                                        Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
626
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
627
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
710 628
                                                    }
711 629
                                                    else
712 630
                                                    {
713
                                                        Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
631
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arc.DrawArc(StartPoint, MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
714 632
                                                    }
715
                                                }
716
                                                else
717
                                                {
718
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, control.DashSize, _SetColor, PaintStyle, Opacity);
633

  
719 634
                                                }
720 635
                                            }
721
                                        }
722
                                        break;
723
                                    #endregion
724
                                    #region TEXT
725
                                    case "TextControl":
726
                                        using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
727
                                        {
728
                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
729
                                            string Text = control.Text;
730

  
731
                                            bool isUnderline = false;
732
                                            control.BoxW -= scaleWidth;
733
                                            control.BoxH -= scaleHeight;
734
                                            System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxW, (float)control.BoxH);
735
                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
736
                                            Point EndPoint = GetPdfPointSystem(new Point(control.StartPoint.X + control.BoxW, control.StartPoint.Y + control.BoxH));
737

  
738
                                            List<Point> pointSet = new List<Point>();
739
                                            pointSet.Add(StartPoint);
740
                                            pointSet.Add(EndPoint);
741

  
742
                                            PaintSet paint = PaintSet.None;
743
                                            switch (control.paintMethod)
636
                                            break;
637
                                        #endregion
638
                                        #region RectangleControl
639
                                        case "RectangleControl":
640
                                            using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
744 641
                                            {
745
                                                case 1:
746
                                                    {
747
                                                        paint = PaintSet.Fill;
748
                                                    }
749
                                                    break;
750
                                                case 2:
751
                                                    {
752
                                                        paint = PaintSet.Hatch;
753
                                                    }
754
                                                    break;
755
                                                default:
756
                                                    break;
642
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
643
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
644
                                                var PaintStyle = control.PaintState;
645
                                                double Angle = control.Angle;
646
                                                DoubleCollection DashSize = control.DashSize;
647
                                                double Opacity = control.Opac;
648
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
649

  
650
                                                Controls_PDF.HoneyPDFLib_DrawSet_Shape.DrawRectangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
757 651
                                            }
758
                                            if (control.isHighLight) paint |= PaintSet.Highlight;
759

  
760
                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
761
                                            double TextSize = Convert.ToDouble(data2[1]);
762
                                            SolidColorBrush FontColor = _SetColor;
763
                                            double Angle = control.Angle;
764
                                            double Opacity = control.Opac;
765
                                            FontFamily fontfamilly = new FontFamily(control.fontConfig[0]);
766
                                            var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
767

  
768
                                            FontStyle fontStyle = FontStyles.Normal;
769
                                            if (FontStyles.Italic == TextStyle)
652
                                            break;
653
                                        #endregion
654
                                        #region TriControl
655
                                        case "TriControl":
656
                                            using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
770 657
                                            {
771
                                                fontStyle = FontStyles.Italic;
772
                                            }
773

  
774
                                            FontWeight fontWeight = FontWeights.Black;
658
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
659
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
660
                                                var PaintStyle = control.Paint;
661
                                                double Angle = control.Angle;
662
                                                //StrokeColor = _SetColor, //색상은 레드
663
                                                DoubleCollection DashSize = control.DashSize;
664
                                                double Opacity = control.Opac;
665
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
775 666

  
776
                                            var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
777
                                            //강인구 수정(2018.04.17)
778
                                            if (FontWeights.Bold == TextWeight)
779
                                            //if (FontWeights.ExtraBold == TextWeight)
780
                                            {
781
                                                fontWeight = FontWeights.Bold;
667
                                                Controls_PDF.HoneyPDFLib_DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
782 668
                                            }
783

  
784
                                            TextDecorationCollection decoration = TextDecorations.Baseline;
785
                                            if (control.fontConfig.Count() == 4)
669
                                            break;
670
                                        #endregion
671
                                        #region CircleControl
672
                                        case "CircleControl":
673
                                            using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
786 674
                                            {
787
                                                decoration = TextDecorations.Underline;
675
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
676
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
677
                                                var StartPoint = GetPdfPointSystem(control.StartPoint);
678
                                                var EndPoint = GetPdfPointSystem(control.EndPoint);
679
                                                var PaintStyle = control.PaintState;
680
                                                double Angle = control.Angle;
681
                                                DoubleCollection DashSize = control.DashSize;
682
                                                double Opacity = control.Opac;
683
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
684
                                                Controls_PDF.HoneyPDFLib_DrawSet_Shape.DrawCircle(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity, Angle, PointSet);
685

  
788 686
                                            }
687
                                            break;
688
                                        #endregion
689
                                        #region RectCloudControl
690
                                        case "RectCloudControl":
691
                                            using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
692
                                            {
693
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
694
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
695
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
696
                                                double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
789 697

  
790
                                            Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString(StartPoint, EndPoint, LineSize, contentByte, _SetColor, paint, TextSize, fontfamilly, fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
791
                                        }
792
                                        break;
793
                                    #endregion
794
                                    #region ArrowTextControl
795
                                    case "ArrowTextControl":
796
                                        using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
797
                                        {
798
                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
799
                                            Point tempStartPoint = GetPdfPointSystem(control.StartPoint);
800
                                            Point tempMidPoint = GetPdfPointSystem(control.MidPoint);
801
                                            Point tempEndPoint = GetPdfPointSystem(control.EndPoint);
802
                                            bool isUnderLine = false;
803
                                            string Text = "";
804
                                            double fontsize = 30;
805

  
806
                                            System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight);
807
                                            Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight));
808
                                            List<Point> tempPoint = new List<Point>();
809

  
810
                                            var tempRectMidPoint = MathSet.getRectMiddlePoint(rect);
811

  
812
                                            tempPoint.Add(new Point(rect.Left, tempRectMidPoint.Y));
813
                                            tempPoint.Add(new Point(tempRectMidPoint.X, rect.Top));
814
                                            tempPoint.Add(new Point(rect.Right, tempRectMidPoint.Y));
815
                                            tempPoint.Add(new Point(tempRectMidPoint.X, rect.Bottom));
816
                                            double Angle = control.Angle;
817
                                            var newStartPoint = tempStartPoint;
818
                                            var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
819
                                            var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
820

  
821
                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
822
                                            SolidColorBrush FontColor = _SetColor;
823
                                            bool isHighlight = control.isHighLight;
824
                                            double Opacity = control.Opac;
825
                                            PaintSet Paint = PaintSet.None;
826

  
827
                                            switch (control.ArrowStyle)
698
                                                double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
699

  
700
                                                var PaintStyle = control.PaintState;
701
                                                double Opacity = control.Opac;
702
                                                DoubleCollection DashSize = control.DashSize;
703

  
704
                                                //드로잉 방식이 표현되지 않음
705
                                                var rrrr = returnAngle(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
706

  
707
                                                double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
708
                                                bool reverse = (area < 0);
709
                                                if (PaintStyle == PaintSet.None)
710
                                                {
711
                                                    Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
712
                                                }
713
                                                else
714
                                                {
715
                                                    Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
716
                                                }
717
                                            }
718
                                            break;
719
                                        #endregion
720
                                        #region CloudControl
721
                                        case "CloudControl":
722
                                            using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
828 723
                                            {
829
                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal:
830
                                                    {
831
                                                        Paint = PaintSet.None;
832
                                                    }
833
                                                    break;
834
                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud:
724
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
725
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
726
                                                double Toler = control.Toler;
727
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
728
                                                double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
729
                                                var PaintStyle = control.PaintState;
730
                                                double Opacity = control.Opac;
731
                                                bool isTransOn = control.IsTrans;
732
                                                bool isChain = control.IsChain;
733

  
734
                                                DoubleCollection DashSize = control.DashSize;
735

  
736
                                                if (isChain)
737
                                                {
738
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
739
                                                }
740
                                                else
741
                                                {
742
                                                    if (isTransOn)
835 743
                                                    {
836
                                                        Paint = PaintSet.Hatch;
744
                                                        double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
745
                                                        bool reverse = (area < 0);
746

  
747
                                                        if (PaintStyle == PaintSet.None)
748
                                                        {
749
                                                            Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
750
                                                        }
751
                                                        else
752
                                                        {
753
                                                            Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
754
                                                        }
837 755
                                                    }
838
                                                    break;
839
                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect:
756
                                                    else
840 757
                                                    {
841
                                                        Paint = PaintSet.Fill;
758
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, control.DashSize, _SetColor, PaintStyle, Opacity);
842 759
                                                    }
843
                                                    break;
844
                                                default:
845
                                                    break;
846
                                            }
847
                                            if (control.isHighLight) Paint |= PaintSet.Highlight;
848

  
849
                                            if (Paint == PaintSet.Hatch)
850
                                            {
851
                                                Text = control.ArrowText;
760
                                                }
852 761
                                            }
853
                                            else
762
                                            break;
763
                                        #endregion
764
                                        #region TEXT
765
                                        case "TextControl":
766
                                            using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
854 767
                                            {
855
                                                Text = control.ArrowText;
856
                                            }
768
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
769
                                                string Text = control.Text;
857 770

  
858
                                            try
859
                                            {
860
                                                if (control.fontConfig.Count == 4)
771
                                                bool isUnderline = false;
772
                                                control.BoxW -= scaleWidth;
773
                                                control.BoxH -= scaleHeight;
774
                                                System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxW, (float)control.BoxH);
775
                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
776
                                                Point EndPoint = GetPdfPointSystem(new Point(control.StartPoint.X + control.BoxW, control.StartPoint.Y + control.BoxH));
777

  
778
                                                List<Point> pointSet = new List<Point>();
779
                                                pointSet.Add(StartPoint);
780
                                                pointSet.Add(EndPoint);
781

  
782
                                                PaintSet paint = PaintSet.None;
783
                                                switch (control.paintMethod)
861 784
                                                {
862
                                                    fontsize = Convert.ToDouble(control.fontConfig[3]);
785
                                                    case 1:
786
                                                        {
787
                                                            paint = PaintSet.Fill;
788
                                                        }
789
                                                        break;
790
                                                    case 2:
791
                                                        {
792
                                                            paint = PaintSet.Hatch;
793
                                                        }
794
                                                        break;
795
                                                    default:
796
                                                        break;
863 797
                                                }
798
                                                if (control.isHighLight) paint |= PaintSet.Highlight;
864 799

  
865
                                                //강인구 수정(2018.04.17)
800
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
801
                                                double TextSize = Convert.ToDouble(data2[1]);
802
                                                SolidColorBrush FontColor = _SetColor;
803
                                                double Angle = control.Angle;
804
                                                double Opacity = control.Opac;
805
                                                FontFamily fontfamilly = new FontFamily(control.fontConfig[0]);
866 806
                                                var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
867 807

  
868 808
                                                FontStyle fontStyle = FontStyles.Normal;
......
874 814
                                                FontWeight fontWeight = FontWeights.Black;
875 815

  
876 816
                                                var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
817
                                                //강인구 수정(2018.04.17)
877 818
                                                if (FontWeights.Bold == TextWeight)
819
                                                //if (FontWeights.ExtraBold == TextWeight)
878 820
                                                {
879 821
                                                    fontWeight = FontWeights.Bold;
880 822
                                                }
881 823

  
882 824
                                                TextDecorationCollection decoration = TextDecorations.Baseline;
883
                                                if (control.fontConfig.Count() == 5)
825
                                                if (control.fontConfig.Count() == 4)
884 826
                                                {
885 827
                                                    decoration = TextDecorations.Underline;
886 828
                                                }
887 829

  
888
                                                if (control.isTrans)
830
                                                Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString(StartPoint, EndPoint, LineSize, contentByte, _SetColor, paint, TextSize, fontfamilly, fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
831
                                            }
832
                                            break;
833
                                        #endregion
834
                                        #region ArrowTextControl
835
                                        case "ArrowTextControl":
836
                                            using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
837
                                            {
838
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
839
                                                Point tempStartPoint = GetPdfPointSystem(control.StartPoint);
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)