프로젝트

일반

사용자정보

개정판 5ba8f2d5

ID5ba8f2d54b888032fd9e491b88239b9b9d420a3d
상위 4fcb686a
하위 950e6b84

김태성이(가) 2년 이상 전에 추가함

issue #0000 상단 Text Option 변경시 finalPDF에서 적용 안 되는 묹제 수정

Change-Id: I953cbd54dda6c80c893168df8ef36eb03f770f5f

차이점 보기:

FinalService/KCOM_FinalService/FinalProcess/Program.cs
13 13
{
14 14
    class Program
15 15
    {
16
        public static bool IsEndFinal = false;
16 17
        protected static ILog logger;
17 18
        public static FINAL_PDF finalPdf = null;
18 19
        public static string RemoteAddress = null;
......
33 34
                    MarkupToPDF.MarkupToPDF _markuptoPDF = new MarkupToPDF.MarkupToPDF();
34 35
                    _markuptoPDF.FinalMakeError += new EventHandler<MarkupToPDF.MakeFinalErrorArgs>(_markuptoPDF_FinalMakeError);
35 36
                    _markuptoPDF.StatusChanged += new EventHandler<MarkupToPDF.StatusChangedEventArgs>(_markuptoPDF_StatusChange);
36

  
37
                    _markuptoPDF.EndFinal += _markuptoPDF_EndFinal;
37 38
                    using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
38 39
                    {
39 40
                        var items = _entity.FINAL_PDF.Where(x => x.ID == finalID);
......
46 47

  
47 48
                    if (finalPdf != null)
48 49
                    {
49
                        var result = _markuptoPDF.MakeFinalPDF(finalPdf);
50
                        _markuptoPDF.MakeFinalPDF(finalPdf);
50 51

  
51
                        using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
52
                        {
53
                            var items = _entity.FINAL_PDF.Where(x => x.ID == finalID);
54

  
55
                            if (items.Count() > 0)
56
                            {
57
                                if (result.Error == null)
58
                                {
59
                                    items.First().STATUS = 4;
60
                                    items.First().END_DATETIME = DateTime.Now;
61
                                }
62
                            }
63
                        }
64 52
                    }
65 53
                }
66 54
            }
......
78 66
            }
79 67
        }
80 68

  
69
        private static void _markuptoPDF_EndFinal(object sender, EndFinalEventArgs e)
70
        {
71
            using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
72
            {
73
                var items = _entity.FINAL_PDF.Where(x => x.ID == e.FinalPDF.ID);
74

  
75
                if (items.Count() > 0)
76
                {
77
                    if (e.Error == null)
78
                    {
79
                        items.First().STATUS = 4;
80
                        items.First().END_DATETIME = DateTime.Now;
81
                    }
82
                }
83
            }
84

  
85
            IsEndFinal = true;
86
        }
87

  
81 88
        public static void StatusChange(FinalStatus status,string ex)
82 89
        {
83 90
            using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/DrawSet_Line.cs
4 4
using System.Linq;
5 5
using System.Text;
6 6
using System.Windows;
7
using iTextSharp.text.pdf;
8 7
using System.Windows.Media;
9 8
using iTextSharp.text;
10 9

  
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs
596 596
                    using (Stream pdfStream = new FileInfo(testFile).Open(FileMode.Open, FileAccess.ReadWrite)) //
597 597
                    {
598 598
                        StatusChange("comment Cover",0);
599
                        
600
                        PdfReader pdfReader = new PdfReader(pdfStream);
601
                        //List<Dictionary<string, object>> lstoutlineTop = new List<Dictionary<string, object>>();
602
                        Dictionary<string, object> bookmark;
603
                        List<Dictionary<string, object>> outlines;
604 599

  
605
                        outlines = new List<Dictionary<string, object>>();
606
                        List<Dictionary<string, object>> root = new List<Dictionary<string, object>>();
600
                        using (PdfReader pdfReader = new PdfReader(pdfStream))
601
                        { 
602
                            //List<Dictionary<string, object>> lstoutlineTop = new List<Dictionary<string, object>>();
603
                            Dictionary<string, object> bookmark;
604
                            List<Dictionary<string, object>> outlines;
607 605

  
608
                        var dic = new Dictionary<string, object>();
606
                            outlines = new List<Dictionary<string, object>>();
607
                            List<Dictionary<string, object>> root = new List<Dictionary<string, object>>();
609 608

  
610
                        foreach (var data in MarkupDataSet)
611
                        {
612
                            //StatusChange("MarkupDataSet", 0);
609
                            var dic = new Dictionary<string, object>();
613 610

  
614
                            string userid = data.MARKUP_INFO_VERSION.MARKUP_INFO.USER_ID;
611
                            foreach (var data in MarkupDataSet)
612
                            {
613
                                //StatusChange("MarkupDataSet", 0);
615 614

  
616
                            string username = "";
617
                            string userdept = "";
615
                                string userid = data.MARKUP_INFO_VERSION.MARKUP_INFO.USER_ID;
618 616

  
619
                            using (CIEntities cIEntities = new CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(finaldata.PROJECT_NO).ToString()))
620
                            {
621
                                var memberlist = KCOMDataModel.Common.ObjectQuery.GetMemberQuery(cIEntities, userid);
617
                                string username = "";
618
                                string userdept = "";
622 619

  
623
                                if(memberlist.Count() > 0)
620
                                using (CIEntities cIEntities = new CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(finaldata.PROJECT_NO).ToString()))
624 621
                                {
625
                                    username = memberlist.First().NAME;
626
                                    userdept = memberlist.First().DEPARTMENT;
622
                                    var memberlist = KCOMDataModel.Common.ObjectQuery.GetMemberQuery(cIEntities, userid);
623

  
624
                                    if(memberlist.Count() > 0)
625
                                    {
626
                                        username = memberlist.First().NAME;
627
                                        userdept = memberlist.First().DEPARTMENT;
628
                                    }
627 629
                                }
628
                            }
629 630

  
630
                            bookmark = new Dictionary<string, object>();
631
                            bookmark.Add("Title", string.Format("User:{0}[{1}] Commented Page : {2}", username, userdept, data.PAGENUMBER));
632
                            bookmark.Add("Page", data.PAGENUMBER + " Fit");
633
                            bookmark.Add("Action", "GoTo");
634
                            bookmark.Add("Kids", outlines);
635
                            root.Add(bookmark);
636
                        }
631
                                bookmark = new Dictionary<string, object>();
632
                                bookmark.Add("Title", string.Format("User:{0}[{1}] Commented Page : {2}", username, userdept, data.PAGENUMBER));
633
                                bookmark.Add("Page", data.PAGENUMBER + " Fit");
634
                                bookmark.Add("Action", "GoTo");
635
                                bookmark.Add("Kids", outlines);
636
                                root.Add(bookmark);
637
                            }
637 638

  
638 639

  
639
                        using (PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(pdfFilePath, FileMode.Create)))
640
                        {
641
                            try
640
                            using (PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(pdfFilePath, FileMode.Create)))
642 641
                            {
643
                                if (pdfStamper.AcroFields != null && pdfStamper.AcroFields.GenerateAppearances != true)
642
                                try
644 643
                                {
645
                                    pdfStamper.AcroFields.GenerateAppearances = true;
644
                                    if (pdfStamper.AcroFields != null && pdfStamper.AcroFields.GenerateAppearances != true)
645
                                    {
646
                                        pdfStamper.AcroFields.GenerateAppearances = true;
647
                                    }
648
                                }
649
                                catch (Exception ex)
650
                                {
651
                                    SetNotice(FinalItem.ID, "this pdf is not AcroForm.");
646 652
                                }
647
                            }
648
                            catch (Exception ex)
649
                            {
650
                                SetNotice(FinalItem.ID, "this pdf is not AcroForm.");
651
                            }
652 653

  
653
                            var _SetColor = new SolidColorBrush(Colors.Red);
654
                                var _SetColor = new SolidColorBrush(Colors.Red);
654 655

  
655
                            string[] delimiterChars = { "|DZ|" };
656
                            string[] delimiterChars2 = { "|" };
656
                                string[] delimiterChars = { "|DZ|" };
657
                                string[] delimiterChars2 = { "|" };
657 658

  
658
                            //pdfStamper.FormFlattening = true; //이미 선처리 작업함
659
                            pdfStamper.SetFullCompression();
660
                            _SetColor = new SolidColorBrush(Colors.Red);
659
                                //pdfStamper.FormFlattening = true; //이미 선처리 작업함
660
                                pdfStamper.SetFullCompression();
661
                                _SetColor = new SolidColorBrush(Colors.Red);
661 662

  
662
                            StringBuilder strLog = new StringBuilder();
663
                            int lastPageNo = 0;
663
                                StringBuilder strLog = new StringBuilder();
664
                                int lastPageNo = 0;
664 665

  
665
                            strLog.Append($"Write {DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")} markup Count : {MarkupDataSet.Count()} / ");
666
                                strLog.Append($"Write {DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")} markup Count : {MarkupDataSet.Count()} / ");
666 667

  
667
                            foreach (var markupItem in MarkupDataSet)
668
                            {
669
                                /// 2020.11.13 김태성
670
                                /// 원본 PDF의 페이지수가 변경된 경우 이전 markup의 페이지를 찾지 못해 수정함.
671
                                var pageitems = DocPageItem.Where(d => d.PAGE_NUMBER == markupItem.PAGENUMBER);
672

  
673
                                if(pageitems.Count() > 0)
668
                                foreach (var markupItem in MarkupDataSet)
674 669
                                {
675
                                    var currentPage = pageitems.First();
676
                                    pdfSize = pdfReader.GetPageSizeWithRotation(markupItem.PAGENUMBER);
677
                                    lastPageNo = markupItem.PAGENUMBER;
678
                                    //try
679
                                    //{
680

  
681
                                    //}
682
                                    //catch (Exception ex)
683
                                    //{
684
                                    //    SetNotice(finaldata.ID, $"GetPageSizeWithRotation Error PageNO : {markupItem.PAGENUMBER} " + ex.ToString());
685
                                    //}
686
                                    //finally
687
                                    //{
688
                                    //    pdfSize = new iTextSharp.text.Rectangle(0, 0, float.Parse(currentPage.PAGE_WIDTH), float.Parse(currentPage.PAGE_HEIGHT));
689
                                    //}
690

  
691
                                    mediaBox = pdfReader.GetPageSize(markupItem.PAGENUMBER);
692
                                    var cropBox = pdfReader.GetCropBox(markupItem.PAGENUMBER);
693

  
694
                                    /// media box와 crop box가 다를 경우 media box를 crop box와 일치시킨다
695
                                    if (cropBox != null &&
696
                                        (cropBox.Left != mediaBox.Left || cropBox.Top != mediaBox.Top || cropBox.Right != mediaBox.Right || cropBox.Bottom != mediaBox.Bottom))
697
                                    {
698
                                        PdfDictionary dict = pdfReader.GetPageN(markupItem.PAGENUMBER);
670
                                    /// 2020.11.13 김태성
671
                                    /// 원본 PDF의 페이지수가 변경된 경우 이전 markup의 페이지를 찾지 못해 수정함.
672
                                    var pageitems = DocPageItem.Where(d => d.PAGE_NUMBER == markupItem.PAGENUMBER);
699 673

  
700
                                        PdfArray oNewMediaBox = new PdfArray();
701
                                        oNewMediaBox.Add(new PdfNumber(cropBox.Left));
702
                                        oNewMediaBox.Add(new PdfNumber(cropBox.Top));
703
                                        oNewMediaBox.Add(new PdfNumber(cropBox.Right));
704
                                        oNewMediaBox.Add(new PdfNumber(cropBox.Bottom));
705
                                        dict.Put(PdfName.MEDIABOX, oNewMediaBox);
674
                                    if (pageitems.Count() > 0)
675
                                    {
676
                                        var currentPage = pageitems.First();
677
                                        pdfSize = pdfReader.GetPageSizeWithRotation(markupItem.PAGENUMBER);
678
                                        lastPageNo = markupItem.PAGENUMBER;
679
                                        //try
680
                                        //{
681

  
682
                                        //}
683
                                        //catch (Exception ex)
684
                                        //{
685
                                        //    SetNotice(finaldata.ID, $"GetPageSizeWithRotation Error PageNO : {markupItem.PAGENUMBER} " + ex.ToString());
686
                                        //}
687
                                        //finally
688
                                        //{
689
                                        //    pdfSize = new iTextSharp.text.Rectangle(0, 0, float.Parse(currentPage.PAGE_WIDTH), float.Parse(currentPage.PAGE_HEIGHT));
690
                                        //}
691

  
692
                                        mediaBox = pdfReader.GetPageSize(markupItem.PAGENUMBER);
693
                                        var cropBox = pdfReader.GetCropBox(markupItem.PAGENUMBER);
694

  
695
                                        /// media box와 crop box가 다를 경우 media box를 crop box와 일치시킨다
696
                                        if (cropBox != null &&
697
                                            (cropBox.Left != mediaBox.Left || cropBox.Top != mediaBox.Top || cropBox.Right != mediaBox.Right || cropBox.Bottom != mediaBox.Bottom))
698
                                        {
699
                                            PdfDictionary dict = pdfReader.GetPageN(markupItem.PAGENUMBER);
706 700

  
707
                                        pdfSize = cropBox;
708
                                    }
701
                                            PdfArray oNewMediaBox = new PdfArray();
702
                                            oNewMediaBox.Add(new PdfNumber(cropBox.Left));
703
                                            oNewMediaBox.Add(new PdfNumber(cropBox.Top));
704
                                            oNewMediaBox.Add(new PdfNumber(cropBox.Right));
705
                                            oNewMediaBox.Add(new PdfNumber(cropBox.Bottom));
706
                                            dict.Put(PdfName.MEDIABOX, oNewMediaBox);
709 707

  
710
                                    scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width;
711
                                    scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height;
708
                                            pdfSize = cropBox;
709
                                        }
712 710

  
713
                                    pdfLink.CURRENT_PAGE = markupItem.PAGENUMBER;
714
                                    _entity.SaveChanges();
711
                                        scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width;
712
                                        scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height;
715 713

  
716
                                    string[] markedData = markupItem.DATA.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
714
                                        pdfLink.CURRENT_PAGE = markupItem.PAGENUMBER;
715
                                        _entity.SaveChanges();
717 716

  
718
                                    PdfContentByte contentByte = pdfStamper.GetOverContent(markupItem.PAGENUMBER);
719
                                    strLog.Append($"{markupItem.PAGENUMBER}/");
717
                                        string[] markedData = markupItem.DATA.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
720 718

  
721
                                    foreach (var data in markedData)
722
                                    {
723
                                        var item = JsonSerializerHelper.UnCompressString(data);
724
                                        var ControlT = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item);
719
                                        PdfContentByte contentByte = pdfStamper.GetOverContent(markupItem.PAGENUMBER);
720
                                        strLog.Append($"{markupItem.PAGENUMBER}/");
725 721

  
726
                                        try
722
                                        foreach (var data in markedData)
727 723
                                        {
728
                                            switch (ControlT.Name)
724
                                            var item = JsonSerializerHelper.UnCompressString(data);
725
                                            var ControlT = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item);
726

  
727
                                            try
729 728
                                            {
730
                                                #region LINE
731
                                                case "LineControl":
732
                                                    {
733
                                                        using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
729
                                                switch (ControlT.Name)
730
                                                {
731
                                                    #region LINE
732
                                                    case "LineControl":
734 733
                                                        {
735
                                                            DrawLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
734
                                                            using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
735
                                                            {
736
                                                                DrawLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
737
                                                            }
736 738
                                                        }
737
                                                    }
738
                                                    break;
739
                                                #endregion
740
                                                #region ArrowControlMulti
741
                                                case "ArrowControl_Multi":
742
                                                    {
743
                                                        using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
739
                                                        break;
740
                                                    #endregion
741
                                                    #region ArrowControlMulti
742
                                                    case "ArrowControl_Multi":
744 743
                                                        {
745
                                                            DrawMultiArrowLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
744
                                                            using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
745
                                                            {
746
                                                                DrawMultiArrowLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
747
                                                            }
746 748
                                                        }
747
                                                    }
748
                                                    break;
749
                                                #endregion
750
                                                #region PolyControl
751
                                                case "PolygonControl":
752
                                                    using (S_PolyControl control = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
753
                                                    {
754
                                                        string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
755
                                                        Point StartPoint = GetPdfPointSystem(control.StartPoint);
756
                                                        Point EndPoint = GetPdfPointSystem(control.EndPoint);
757
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
758
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
759
                                                        double Opacity = control.Opac;
760
                                                        DoubleCollection DashSize = control.DashSize;
761

  
762
                                                        Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
763
                                                    }
764
                                                    break;
765
                                                #endregion
766
                                                #region ArcControl or ArrowArcControl
767
                                                case "ArcControl":
768
                                                case "ArrowArcControl":
769
                                                    {
770
                                                        using (S_ArcControl control = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
749
                                                        break;
750
                                                    #endregion
751
                                                    #region PolyControl
752
                                                    case "PolygonControl":
753
                                                        using (S_PolyControl control = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
771 754
                                                        {
772 755
                                                            string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
773 756
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
774 757
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
775
                                                            Point MidPoint = GetPdfPointSystem(control.MidPoint);
776
                                                            DoubleCollection DashSize = control.DashSize;
777 758
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
778

  
779
                                                            var Opacity = control.Opac;
780
                                                            string UserID = control.UserID;
781 759
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
782
                                                            bool IsTransOn = control.IsTransOn;
760
                                                            double Opacity = control.Opac;
761
                                                            DoubleCollection DashSize = control.DashSize;
783 762

  
784
                                                            if (control.IsTransOn)
785
                                                            {
786
                                                                Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
787
                                                                Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
788
                                                            }
789
                                                            else
763
                                                            Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
764
                                                        }
765
                                                        break;
766
                                                    #endregion
767
                                                    #region ArcControl or ArrowArcControl
768
                                                    case "ArcControl":
769
                                                    case "ArrowArcControl":
770
                                                        {
771
                                                            using (S_ArcControl control = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
790 772
                                                            {
791
                                                                Controls_PDF.DrawSet_Arc.DrawArc(StartPoint, MidPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity);
792
                                                            }
773
                                                                string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
774
                                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
775
                                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
776
                                                                Point MidPoint = GetPdfPointSystem(control.MidPoint);
777
                                                                DoubleCollection DashSize = control.DashSize;
778
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
779

  
780
                                                                var Opacity = control.Opac;
781
                                                                string UserID = control.UserID;
782
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
783
                                                                bool IsTransOn = control.IsTransOn;
784

  
785
                                                                if (control.IsTransOn)
786
                                                                {
787
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
788
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
789
                                                                }
790
                                                                else
791
                                                                {
792
                                                                    Controls_PDF.DrawSet_Arc.DrawArc(StartPoint, MidPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity);
793
                                                                }
793 794

  
794
                                                            if (ControlT.Name == "ArrowArcControl")
795
                                                            {
796
                                                                Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
797
                                                                Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
795
                                                                if (ControlT.Name == "ArrowArcControl")
796
                                                                {
797
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
798
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
799
                                                                }
798 800
                                                            }
799 801
                                                        }
800
                                                    }
801
                                                    break;
802
                                                #endregion
803
                                                #region RectangleControl
804
                                                case "RectangleControl":
805
                                                    using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
806
                                                    {
807
                                                        string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
808
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
809
                                                        var PaintStyle = control.PaintState;
810
                                                        double Angle = control.Angle;
811
                                                        DoubleCollection DashSize = control.DashSize;
812
                                                        double Opacity = control.Opac;
813
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
814

  
815
                                                        Controls_PDF.DrawSet_Shape.DrawRectangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
816
                                                    }
817
                                                    break;
818
                                                #endregion
819
                                                #region TriControl
820
                                                case "TriControl":
821
                                                    using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
822
                                                    {
823
                                                        string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
824
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
825
                                                        var PaintStyle = control.Paint;
826
                                                        double Angle = control.Angle;
827
                                                        //StrokeColor = _SetColor, //색상은 레드
828
                                                        DoubleCollection DashSize = control.DashSize;
829
                                                        double Opacity = control.Opac;
830
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
831

  
832
                                                        Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
833
                                                    }
834
                                                    break;
835
                                                #endregion
836
                                                #region CircleControl
837
                                                case "CircleControl":
838
                                                    using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
839
                                                    {
840
                                                        string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
841
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
842
                                                        var StartPoint = GetPdfPointSystem(control.StartPoint);
843
                                                        var EndPoint = GetPdfPointSystem(control.EndPoint);
844
                                                        var PaintStyle = control.PaintState;
845
                                                        double Angle = control.Angle;
846
                                                        DoubleCollection DashSize = control.DashSize;
847
                                                        double Opacity = control.Opac;
848
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
849
                                                        Controls_PDF.DrawSet_Shape.DrawCircle(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity, Angle, PointSet);
850

  
851
                                                    }
852
                                                    break;
853
                                                #endregion
854
                                                #region RectCloudControl
855
                                                case "RectCloudControl":
856
                                                    using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
857
                                                    {
858
                                                        string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
859
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
860
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
861
                                                        double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
862

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

  
865
                                                        var PaintStyle = control.PaintState;
866
                                                        double Opacity = control.Opac;
867
                                                        DoubleCollection DashSize = control.DashSize;
868

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

  
872
                                                        double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
873
                                                        bool reverse = (area < 0);
874
                                                        if (PaintStyle == PaintSet.None)
802
                                                        break;
803
                                                    #endregion
804
                                                    #region RectangleControl
805
                                                    case "RectangleControl":
806
                                                        using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
875 807
                                                        {
876
                                                            Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
808
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
809
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
810
                                                            var PaintStyle = control.PaintState;
811
                                                            double Angle = control.Angle;
812
                                                            DoubleCollection DashSize = control.DashSize;
813
                                                            double Opacity = control.Opac;
814
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
815

  
816
                                                            Controls_PDF.DrawSet_Shape.DrawRectangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
877 817
                                                        }
878
                                                        else
818
                                                        break;
819
                                                    #endregion
820
                                                    #region TriControl
821
                                                    case "TriControl":
822
                                                        using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
879 823
                                                        {
880
                                                            Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
824
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
825
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
826
                                                            var PaintStyle = control.Paint;
827
                                                            double Angle = control.Angle;
828
                                                            //StrokeColor = _SetColor, //색상은 레드
829
                                                            DoubleCollection DashSize = control.DashSize;
830
                                                            double Opacity = control.Opac;
831
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
832

  
833
                                                            Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
881 834
                                                        }
882
                                                    }
883
                                                    break;
884
                                                #endregion
885
                                                #region CloudControl
886
                                                case "CloudControl":
887
                                                    using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
888
                                                    {
889
                                                        string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
890
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
891
                                                        double Toler = control.Toler;
892
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
893
                                                        double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
894
                                                        var PaintStyle = control.PaintState;
895
                                                        double Opacity = control.Opac;
896
                                                        bool isTransOn = control.IsTrans;
897
                                                        bool isChain = control.IsChain;
898

  
899
                                                        DoubleCollection DashSize = control.DashSize;
900

  
901
                                                        if (isChain)
835
                                                        break;
836
                                                    #endregion
837
                                                    #region CircleControl
838
                                                    case "CircleControl":
839
                                                        using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
902 840
                                                        {
903
                                                            Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
841
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
842
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
843
                                                            var StartPoint = GetPdfPointSystem(control.StartPoint);
844
                                                            var EndPoint = GetPdfPointSystem(control.EndPoint);
845
                                                            var PaintStyle = control.PaintState;
846
                                                            double Angle = control.Angle;
847
                                                            DoubleCollection DashSize = control.DashSize;
848
                                                            double Opacity = control.Opac;
849
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
850
                                                            Controls_PDF.DrawSet_Shape.DrawCircle(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity, Angle, PointSet);
851

  
904 852
                                                        }
905
                                                        else
853
                                                        break;
854
                                                    #endregion
855
                                                    #region RectCloudControl
856
                                                    case "RectCloudControl":
857
                                                        using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
906 858
                                                        {
907
                                                            if (isTransOn)
908
                                                            {
909
                                                                double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
910
                                                                bool reverse = (area < 0);
859
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
860
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
861
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
862
                                                            double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
911 863

  
912
                                                                if (PaintStyle == PaintSet.None)
913
                                                                {
914
                                                                    Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
915
                                                                }
916
                                                                else
917
                                                                {
918
                                                                    Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
919
                                                                }
864
                                                            double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
865

  
866
                                                            var PaintStyle = control.PaintState;
867
                                                            double Opacity = control.Opac;
868
                                                            DoubleCollection DashSize = control.DashSize;
869

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

  
873
                                                            double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
874
                                                            bool reverse = (area < 0);
875
                                                            if (PaintStyle == PaintSet.None)
876
                                                            {
877
                                                                Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
920 878
                                                            }
921 879
                                                            else
922 880
                                                            {
923
                                                                Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, control.DashSize, _SetColor, PaintStyle, Opacity);
881
                                                                Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
924 882
                                                            }
925 883
                                                        }
926
                                                    }
927
                                                    break;
928
                                                #endregion
929
                                                #region TEXT
930
                                                case "TextControl":
931
                                                    using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
932
                                                    {
933
                                                        DrawTextBox(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
934
                                                    }
935
                                                    break;
936
                                                #endregion
937
                                                #region ArrowTextControl
938
                                                case "ArrowTextControl":
939
                                                    using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
940
                                                    {
941
                                                        //using (S_TextControl textcontrol = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
942
                                                        //{
943
                                                        //    textcontrol.Angle = control.Angle;
944
                                                        //    textcontrol.BoxH = control.BoxHeight;
945
                                                        //    textcontrol.BoxW = control.BoxWidth;
946
                                                        //    textcontrol.EndPoint = control.EndPoint;
947
                                                        //    textcontrol.FontColor = "#FFFF0000";
948
                                                        //    textcontrol.Name = "TextControl";
949
                                                        //    textcontrol.Opac = control.Opac;
950
                                                        //    textcontrol.PointSet = new List<Point>();
951
                                                        //    textcontrol.SizeSet = string.Join(delimiterChars2.First(), control.SizeSet.First(), control.fontConfig[3]);
952
                                                        //    textcontrol.StartPoint = control.StartPoint;
953
                                                        //    textcontrol.Text = control.ArrowText;
954
                                                        //    textcontrol.TransformPoint = control.TransformPoint;
955
                                                        //    textcontrol.UserID = null;
956
                                                        //    textcontrol.fontConfig = control.fontConfig;
957
                                                        //    textcontrol.isHighLight = control.isHighLight;
958
                                                        //    textcontrol.paintMethod = 1;
959

  
960
                                                        //    DrawTextBox(textcontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
961
                                                        //}
962

  
963
                                                        //using (S_ArrowControl_Multi linecontrol = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
964
                                                        //{
965
                                                        //    linecontrol.Angle = control.Angle;
966
                                                        //    linecontrol.DashSize = new DoubleCollection(new[] {(double)999999 });
967
                                                        //    linecontrol.EndPoint = control.EndPoint;
968
                                                        //    linecontrol.MidPoint = control.MidPoint;
969
                                                        //    linecontrol.Name = "ArrowControl_Multi";
970
                                                        //    linecontrol.Opac = control.Opac;
971
                                                        //    linecontrol.PointSet = control.PointSet;
972
                                                        //    linecontrol.SizeSet = control.SizeSet;
973
                                                        //    linecontrol.StartPoint = control.StartPoint;
974
                                                        //    linecontrol.StrokeColor = control.StrokeColor;
975
                                                        //    linecontrol.TransformPoint = control.TransformPoint;
976

  
977
                                                        //    DrawMultiArrowLine(linecontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
978
                                                        //}
979
                                                        string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
980
                                                        Point tempStartPoint = GetPdfPointSystem(control.StartPoint);
981
                                                        Point tempMidPoint = GetPdfPointSystem(control.MidPoint);
982
                                                        Point tempEndPoint = GetPdfPointSystem(control.EndPoint);
983
                                                        bool isUnderLine = false;
984
                                                        string Text = "";
985
                                                        double fontsize = 30;
986

  
987
                                                        System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight);
988
                                                        Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight));
989
                                                        List<Point> tempPoint = new List<Point>();
990

  
991
                                                        double Angle = control.Angle;
992

  
993
                                                        if (Math.Abs(Angle).ToString() == "90")
994
                                                        {
995
                                                            Angle = 270;
996
                                                        }
997
                                                        else if (Math.Abs(Angle).ToString() == "270")
884
                                                        break;
885
                                                    #endregion
886
                                                    #region CloudControl
887
                                                    case "CloudControl":
888
                                                        using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
998 889
                                                        {
999
                                                            Angle = 90;
1000
                                                        }
890
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
891
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
892
                                                            double Toler = control.Toler;
893
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
894
                                                            double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
895
                                                            var PaintStyle = control.PaintState;
896
                                                            double Opacity = control.Opac;
897
                                                            bool isTransOn = control.IsTrans;
898
                                                            bool isChain = control.IsChain;
1001 899

  
1002
                                                        var tempRectMidPoint = MathSet.getRectMiddlePoint(rect);
1003
                                                        tempPoint.Add(new Point(rect.Left, tempRectMidPoint.Y));
1004
                                                        tempPoint.Add(new Point(tempRectMidPoint.X, rect.Top));
1005
                                                        tempPoint.Add(new Point(rect.Right, tempRectMidPoint.Y));
1006
                                                        tempPoint.Add(new Point(tempRectMidPoint.X, rect.Bottom));
1007

  
1008
                                                        var newStartPoint = tempStartPoint;
1009
                                                        var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
1010
                                                        var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
1011

  
1012
                                                        //Point testPoint = tempEndPoint;
1013
                                                        //if (Angle != 0)
1014
                                                        //{
1015
                                                        //    testPoint = GetArrowTextControlTestPoint(0, newMidPoint, tempPoint, control.isFixed);
1016
                                                        //   //testPoint = Test(rect, newMidPoint);
1017
                                                        //}
1018

  
1019
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1020
                                                        SolidColorBrush FontColor = _SetColor;
1021
                                                        bool isHighlight = control.isHighLight;
1022
                                                        double Opacity = control.Opac;
1023
                                                        PaintSet Paint = PaintSet.None;
1024

  
1025
                                                        switch (control.ArrowStyle)
1026
                                                        {
1027
                                                            case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal:
1028
                                                                {
1029
                                                                    Paint = PaintSet.None;
1030
                                                                }
1031
                                                                break;
1032
                                                            case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud:
900
                                                            DoubleCollection DashSize = control.DashSize;
901

  
902
                                                            if (isChain)
903
                                                            {
904
                                                                Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
905
                                                            }
906
                                                            else
907
                                                            {
908
                                                                if (isTransOn)
1033 909
                                                                {
1034
                                                                    Paint = PaintSet.Hatch;
910
                                                                    double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
911
                                                                    bool reverse = (area < 0);
912

  
913
                                                                    if (PaintStyle == PaintSet.None)
914
                                                                    {
915
                                                                        Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
916
                                                                    }
917
                                                                    else
918
                                                                    {
919
                                                                        Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
920
                                                                    }
1035 921
                                                                }
1036
                                                                break;
1037
                                                            case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect:
922
                                                                else
1038 923
                                                                {
1039
                                                                    Paint = PaintSet.Fill;
924
                                                                    Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, control.DashSize, _SetColor, PaintStyle, Opacity);
1040 925
                                                                }
1041
                                                                break;
1042
                                                            default:
1043
                                                                break;
1044
                                                        }
1045
                                                        if (control.isHighLight) Paint |= PaintSet.Highlight;
1046

  
1047
                                                        if (Paint == PaintSet.Hatch)
1048
                                                        {
1049
                                                            Text = control.ArrowText;
926
                                                            }
1050 927
                                                        }
1051
                                                        else
928
                                                        break;
929
                                                    #endregion
930
                                                    #region TEXT
931
                                                    case "TextControl":
932
                                                        using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
1052 933
                                                        {
1053
                                                            Text = control.ArrowText;
934
                                                            DrawTextBox(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
1054 935
                                                        }
1055

  
1056
                                                        try
936
                                                        break;
937
                                                    #endregion
938
                                                    #region ArrowTextControl
939
                                                    case "ArrowTextControl":
940
                                                        using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
1057 941
                                                        {
1058
                                                            if (control.fontConfig.Count == 4)
942
                                                            //using (S_TextControl textcontrol = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
943
                                                            //{
944
                                                            //    textcontrol.Angle = control.Angle;
945
                                                            //    textcontrol.BoxH = control.BoxHeight;
946
                                                            //    textcontrol.BoxW = control.BoxWidth;
947
                                                            //    textcontrol.EndPoint = control.EndPoint;
948
                                                            //    textcontrol.FontColor = "#FFFF0000";
949
                                                            //    textcontrol.Name = "TextControl";
950
                                                            //    textcontrol.Opac = control.Opac;
951
                                                            //    textcontrol.PointSet = new List<Point>();
952
                                                            //    textcontrol.SizeSet = string.Join(delimiterChars2.First(), control.SizeSet.First(), control.fontConfig[3]);
953
                                                            //    textcontrol.StartPoint = control.StartPoint;
954
                                                            //    textcontrol.Text = control.ArrowText;
955
                                                            //    textcontrol.TransformPoint = control.TransformPoint;
956
                                                            //    textcontrol.UserID = null;
957
                                                            //    textcontrol.fontConfig = control.fontConfig;
958
                                                            //    textcontrol.isHighLight = control.isHighLight;
959
                                                            //    textcontrol.paintMethod = 1;
960

  
961
                                                            //    DrawTextBox(textcontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
962
                                                            //}
963

  
964
                                                            //using (S_ArrowControl_Multi linecontrol = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
965
                                                            //{
966
                                                            //    linecontrol.Angle = control.Angle;
967
                                                            //    linecontrol.DashSize = new DoubleCollection(new[] {(double)999999 });
968
                                                            //    linecontrol.EndPoint = control.EndPoint;
969
                                                            //    linecontrol.MidPoint = control.MidPoint;
970
                                                            //    linecontrol.Name = "ArrowControl_Multi";
971
                                                            //    linecontrol.Opac = control.Opac;
972
                                                            //    linecontrol.PointSet = control.PointSet;
973
                                                            //    linecontrol.SizeSet = control.SizeSet;
974
                                                            //    linecontrol.StartPoint = control.StartPoint;
975
                                                            //    linecontrol.StrokeColor = control.StrokeColor;
976
                                                            //    linecontrol.TransformPoint = control.TransformPoint;
977

  
978
                                                            //    DrawMultiArrowLine(linecontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
979
                                                            //}
980
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
981
                                                            Point tempStartPoint = GetPdfPointSystem(control.StartPoint);
982
                                                            Point tempMidPoint = GetPdfPointSystem(control.MidPoint);
983
                                                            Point tempEndPoint = GetPdfPointSystem(control.EndPoint);
984
                                                            bool isUnderLine = false;
985
                                                            string Text = "";
986
                                                            double fontsize = 30;
987

  
988
                                                            System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight);
989
                                                            Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight));
990
                                                            List<Point> tempPoint = new List<Point>();
991

  
992
                                                            double Angle = control.Angle;
993

  
994
                                                            if (Math.Abs(Angle).ToString() == "90")
1059 995
                                                            {
1060
                                                                fontsize = Convert.ToDouble(control.fontConfig[3]);
996
                                                                Angle = 270;
1061 997
                                                            }
1062

  
1063
                                                            //강인구 수정(2018.04.17)
1064
                                                            var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
1065

  
1066
                                                            FontStyle fontStyle = FontStyles.Normal;
1067
                                                            if (FontStyles.Italic == TextStyle)
998
                                                            else if (Math.Abs(Angle).ToString() == "270")
1068 999
                                                            {
1069
                                                                fontStyle = FontStyles.Italic;
1000
                                                                Angle = 90;
1070 1001
                                                            }
1071 1002

  
1072
                                                            FontWeight fontWeight = FontWeights.Black;
1073

  
1074
                                                            var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
1075
                                                            if (FontWeights.Bold == TextWeight)
1003
                                                            var tempRectMidPoint = MathSet.getRectMiddlePoint(rect);
1004
                                                            tempPoint.Add(new Point(rect.Left, tempRectMidPoint.Y));
1005
                                                            tempPoint.Add(new Point(tempRectMidPoint.X, rect.Top));
1006
                                                            tempPoint.Add(new Point(rect.Right, tempRectMidPoint.Y));
1007
                                                            tempPoint.Add(new Point(tempRectMidPoint.X, rect.Bottom));
1008

  
1009
                                                            var newStartPoint = tempStartPoint;
1010
                                                            var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
1011
                                                            var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
1012

  
1013
                                                            //Point testPoint = tempEndPoint;
1014
                                                            //if (Angle != 0)
1015
                                                            //{
1016
                                                            //    testPoint = GetArrowTextControlTestPoint(0, newMidPoint, tempPoint, control.isFixed);
1017
                                                            //   //testPoint = Test(rect, newMidPoint);
1018
                                                            //}
1019

  
1020
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1021
                                                            SolidColorBrush FontColor = _SetColor;
1022
                                                            bool isHighlight = control.isHighLight;
1023
                                                            double Opacity = control.Opac;
1024
                                                            PaintSet Paint = PaintSet.None;
1025

  
1026
                                                            switch (control.ArrowStyle)
1076 1027
                                                            {
1077
                                                                fontWeight = FontWeights.Bold;
1028
                                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal:
1029
                                                                    {
1030
                                                                        Paint = PaintSet.None;
1031
                                                                    }
1032
                                                                    break;
1033
                                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud:
1034
                                                                    {
1035
                                                                        Paint = PaintSet.Hatch;
1036
                                                                    }
1037
                                                                    break;
1038
                                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect:
1039
                                                                    {
1040
                                                                        Paint = PaintSet.Fill;
1041
                                                                    }
1042
                                                                    break;
1043
                                                                default:
1044
                                                                    break;
1078 1045
                                                            }
1046
                                                            if (control.isHighLight) Paint |= PaintSet.Highlight;
1079 1047

  
1080
                                                            TextDecorationCollection decoration = TextDecorations.Baseline;
1081
                                                            if (control.fontConfig.Count() == 5)
1048
                                                            if (Paint == PaintSet.Hatch)
1082 1049
                                                            {
1083
                                                                decoration = TextDecorations.Underline;
1050
                                                                Text = control.ArrowText;
1084 1051
                                                            }
1085

  
1086
                                                            if (control.isTrans)
1052
                                                            else
1087 1053
                                                            {
1088
                                                                //인구 수정 Arrow Text Style적용 되도록 변경
1089
                                                                Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1090
                                                                newStartPoint, tempMidPoint, newEndPoint, control.isFixed,
1091
                                                                LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1054
                                                                Text = control.ArrowText;
1092 1055
                                                            }
1093
                                                            else
1056

  
1057
                                                            try
1094 1058
                                                            {
1095
                                                                if (control.isFixed)
1059
                                                                if (control.fontConfig.Count == 4)
1060
                                                                {
1061
                                                                    fontsize = Convert.ToDouble(control.fontConfig[3]);
1062
                                                                }
1063

  
1064
                                                                //강인구 수정(2018.04.17)
1065
                                                                var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
1066

  
1067
                                                                FontStyle fontStyle = FontStyles.Normal;
1068
                                                                if (FontStyles.Italic == TextStyle)
1069
                                                                {
1070
                                                                    fontStyle = FontStyles.Italic;
1071
                                                                }
1072

  
1073
                                                                FontWeight fontWeight = FontWeights.Black;
1074

  
1075
                                                                var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
1076
                                                                if (FontWeights.Bold == TextWeight)
1077
                                                                {
1078
                                                                    fontWeight = FontWeights.Bold;
1079
                                                                }
1080

  
1081
                                                                TextDecorationCollection decoration = TextDecorations.Baseline;
1082
                                                                if (control.fontConfig.Count() == 5)
1083
                                                                {
1084
                                                                    decoration = TextDecorations.Underline;
1085
                                                                }
1086

  
1087
                                                                if (control.isTrans)
1096 1088
                                                                {
1097
                                                                    var testP = new Point(0, 0);
1098
                                                                    if (control.isFixed)
1099
                                                                    {
1100
                                                                        if (tempPoint[1] == newEndPoint)
1101
                                                                        {
1102
                                                                            testP = new Point(newEndPoint.X, newEndPoint.Y - 10);
1103
                                                                        }
1104
                                                                        else if (tempPoint[3] == newEndPoint)
1105
                                                                        {
1106
                                                                            testP = new Point(newEndPoint.X, newEndPoint.Y + 10);
1107
                                                                        }
1108
                                                                        else if (tempPoint[0] == newEndPoint)
1109
                                                                        {
1110
                                                                            testP = new Point(newEndPoint.X - 10, newEndPoint.Y);
1111
                                                                        }
1112
                                                                        else if (tempPoint[2] == newEndPoint)
1113
                                                                        {
1114
                                                                            testP = new Point(newEndPoint.X + 10, newEndPoint.Y);
1115
                                                                        }
1116
                                                                    }
1117 1089
                                                                    //인구 수정 Arrow Text Style적용 되도록 변경
1118 1090
                                                                    Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1119
                                                                        tempStartPoint, testP, tempEndPoint, control.isFixed,
1120
                                                                        LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight,
1121
                                                                    FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1091
                                                                    newStartPoint, tempMidPoint, newEndPoint, control.isFixed,
1092
                                                                    LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1122 1093
                                                                }
1123 1094
                                                                else
1124 1095
                                                                {
1125
                                                                    //인구 수정 Arrow Text Style적용 되도록 변경
1126
                                                                    Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1127
                                                                        newStartPoint, tempMidPoint, tempEndPoint, control.isFixed,
1128
                                                                        LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1096
                                                                    if (control.isFixed)
1097
                                                                    {
1098
                                                                        var testP = new Point(0, 0);
1099
                                                                        if (control.isFixed)
1100
                                                                        {
1101
                                                                            if (tempPoint[1] == newEndPoint)
1102
                                                                            {
1103
                                                                                testP = new Point(newEndPoint.X, newEndPoint.Y - 10);
1104
                                                                            }
1105
                                                                            else if (tempPoint[3] == newEndPoint)
1106
                                                                            {
1107
                                                                                testP = new Point(newEndPoint.X, newEndPoint.Y + 10);
1108
                                                                            }
1109
                                                                            else if (tempPoint[0] == newEndPoint)
1110
                                                                            {
1111
                                                                                testP = new Point(newEndPoint.X - 10, newEndPoint.Y);
1112
                                                                            }
1113
                                                                            else if (tempPoint[2] == newEndPoint)
1114
                                                                            {
1115
                                                                                testP = new Point(newEndPoint.X + 10, newEndPoint.Y);
1116
                                                                            }
1117
                                                                        }
1118
                                                                        //인구 수정 Arrow Text Style적용 되도록 변경
1119
                                                                        Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1120
                                                                            tempStartPoint, testP, tempEndPoint, control.isFixed,
1121
                                                                            LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight,
1122
                                                                        FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1123
                                                                    }
1124
                                                                    else
1125
                                                                    {
1126
                                                                        //인구 수정 Arrow Text Style적용 되도록 변경
1127
                                                                        Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1128
                                                                            newStartPoint, tempMidPoint, tempEndPoint, control.isFixed,
1129
                                                                            LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1130
                                                                    }
1129 1131
                                                                }
1130 1132
                                                            }
1133
                                                            catch (Exception ex)
1134
                                                            {
1135
                                                                throw ex;
1136
                                                            }
1137

  
1131 1138
                                                        }
1132
                                                        catch (Exception ex)
1139
                                                        break;
1140
                                                    #endregion
1141
                                                    #region SignControl
1142
                                                    case "SignControl":
1143
                                                        using (S_SignControl control = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
1133 1144
                                                        {
1134
                                                            throw ex;
1145

  
1146
                                                            double Angle = control.Angle;
1147
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1148
                                                            Point TopRightPoint = GetPdfPointSystem(control.TR);
1149
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1150
                                                            Point LeftBottomPoint = GetPdfPointSystem(control.LB);
1151
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1152
                                                            double Opacity = control.Opac;
1153
                                                            string UserNumber = control.UserNumber;
1154
                                                            Controls_PDF.DrawSet_Image.DrawSign(StartPoint, EndPoint, PointSet, contentByte, UserNumber, Angle, Opacity, finaldata.PROJECT_NO);
1135 1155
                                                        }
1156
                                                        break;
1157
                                                    #endregion
1158
                                                    #region MyRegion
1159
                                                    case "DateControl":
1160
                                                        using (S_DateControl control = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
1161
                                                        {
1162
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1163
                                                            string Text = control.Text;
1164
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1165
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1166
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1167
                                                            SolidColorBrush FontColor = _SetColor;
1168
                                                            double Angle = control.Angle;
1169
                                                            double Opacity = control.Opac;
1170
                                                            Controls_PDF.PDFLib_DrawSet_Text.DrawDate(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Text, Angle, Opacity);
1171
                                                        }
1172
                                                        break;
1173
                                                    #endregion
1174
                                                    #region SymControlN (APPROVED)
1175
                                                    case "SymControlN":
1176
                                                        using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1177
                                                        {
1178
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1179
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1180
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1181
                                                            SolidColorBrush FontColor = _SetColor;
1182
                                                            double Angle = control.Angle;
1183
                                                            double Opacity = control.Opac;
1184

  
1185
                                                            var stamp = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP");
1186

  
1187
                                                            if (stamp.Count() > 0)
1188
                                                            {
1189
                                                                var xamldata = Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(stamp.First().VALUE);
1190

  
1191
                                                                Controls_PDF.PDFLib_DrawSet_Symbol.DrawApprovalXamlData(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, xamldata);
1192
                                                            }
1193

  
1194
                                                            string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", "");
1136 1195

  
1137
                                                    }
1138
                                                    break;
1139
                                                #endregion
1140
                                                #region SignControl
1141
                                                case "SignControl":
1142
                                                    using (S_SignControl control = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
1143
                                                    {
1144

  
1145
                                                        double Angle = control.Angle;
1146
                                                        Point StartPoint = GetPdfPointSystem(control.StartPoint);
1147
                                                        Point TopRightPoint = GetPdfPointSystem(control.TR);
1148
                                                        Point EndPoint = GetPdfPointSystem(control.EndPoint);
1149
                                                        Point LeftBottomPoint = GetPdfPointSystem(control.LB);
1150
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1151
                                                        double Opacity = control.Opac;
1152
                                                        string UserNumber = control.UserNumber;
1153
                                                        Controls_PDF.DrawSet_Image.DrawSign(StartPoint, EndPoint, PointSet, contentByte, UserNumber, Angle, Opacity, finaldata.PROJECT_NO);
1154
                                                    }
1155
                                                    break;
1156
                                                #endregion
1157
                                                #region MyRegion
1158
                                                case "DateControl":
1159
                                                    using (S_DateControl control = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
1160
                                                    {
1161
                                                        string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1162
                                                        string Text = control.Text;
1163
                                                        Point StartPoint = GetPdfPointSystem(control.StartPoint);
1164
                                                        Point EndPoint = GetPdfPointSystem(control.EndPoint);
1165
                                                        List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1166
                                                        SolidColorBrush FontColor = _SetColor;
1167
                                                        double Angle = control.Angle;
1168
                                                        double Opacity = control.Opac;
1169
                                                        Controls_PDF.PDFLib_DrawSet_Text.DrawDate(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Text, Angle, Opacity);
1170
                                                    }
1171
                                                    break;
1172
                                                #endregion
1173
                                                #region SymControlN (APPROVED)
1174
                                                case "SymControlN":
1175
                                                    using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1176
                                                    {
1177
                                                        Point StartPoint = GetPdfPointSystem(control.StartPoint);
1178
                                                        Point EndPoint = GetPdfPointSystem(control.EndPoint);
1179
                                                        List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1180
                                                        SolidColorBrush FontColor = _SetColor;
1181
                                                        double Angle = control.Angle;
1182
                                                        double Opacity = control.Opac;
1183

  
1184
                                                        var stamp = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP");
1185

  
1186
                                                        if (stamp.Count() > 0)
1196
                                                        }
1197
                                                        break;
1198
                                                    case "SymControl":
1199
                                                        using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1187 1200
                                                        {
1188
                                                            var xamldata = Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(stamp.First().VALUE);
1201
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1202
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1203
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1204
                                                            SolidColorBrush FontColor = _SetColor;
1205
                                                            double Angle = control.Angle;
1206
                                                            double Opacity = control.Opac;
1189 1207

  
1190
                                                            Controls_PDF.PDFLib_DrawSet_Symbol.DrawApprovalXamlData(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, xamldata);
1208
                                                            string imgpath = CommonLib.Common.GetConfigString("CheckmarkImgPath", "URL", "");
1209
                                                            Controls_PDF.PDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath);
1191 1210
                                                        }
1211
                                                        break;
1212
                                                    #endregion
1213
                                                    #region Image
1214
                                                    case "ImgControl":
1215
                                                        using (S_ImgControl control = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
1216
                                                        {
1217
                                                            double Angle = control.Angle;
1218
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1219
                                                            Point TopRightPoint = GetPdfPointSystem(control.TR);
1220
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1221
                                                            Point LeftBottomPoint = GetPdfPointSystem(control.LB);
1222
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1223
                                                            double Opacity = control.Opac;
1224
                                                            string FilePath = control.ImagePath;
1225
                                                            //Uri uri = new Uri(s.ImagePath);
1192 1226

  
1193
                                                        string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", "");
1194

  
1195
                                                    }
1196
                                                    break;
1197
                                                case "SymControl":
1198
                                                    using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1199
                                                    {
1200
                                                        Point StartPoint = GetPdfPointSystem(control.StartPoint);
1201
                                                        Point EndPoint = GetPdfPointSystem(control.EndPoint);
1202
                                                        List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1203
                                                        SolidColorBrush FontColor = _SetColor;
1204
                                                        double Angle = control.Angle;
1205
                                                        double Opacity = control.Opac;
1206

  
1207
                                                        string imgpath = CommonLib.Common.GetConfigString("CheckmarkImgPath", "URL", "");
1208
                                                        Controls_PDF.PDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath);
1209
                                                    }
1210
                                                    break;
1211
                                                #endregion
1212
                                                #region Image
1213
                                                case "ImgControl":
1214
                                                    using (S_ImgControl control = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
1215
                                                    {
1216
                                                        double Angle = control.Angle;
1217
                                                        Point StartPoint = GetPdfPointSystem(control.StartPoint);
1218
                                                        Point TopRightPoint = GetPdfPointSystem(control.TR);
1219
                                                        Point EndPoint = GetPdfPointSystem(control.EndPoint);
1220
                                                        Point LeftBottomPoint = GetPdfPointSystem(control.LB);
1221
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1222
                                                        double Opacity = control.Opac;
1223
                                                        string FilePath = control.ImagePath;
1224
                                                        //Uri uri = new Uri(s.ImagePath);
1225

  
1226
                                                        Controls_PDF.DrawSet_Image.DrawImage(StartPoint, EndPoint, PointSet, contentByte, FilePath, Angle, Opacity);
1227
                                                    }
1228
                                                    break;
1229
                                                #endregion
1230
                                                default:
1231
                                                    StatusChange($"{ControlT.Name} Not Support", 0);
1232
                                                    break;
1233
                                            }
1227
                                                            Controls_PDF.DrawSet_Image.DrawImage(StartPoint, EndPoint, PointSet, contentByte, FilePath, Angle, Opacity);
1228
                                                        }
1229
                                                        break;
1230
                                                    #endregion
1231
                                                    default:
1232
                                                        StatusChange($"{ControlT.Name} Not Support", 0);
1233
                                                        break;
1234
                                                }
1234 1235

  
1235
                                        }
1236
                                        catch (Exception ex)
1237
                                        {
1238
                                            StatusChange($"markupItem : {markupItem.ID}" + ex.ToString(), 0);
1239
                                        }
1240
                                        finally
1241
                                        {
1242
                                            if(ControlT?.Name != null)
1236
                                            }
1237
                                            catch (Exception ex)
1243 1238
                                            {
1244
                                                strLog.Append($"{ControlT.Name},");
1239
                                                StatusChange($"markupItem : {markupItem.ID}" + ex.ToString(), 0);
1240
                                            }
1241
                                            finally
1242
                                            {
1243
                                                if (ControlT?.Name != null)
1244
                                                {
1245
                                                    strLog.Append($"{ControlT.Name},");
1246
                                                }
1245 1247
                                            }
1246 1248
                                        }
1249

  
1247 1250
                                    }
1251
                                }
1248 1252

  
1253
                                if (StatusChanged != null)
1254
                                {
1255
                                    StatusChanged(this, new StatusChangedEventArgs { CurrentPage = lastPageNo, Message = strLog.ToString() });
1249 1256
                                }
1250
                            }
1257
                                //PdfFileSpecification pfs = PdfFileSpecification.FileEmbedded(pdfStamper.Writer, @"C:\Users\kts\Documents\업무\CARS\엑셀양식\F-000-5378-702_R2_계장 Cable Schedule Sample.xlsx", "F-000-5378-702_R2_계장 Cable Schedule Sample.xlsx", null);
1258
                                //pdfStamper.AddFileAttachment("F-000-5378-702_R2_계장 Cable Schedule Sample.xlsx", pfs);
1251 1259

  
1252
                            if (StatusChanged != null)
1253
                            {
1254
                                StatusChanged(this, new StatusChangedEventArgs { CurrentPage = lastPageNo, Message = strLog.ToString() });
1260
                                pdfStamper.Outlines = root;
1261
                                pdfStamper.Close();
1262
                                pdfReader.Close();
1255 1263
                            }
1256
                            //PdfFileSpecification pfs = PdfFileSpecification.FileEmbedded(pdfStamper.Writer, @"C:\Users\kts\Documents\업무\CARS\엑셀양식\F-000-5378-702_R2_계장 Cable Schedule Sample.xlsx", "F-000-5378-702_R2_계장 Cable Schedule Sample.xlsx", null);
1257
                            //pdfStamper.AddFileAttachment("F-000-5378-702_R2_계장 Cable Schedule Sample.xlsx", pfs);
1258

  
1259
                            pdfStamper.Outlines = root;
1260
                            pdfStamper.Close();
1261
                            pdfReader.Close();
1262 1264
                        }
1263 1265
                    }
1264 1266
                    #endregion
KCOM/Common/ViewerDataModel.cs
146 146
            }
147 147
        }
148 148

  
149
        private  bool isMarkupUpdate;
150

  
149 151
        private bool isDownloadOriginal;
150 152
        public bool IsDownloadOriginal
151 153
        {
......
1439 1441

  
1440 1442

  
1441 1443
        public List<IKCOM.MarkupInfoItem> SelectedmarkupInfoItems { get; set; }
1442
       
1444
        public bool IsMarkupUpdate { get => isMarkupUpdate; set => isMarkupUpdate = value; }
1445

  
1443 1446
        #region INotifyPropertyChanged Event
1444 1447

  
1445 1448
        private void OnPropertyChanged(string name)
KCOM/Events/Event_KeyEvent.cs
133 133
                            //this.dzTopMenu.SaveEvent(null, null);
134 134
                            if (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission)
135 135
                            {
136
                                ViewerDataModel.Instance.IsMarkupUpdate = true;
136 137
                                this.dzTopMenu.SaveEventCallback(new object(), null);
137 138
                            }
138 139

  
KCOM/Events/Implementation/TopMenuEvent.cs
161 161
                            break;
162 162
                    }
163 163
                }
164

  
165
                ViewerDataModel.Instance.IsMarkupUpdate = true;
164 166
            }
165 167

  
166 168
        }
......
523 525

  
524 526
                try
525 527
                {
526
                    if (ViewerDataModel.Instance.UndoDataList.Count > 0)
528
                    if (ViewerDataModel.Instance.UndoDataList.Count > 0 || ViewerDataModel.Instance.IsMarkupUpdate)
527 529
                    {
528 530
                        List<IKCOM.MarkupInfoItem> SelectedMarkupInfos = new List<IKCOM.MarkupInfoItem>();
529 531
                        foreach (var item in menu.gridViewMarkup.SelectedItems)
......
535 537
                        }
536 538

  
537 539
                        result = await SaveCommand.Instance.Execute(SelectedMarkupInfos);
540
                        ViewerDataModel.Instance.IsMarkupUpdate = false;
538 541
                    }
539 542
                    else
540 543
                    {
......
1107 1110
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Bold)
1108 1111
                                            {
1109 1112
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal;
1113
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1110 1114
                                            }
1111 1115
                                            else
1112 1116
                                            {
1113 1117
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Bold;
1118
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1114 1119
                                            }
1115 1120

  
1116 1121
                                        }
......
1120 1125
                                            if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Bold)
1121 1126
                                            {
1122 1127
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal;
1128
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1123 1129
                                            }
1124 1130
                                            else
1125 1131
                                            {
1126 1132
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Bold;
1133
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1127 1134
                                            }
1128 1135
                                        }
1129 1136
                                        break;
......
1155 1162
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic)
1156 1163
                                            {
1157 1164
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal;
1165
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1158 1166
                                            }
1159 1167
                                            else
1160 1168
                                            {
1161 1169
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic;
1170
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1162 1171
                                            }
1163 1172

  
1164 1173
                                        }
......
1168 1177
                                            if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic)
1169 1178
                                            {
1170 1179
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal;
1180
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1171 1181
                                            }
1172 1182
                                            else
1173 1183
                                            {
1174 1184
                                                (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic;
1185
                                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1175 1186
                                            }
1176 1187
                                        }
1177 1188
                                        break;
......
1223 1234
                                        }
1224 1235
                                        break;
1225 1236
                                }
1237

  
1238
                                ViewerDataModel.Instance.IsMarkupUpdate = true;
1226 1239
                            }
1227 1240
                        }
1228 1241
                    }
......
1285 1298
                {
1286 1299
                    if (item is MarkupToPDF.Controls.Text.ArrowTextControl ctrl1)
1287 1300
                    {
1301
                        ViewerDataModel.Instance.IsMarkupUpdate = true;
1288 1302
                        ctrl1.SetFontFamily(font.FontFamily);
1289 1303
                    }
1290 1304
                    else if (item is MarkupToPDF.Controls.Text.TextControl ctrl2)
1291 1305
                    {
1306
                        ViewerDataModel.Instance.IsMarkupUpdate = true;
1292 1307
                        ctrl2.SetFontFamily(font.FontFamily);
1293 1308
                    }
1294 1309
                }
KCOM/Properties/AssemblyInfo.cs
51 51
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로
52 52
// 지정되도록 할 수 있습니다.
53 53
// [assembly: AssemblyVersion("1.0.*")]
54
[assembly: AssemblyVersion("4.9.8.0")]
55
[assembly: AssemblyFileVersion("4.9.8.0")]
54
[assembly: AssemblyVersion("5.0.0.0")]
55
[assembly: AssemblyFileVersion("5.0.0.0")]
56 56
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log.config", Watch = true)]
KCOM_API/Web.config
13 13
  </configSections>
14 14
  <connectionStrings>
15 15
    <add name="ConnectionString"
16
      connectionString="metadata=res://*/DataModel.KCOM_Model.csdl|res://*/DataModel.KCOM_Model.ssdl|res://*/DataModel.KCOM_Model.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.0.67;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;App=EntityFramework&quot;"
16
      connectionString="metadata=res://*/DataModel.KCOM_Model.csdl|res://*/DataModel.KCOM_Model.ssdl|res://*/DataModel.KCOM_Model.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=cloud.devdoftech.co.kr,7777;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;App=EntityFramework&quot;"
17 17
      providerName="System.Data.EntityClient"/>
18 18
    <add name="CIConnectionString"
19
      connectionString="metadata=res://*/DataModel.CIModel.csdl|res://*/DataModel.CIModel.ssdl|res://*/DataModel.CIModel.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.0.67;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;App=EntityFramework&quot;"
19
      connectionString="metadata=res://*/DataModel.CIModel.csdl|res://*/DataModel.CIModel.ssdl|res://*/DataModel.CIModel.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=cloud.devdoftech.co.kr,7777;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;App=EntityFramework&quot;"
20 20
      providerName="System.Data.EntityClient"/>
21 21
  </connectionStrings>
22 22
  <!--
......
117 117
        <value>True</value>
118 118
      </setting>
119 119
      <setting name="FinalService" serializeAs="String">
120
        <value>tcp://localhost:9092/remFinalPDF</value>
120
        <value>tcp://localhost:9093/remFinalPDF</value>
121 121
      </setting>
122 122
    </KCOM_API.Properties.Settings>
123 123
  </applicationSettings>

내보내기 Unified diff

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