프로젝트

일반

사용자정보

개정판 86a2b958

ID86a2b95826bba47fec9078a663af855ac6ca3794
상위 50ffdad1
하위 51c6ce90

백흠경이(가) 3달 전에 추가함

Fix: FinalSerivce for DL에서 Z 정렬을 적용하도록 수정

Change-Id: I4fd2bd1f1f4697a3b15478eb29360a27e07706f3

차이점 보기:

FinalService/KCOM_FinalService_DL/MarkupToPDF/MarkupToPDF.cs
30 30
        }
31 31

  
32 32
        #region 초기 데이터
33
        private static iTextSharp.text.Rectangle mediaBox;
34 33
        private FileInfo PdfFilePath = null;
35 34
        private FileInfo FinalPDFPath = null;
36 35
        private string _FinalPDFStorgeLocal = null;
......
641 640

  
642 641
                        using (PdfReader pdfReader = new PdfReader(pdfStream))
643 642
                        { 
644
                            //List<Dictionary<string, object>> lstoutlineTop = new List<Dictionary<string, object>>();
645 643
                            Dictionary<string, object> bookmark;
646 644
                            List<Dictionary<string, object>> outlines;
647 645

  
......
702 700
                                StringBuilder strLog = new StringBuilder();
703 701
                                int lastPageNo = 0;
704 702

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

  
707
                                foreach (var markupItem in MarkupDataSet)
703
                                var groups = MarkupDataSet.GroupBy(x => x.PAGENUMBER);
704
                                foreach (var group in groups)
708 705
                                {
709
                                    /// 2020.11.13 김태성
710
                                    /// 원본 PDF의 페이지수가 변경된 경우 이전 markup의 페이지를 찾지 못해 수정함.
711
                                    var pageitems = DocPageItem.Where(d => d.PAGE_NUMBER == markupItem.PAGENUMBER);
712
                                    if (pageitems.Any())
706
                                    int PageNumber = group.Key;
707
                                    #region ZIndex 값으로 정렬한다.
708
                                    var items = new List<Tuple<string, S_BaseControl>>();
709
                                    foreach (var item in group)
713 710
                                    {
714
                                        var currentPage = pageitems.First();
715
                                        pdfSize = pdfReader.GetPageSizeWithRotation(markupItem.PAGENUMBER);
716
                                        lastPageNo = markupItem.PAGENUMBER;
717
                                        //try
718
                                        //{
719

  
720
                                        //}
721
                                        //catch (Exception ex)
722
                                        //{
723
                                        //    SetNotice(finaldata.ID, $"GetPageSizeWithRotation Error PageNO : {markupItem.PAGENUMBER} " + ex.ToString());
724
                                        //}
725
                                        //finally
726
                                        //{
727
                                        //    pdfSize = new iTextSharp.text.Rectangle(0, 0, float.Parse(currentPage.PAGE_WIDTH), float.Parse(currentPage.PAGE_HEIGHT));
728
                                        //}
729

  
730
                                        mediaBox = pdfReader.GetPageSize(markupItem.PAGENUMBER);
731
                                        var cropBox = pdfReader.GetCropBox(markupItem.PAGENUMBER);
732

  
733
                                        /// media box와 crop box가 다를 경우 media box를 crop box와 일치시킨다
734
                                        if (cropBox != null &&
735
                                            (cropBox.Left != mediaBox.Left || cropBox.Top != mediaBox.Top || cropBox.Right != mediaBox.Right || cropBox.Bottom != mediaBox.Bottom))
711
                                        var tokens = item.DATA.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries).ToList();
712
                                        items.AddRange(tokens.ConvertAll(x =>
736 713
                                        {
737
                                            PdfDictionary dict = pdfReader.GetPageN(markupItem.PAGENUMBER);
714
                                            var str = JsonSerializerHelper.UnCompressString(x);
715
                                            var control = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(str);
716
                                            return new Tuple<string, S_BaseControl>(str, control);
717
                                        }));
718
                                    }
738 719

  
739
                                            PdfArray oNewMediaBox = new PdfArray();
740
                                            oNewMediaBox.Add(new PdfNumber(cropBox.Left));
741
                                            oNewMediaBox.Add(new PdfNumber(cropBox.Top));
742
                                            oNewMediaBox.Add(new PdfNumber(cropBox.Right));
743
                                            oNewMediaBox.Add(new PdfNumber(cropBox.Bottom));
744
                                            dict.Put(PdfName.MEDIABOX, oNewMediaBox);
720
                                    var zgroups = items.GroupBy(x => x.Item2.ZIndex).OrderBy(x => x.Key);
721
                                    #endregion
745 722

  
746
                                            pdfSize = cropBox;
747
                                        }
723
                                    foreach (var zgroup in zgroups)
724
                                    {
725
                                        var ordered = zgroup.OrderBy(x => x.Item2.Index);
726
                                        foreach (var order in ordered)
727
                                        {
728
                                            /// 2020.11.13 김태성
729
                                            /// 원본 PDF의 페이지수가 변경된 경우 이전 markup의 페이지를 찾지 못해 수정함.
730
                                            var pageitems = DocPageItem.Where(d => d.PAGE_NUMBER == PageNumber);
731
                                            if (pageitems.Any())
732
                                            {
733
                                                var currentPage = pageitems.First();
734
                                                pdfSize = pdfReader.GetPageSizeWithRotation(PageNumber);
735
                                                lastPageNo = PageNumber;
748 736

  
749
                                        scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width;
750
                                        scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height;
737
                                                iTextSharp.text.Rectangle mediaBox = pdfReader.GetPageSize(PageNumber);
738
                                                var cropBox = pdfReader.GetCropBox(PageNumber);
751 739

  
752
                                        #region 현재 작업 중인 페이지를 저장
753
                                        pdfLink.CURRENT_PAGE = markupItem.PAGENUMBER;
754
                                        _entity.SaveChanges();
755
                                        #endregion
740
                                                /// media box와 crop box가 다를 경우 media box를 crop box와 일치시킨다
741
                                                if (cropBox != null &&
742
                                                    (cropBox.Left != mediaBox.Left || cropBox.Top != mediaBox.Top || cropBox.Right != mediaBox.Right || cropBox.Bottom != mediaBox.Bottom))
743
                                                {
744
                                                    PdfDictionary dict = pdfReader.GetPageN(PageNumber);
756 745

  
757
                                        string[] markedData = markupItem.DATA.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
746
                                                    PdfArray oNewMediaBox = new PdfArray();
747
                                                    oNewMediaBox.Add(new PdfNumber(cropBox.Left));
748
                                                    oNewMediaBox.Add(new PdfNumber(cropBox.Top));
749
                                                    oNewMediaBox.Add(new PdfNumber(cropBox.Right));
750
                                                    oNewMediaBox.Add(new PdfNumber(cropBox.Bottom));
751
                                                    dict.Put(PdfName.MEDIABOX, oNewMediaBox);
758 752

  
759
                                        PdfContentByte contentByte = pdfStamper.GetOverContent(markupItem.PAGENUMBER);
760
                                        //strLog.Append($"p.{markupItem.PAGENUMBER}:{markupItem.DATA_TYPE}/");
753
                                                    pdfSize = cropBox;
754
                                                }
761 755

  
762
                                        foreach (var data in markedData)
763
                                        {
764
                                            var item = JsonSerializerHelper.UnCompressString(data);
765
                                            var ControlT = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item);
756
                                                scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width;
757
                                                scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height;
766 758

  
767
                                            try
768
                                            {
769
                                                switch (ControlT.Name)
759
                                                #region 현재 작업 중인 페이지를 저장
760
                                                pdfLink.CURRENT_PAGE = PageNumber;
761
                                                _entity.SaveChanges();
762
                                                #endregion
763

  
764
                                                PdfContentByte contentByte = pdfStamper.GetOverContent(PageNumber);
765
                                                var item = order.Item1;
766
                                                var ControlT = order.Item2;
767

  
768
                                                try
770 769
                                                {
771
                                                    #region LINE
772
                                                    case "LineControl":
773
                                                        {
774
                                                            using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
770
                                                    switch (ControlT.Name)
771
                                                    {
772
                                                        #region LINE
773
                                                        case "LineControl":
775 774
                                                            {
776
                                                                DrawLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
775
                                                                using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
776
                                                                {
777
                                                                    DrawLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
778
                                                                }
777 779
                                                            }
778
                                                        }
779
                                                        break;
780
                                                    #endregion
781
                                                    #region ArrowControlMulti
782
                                                    case "ArrowControl_Multi":
783
                                                        {
784
                                                            using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
780
                                                            break;
781
                                                        #endregion
782
                                                        #region ArrowControlMulti
783
                                                        case "ArrowControl_Multi":
785 784
                                                            {
786
                                                                DrawMultiArrowLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
785
                                                                using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
786
                                                                {
787
                                                                    DrawMultiArrowLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
788
                                                                }
787 789
                                                            }
788
                                                        }
789
                                                        break;
790
                                                    #endregion
791
                                                    #region PolyControl
792
                                                    case "PolygonControl":
793
                                                        using (S_PolyControl control = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
794
                                                        {
795
                                                            string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
796
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
797
                                                            var PaintStyle = control.PaintState;
798
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
799
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
800
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
801
                                                            double Opacity = control.Opac;
802
                                                            DoubleCollection DashSize = control.DashSize;
803

  
804
                                                            Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor,PaintStyle| PaintSet.Outline, Opacity);
805
                                                            //Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
806
                                                        }
807
                                                        break;
808
                                                    #endregion
809
                                                    #region ArcControl or ArrowArcControl
810
                                                    case "ArcControl":
811
                                                    case "ArrowArcControl":
812
                                                        {
813
                                                            using (S_ArcControl control = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
790
                                                            break;
791
                                                        #endregion
792
                                                        #region PolyControl
793
                                                        case "PolygonControl":
794
                                                            using (S_PolyControl control = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
814 795
                                                            {
815 796
                                                                string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
816 797
                                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
798
                                                                var PaintStyle = control.PaintState;
817 799
                                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
818
                                                                Point MidPoint = GetPdfPointSystem(control.MidPoint);
819
                                                                DoubleCollection DashSize = control.DashSize;
820 800
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
821

  
822
                                                                var Opacity = control.Opac;
823
                                                                string UserID = control.UserID;
824 801
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
825
                                                                bool IsTransOn = control.IsTransOn;
826

  
827
                                                                if (control.IsTransOn)
828
                                                                {
829
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
830
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
831
                                                                }
832
                                                                else
833
                                                                {
834
                                                                    Controls_PDF.DrawSet_Arc.DrawArc(StartPoint, MidPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity);
835
                                                                }
802
                                                                double Opacity = control.Opac;
803
                                                                DoubleCollection DashSize = control.DashSize;
836 804

  
837
                                                                if (ControlT.Name == "ArrowArcControl")
838
                                                                {
839
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
840
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
841
                                                                }
805
                                                                Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle | PaintSet.Outline, Opacity);
806
                                                                //Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
842 807
                                                            }
843
                                                        }
844
                                                        break;
845
                                                    #endregion
846
                                                    #region RectangleControl
847
                                                    case "RectangleControl":
848
                                                        using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
849
                                                        {
850
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
851
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
852
                                                            var PaintStyle = control.PaintState;
853
                                                            double Angle = control.Angle;
854
                                                            DoubleCollection DashSize = control.DashSize;
855
                                                            double Opacity = control.Opac;
856
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
857

  
858
                                                            Controls_PDF.DrawSet_Shape.DrawRectangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
859
                                                        }
860
                                                        break;
861
                                                    #endregion
862
                                                    #region TriControl
863
                                                    case "TriControl":
864
                                                        using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
865
                                                        {
866
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
867
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
868
                                                            var PaintStyle = control.Paint;
869
                                                            double Angle = control.Angle;
870
                                                            //StrokeColor = _SetColor, //색상은 레드
871
                                                            DoubleCollection DashSize = control.DashSize;
872
                                                            double Opacity = control.Opac;
873
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
874

  
875
                                                            Controls_PDF.DrawSet_Shape.DrawTriangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle | PaintSet.Outline, Opacity);
876
                                                        }
877
                                                        break;
878
                                                    #endregion
879
                                                    #region CircleControl
880
                                                    case "CircleControl":
881
                                                        using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
882
                                                        {
883
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
884
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
885
                                                            var StartPoint = GetPdfPointSystem(control.StartPoint);
886
                                                            var EndPoint = GetPdfPointSystem(control.EndPoint);
887
                                                            var PaintStyle = control.PaintState;
888
                                                            double Angle = control.Angle;
889
                                                            DoubleCollection DashSize = control.DashSize;
890
                                                            double Opacity = control.Opac;
891
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
892
                                                            Controls_PDF.DrawSet_Shape.DrawCircle(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity, Angle, PointSet);
893

  
894
                                                        }
895
                                                        break;
896
                                                    #endregion
897
                                                    #region RectCloudControl
898
                                                    case "RectCloudControl":
899
                                                        using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
900
                                                        {
901
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
902
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
903
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
904
                                                            double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
905

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

  
908
                                                            var PaintStyle = control.PaintState;
909
                                                            double Opacity = control.Opac;
910
                                                            DoubleCollection DashSize = control.DashSize;
911

  
912
                                                            //드로잉 방식이 표현되지 않음
913
                                                            var rotate = returnAngle(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
914

  
915
                                                            double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
916
                                                            bool reverse = (area < 0);
917

  
918
                                                            Controls_PDF.DrawSet_Cloud.DrawCloudRect(PointSet, LineSize, (int)rotate, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
919

  
920
                                                            //if (DashSize?.Count() == 1 && DashSize[0] == 999999)
921
                                                            //{
922
                                                            //    Controls_PDF.DrawSet_Cloud.DrawCloudRect(PointSet, LineSize, (int)rotate, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
923
                                                            //}
924
                                                            //else
925
                                                            //{
926
                                                            //    Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
927
                                                            //}
928
                                                        }
929
                                                        break;
930
                                                    #endregion
931
                                                    #region CloudControl
932
                                                    case "CloudControl":
933
                                                        using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
934
                                                        {
935
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
936
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
937
                                                            double Toler = control.Toler;
938
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
939
                                                            double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
940
                                                            var PaintStyle = control.PaintState;
941
                                                            double Opacity = control.Opac;
942
                                                            bool isTransOn = control.IsTrans;
943
                                                            bool isChain = control.IsChain;
944

  
945
                                                            DoubleCollection DashSize = control.DashSize;
946

  
947
                                                            if (isChain)
808
                                                            break;
809
                                                        #endregion
810
                                                        #region ArcControl or ArrowArcControl
811
                                                        case "ArcControl":
812
                                                        case "ArrowArcControl":
948 813
                                                            {
949
                                                                Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
950
                                                            }
951
                                                            else
952
                                                            {
953
                                                                if (isTransOn)
814
                                                                using (S_ArcControl control = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
954 815
                                                                {
955
                                                                    double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
956
                                                                    bool reverse = (area < 0);
957

  
958
                                                                    if (PaintStyle == PaintSet.None)
816
                                                                    string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
817
                                                                    Point StartPoint = GetPdfPointSystem(control.StartPoint);
818
                                                                    Point EndPoint = GetPdfPointSystem(control.EndPoint);
819
                                                                    Point MidPoint = GetPdfPointSystem(control.MidPoint);
820
                                                                    DoubleCollection DashSize = control.DashSize;
821
                                                                    List<Point> PointSet = GetPdfPointSystem(control.PointSet);
822

  
823
                                                                    var Opacity = control.Opac;
824
                                                                    string UserID = control.UserID;
825
                                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
826
                                                                    bool IsTransOn = control.IsTransOn;
827

  
828
                                                                    if (control.IsTransOn)
959 829
                                                                    {
960
                                                                        Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
830
                                                                        Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
831
                                                                        Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
961 832
                                                                    }
962 833
                                                                    else
963 834
                                                                    {
964
                                                                        Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
835
                                                                        Controls_PDF.DrawSet_Arc.DrawArc(StartPoint, MidPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity);
836
                                                                    }
837

  
838
                                                                    if (ControlT.Name == "ArrowArcControl")
839
                                                                    {
840
                                                                        Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
841
                                                                        Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
965 842
                                                                    }
966 843
                                                                }
967
                                                                else
968
                                                                {
969
                                                                    Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, control.DashSize, _SetColor, PaintStyle, Opacity);
970
                                                                }
971 844
                                                            }
972
                                                        }
973
                                                        break;
974
                                                    #endregion
975
                                                    #region TEXT
976
                                                    case "TextControl":
977
                                                        using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
978
                                                        {
979
                                                            DrawTextBox(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
980
                                                        }
981
                                                        break;
982
                                                    #endregion
983
                                                    #region ArrowTextControl
984
                                                    case "ArrowTextControl":
985
                                                        using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
986
                                                        {
987
                                                            //using (S_TextControl textcontrol = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
988
                                                            //{
989
                                                            //    textcontrol.Angle = control.Angle;
990
                                                            //    textcontrol.BoxH = control.BoxHeight;
991
                                                            //    textcontrol.BoxW = control.BoxWidth;
992
                                                            //    textcontrol.EndPoint = control.EndPoint;
993
                                                            //    textcontrol.FontColor = "#FFFF0000";
994
                                                            //    textcontrol.Name = "TextControl";
995
                                                            //    textcontrol.Opac = control.Opac;
996
                                                            //    textcontrol.PointSet = new List<Point>();
997
                                                            //    textcontrol.SizeSet = string.Join(delimiterChars2.First(), control.SizeSet.First(), control.fontConfig[3]);
998
                                                            //    textcontrol.StartPoint = control.StartPoint;
999
                                                            //    textcontrol.Text = control.ArrowText;
1000
                                                            //    textcontrol.TransformPoint = control.TransformPoint;
1001
                                                            //    textcontrol.UserID = null;
1002
                                                            //    textcontrol.fontConfig = control.fontConfig;
1003
                                                            //    textcontrol.isHighLight = control.isHighLight;
1004
                                                            //    textcontrol.paintMethod = 1;
1005

  
1006
                                                            //    DrawTextBox(textcontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
1007
                                                            //}
1008

  
1009
                                                            //using (S_ArrowControl_Multi linecontrol = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
1010
                                                            //{
1011
                                                            //    linecontrol.Angle = control.Angle;
1012
                                                            //    linecontrol.DashSize = new DoubleCollection(new[] {(double)999999 });
1013
                                                            //    linecontrol.EndPoint = control.EndPoint;
1014
                                                            //    linecontrol.MidPoint = control.MidPoint;
1015
                                                            //    linecontrol.Name = "ArrowControl_Multi";
1016
                                                            //    linecontrol.Opac = control.Opac;
1017
                                                            //    linecontrol.PointSet = control.PointSet;
1018
                                                            //    linecontrol.SizeSet = control.SizeSet;
1019
                                                            //    linecontrol.StartPoint = control.StartPoint;
1020
                                                            //    linecontrol.StrokeColor = control.StrokeColor;
1021
                                                            //    linecontrol.TransformPoint = control.TransformPoint;
1022

  
1023
                                                            //    DrawMultiArrowLine(linecontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
1024
                                                            //}
1025
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1026
                                                            Point tempStartPoint = GetPdfPointSystem(control.StartPoint);
1027
                                                            Point tempMidPoint = GetPdfPointSystem(control.MidPoint);
1028
                                                            Point tempEndPoint = GetPdfPointSystem(control.EndPoint);
1029
                                                            bool isUnderLine = false;
1030
                                                            string Text = "";
1031
                                                            double fontsize = 30;
1032

  
1033
                                                            System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight);
1034
                                                            Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight));
1035
                                                            List<Point> tempPoint = new List<Point>();
1036

  
1037
                                                            double Angle = control.Angle;
1038

  
1039
                                                            if (Math.Abs(Angle).ToString() == "90")
845
                                                            break;
846
                                                        #endregion
847
                                                        #region RectangleControl
848
                                                        case "RectangleControl":
849
                                                            using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
850
                                                            {
851
                                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
852
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
853
                                                                var PaintStyle = control.PaintState;
854
                                                                double Angle = control.Angle;
855
                                                                DoubleCollection DashSize = control.DashSize;
856
                                                                double Opacity = control.Opac;
857
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
858

  
859
                                                                Controls_PDF.DrawSet_Shape.DrawRectangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
860
                                                            }
861
                                                            break;
862
                                                        #endregion
863
                                                        #region TriControl
864
                                                        case "TriControl":
865
                                                            using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
1040 866
                                                            {
1041
                                                                Angle = 270;
867
                                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
868
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
869
                                                                var PaintStyle = control.Paint;
870
                                                                double Angle = control.Angle;
871
                                                                //StrokeColor = _SetColor, //색상은 레드
872
                                                                DoubleCollection DashSize = control.DashSize;
873
                                                                double Opacity = control.Opac;
874
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
875

  
876
                                                                Controls_PDF.DrawSet_Shape.DrawTriangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle | PaintSet.Outline, Opacity);
1042 877
                                                            }
1043
                                                            else if (Math.Abs(Angle).ToString() == "270")
878
                                                            break;
879
                                                        #endregion
880
                                                        #region CircleControl
881
                                                        case "CircleControl":
882
                                                            using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
1044 883
                                                            {
1045
                                                                Angle = 90;
884
                                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
885
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
886
                                                                var StartPoint = GetPdfPointSystem(control.StartPoint);
887
                                                                var EndPoint = GetPdfPointSystem(control.EndPoint);
888
                                                                var PaintStyle = control.PaintState;
889
                                                                double Angle = control.Angle;
890
                                                                DoubleCollection DashSize = control.DashSize;
891
                                                                double Opacity = control.Opac;
892
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
893
                                                                Controls_PDF.DrawSet_Shape.DrawCircle(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity, Angle, PointSet);
894

  
1046 895
                                                            }
896
                                                            break;
897
                                                        #endregion
898
                                                        #region RectCloudControl
899
                                                        case "RectCloudControl":
900
                                                            using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
901
                                                            {
902
                                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
903
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
904
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
905
                                                                double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
906

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

  
909
                                                                var PaintStyle = control.PaintState;
910
                                                                double Opacity = control.Opac;
911
                                                                DoubleCollection DashSize = control.DashSize;
912

  
913
                                                                //드로잉 방식이 표현되지 않음
914
                                                                var rotate = returnAngle(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
1047 915

  
1048
                                                            var tempRectMidPoint = MathSet.getRectMiddlePoint(rect);
1049
                                                            tempPoint.Add(new Point(rect.Left, tempRectMidPoint.Y));
1050
                                                            tempPoint.Add(new Point(tempRectMidPoint.X, rect.Top));
1051
                                                            tempPoint.Add(new Point(rect.Right, tempRectMidPoint.Y));
1052
                                                            tempPoint.Add(new Point(tempRectMidPoint.X, rect.Bottom));
1053

  
1054
                                                            var newStartPoint = tempStartPoint;
1055
                                                            var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
1056
                                                            var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
1057

  
1058
                                                            //Point testPoint = tempEndPoint;
1059
                                                            //if (Angle != 0)
1060
                                                            //{
1061
                                                            //    testPoint = GetArrowTextControlTestPoint(0, newMidPoint, tempPoint, control.isFixed);
1062
                                                            //   //testPoint = Test(rect, newMidPoint);
1063
                                                            //}
1064

  
1065
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
1066
                                                            System.Drawing.Color FontColor = _SetColor;
1067
                                                            bool isHighlight = control.isHighLight;
1068
                                                            double Opacity = control.Opac;
1069
                                                            PaintSet Paint = PaintSet.None;
1070

  
1071
                                                            switch (control.ArrowStyle)
916
                                                                double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
917
                                                                bool reverse = (area < 0);
918

  
919
                                                                Controls_PDF.DrawSet_Cloud.DrawCloudRect(PointSet, LineSize, (int)rotate, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
920

  
921
                                                                //if (DashSize?.Count() == 1 && DashSize[0] == 999999)
922
                                                                //{
923
                                                                //    Controls_PDF.DrawSet_Cloud.DrawCloudRect(PointSet, LineSize, (int)rotate, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
924
                                                                //}
925
                                                                //else
926
                                                                //{
927
                                                                //    Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
928
                                                                //}
929
                                                            }
930
                                                            break;
931
                                                        #endregion
932
                                                        #region CloudControl
933
                                                        case "CloudControl":
934
                                                            using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
1072 935
                                                            {
1073
                                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal:
1074
                                                                    {
1075
                                                                        Paint = PaintSet.None;
1076
                                                                    }
1077
                                                                    break;
1078
                                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud:
936
                                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
937
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
938
                                                                double Toler = control.Toler;
939
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
940
                                                                double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
941
                                                                var PaintStyle = control.PaintState;
942
                                                                double Opacity = control.Opac;
943
                                                                bool isTransOn = control.IsTrans;
944
                                                                bool isChain = control.IsChain;
945

  
946
                                                                DoubleCollection DashSize = control.DashSize;
947

  
948
                                                                if (isChain)
949
                                                                {
950
                                                                    Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
951
                                                                }
952
                                                                else
953
                                                                {
954
                                                                    if (isTransOn)
1079 955
                                                                    {
1080
                                                                        Paint = PaintSet.Hatch;
956
                                                                        double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
957
                                                                        bool reverse = (area < 0);
958

  
959
                                                                        if (PaintStyle == PaintSet.None)
960
                                                                        {
961
                                                                            Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
962
                                                                        }
963
                                                                        else
964
                                                                        {
965
                                                                            Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
966
                                                                        }
1081 967
                                                                    }
1082
                                                                    break;
1083
                                                                case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect:
968
                                                                    else
1084 969
                                                                    {
1085
                                                                        Paint = PaintSet.Fill;
970
                                                                        Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, control.DashSize, _SetColor, PaintStyle, Opacity);
1086 971
                                                                    }
1087
                                                                    break;
1088
                                                                default:
1089
                                                                    break;
1090
                                                            }
1091
                                                            if (control.isHighLight) Paint |= PaintSet.Highlight;
1092

  
1093
                                                            if (Paint == PaintSet.Hatch)
1094
                                                            {
1095
                                                                Text = control.ArrowText;
972
                                                                }
1096 973
                                                            }
1097
                                                            else
974
                                                            break;
975
                                                        #endregion
976
                                                        #region TEXT
977
                                                        case "TextControl":
978
                                                            using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
1098 979
                                                            {
1099
                                                                Text = control.ArrowText;
980
                                                                DrawTextBox(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
1100 981
                                                            }
1101

  
1102
                                                            try
982
                                                            break;
983
                                                        #endregion
984
                                                        #region ArrowTextControl
985
                                                        case "ArrowTextControl":
986
                                                            using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
1103 987
                                                            {
1104
                                                                if (control.fontConfig.Count == 4)
988
                                                                //using (S_TextControl textcontrol = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
989
                                                                //{
990
                                                                //    textcontrol.Angle = control.Angle;
991
                                                                //    textcontrol.BoxH = control.BoxHeight;
992
                                                                //    textcontrol.BoxW = control.BoxWidth;
993
                                                                //    textcontrol.EndPoint = control.EndPoint;
994
                                                                //    textcontrol.FontColor = "#FFFF0000";
995
                                                                //    textcontrol.Name = "TextControl";
996
                                                                //    textcontrol.Opac = control.Opac;
997
                                                                //    textcontrol.PointSet = new List<Point>();
998
                                                                //    textcontrol.SizeSet = string.Join(delimiterChars2.First(), control.SizeSet.First(), control.fontConfig[3]);
999
                                                                //    textcontrol.StartPoint = control.StartPoint;
1000
                                                                //    textcontrol.Text = control.ArrowText;
1001
                                                                //    textcontrol.TransformPoint = control.TransformPoint;
1002
                                                                //    textcontrol.UserID = null;
1003
                                                                //    textcontrol.fontConfig = control.fontConfig;
1004
                                                                //    textcontrol.isHighLight = control.isHighLight;
1005
                                                                //    textcontrol.paintMethod = 1;
1006

  
1007
                                                                //    DrawTextBox(textcontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
1008
                                                                //}
1009

  
1010
                                                                //using (S_ArrowControl_Multi linecontrol = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
1011
                                                                //{
1012
                                                                //    linecontrol.Angle = control.Angle;
1013
                                                                //    linecontrol.DashSize = new DoubleCollection(new[] {(double)999999 });
1014
                                                                //    linecontrol.EndPoint = control.EndPoint;
1015
                                                                //    linecontrol.MidPoint = control.MidPoint;
1016
                                                                //    linecontrol.Name = "ArrowControl_Multi";
1017
                                                                //    linecontrol.Opac = control.Opac;
1018
                                                                //    linecontrol.PointSet = control.PointSet;
1019
                                                                //    linecontrol.SizeSet = control.SizeSet;
1020
                                                                //    linecontrol.StartPoint = control.StartPoint;
1021
                                                                //    linecontrol.StrokeColor = control.StrokeColor;
1022
                                                                //    linecontrol.TransformPoint = control.TransformPoint;
1023

  
1024
                                                                //    DrawMultiArrowLine(linecontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
1025
                                                                //}
1026
                                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1027
                                                                Point tempStartPoint = GetPdfPointSystem(control.StartPoint);
1028
                                                                Point tempMidPoint = GetPdfPointSystem(control.MidPoint);
1029
                                                                Point tempEndPoint = GetPdfPointSystem(control.EndPoint);
1030
                                                                bool isUnderLine = false;
1031
                                                                string Text = "";
1032
                                                                double fontsize = 30;
1033

  
1034
                                                                System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight);
1035
                                                                Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight));
1036
                                                                List<Point> tempPoint = new List<Point>();
1037

  
1038
                                                                double Angle = control.Angle;
1039

  
1040
                                                                if (Math.Abs(Angle).ToString() == "90")
1105 1041
                                                                {
1106
                                                                    fontsize = Convert.ToDouble(control.fontConfig[3]);
1042
                                                                    Angle = 270;
1107 1043
                                                                }
1108

  
1109
                                                                //강인구 수정(2018.04.17)
1110
                                                                var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
1111

  
1112
                                                                FontStyle fontStyle = FontStyles.Normal;
1113
                                                                if (FontStyles.Italic == TextStyle)
1044
                                                                else if (Math.Abs(Angle).ToString() == "270")
1114 1045
                                                                {
1115
                                                                    fontStyle = FontStyles.Italic;
1046
                                                                    Angle = 90;
1116 1047
                                                                }
1117 1048

  
1118
                                                                FontWeight fontWeight = FontWeights.Black;
1119

  
1120
                                                                var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
1121
                                                                if (FontWeights.Bold == TextWeight)
1049
                                                                var tempRectMidPoint = MathSet.getRectMiddlePoint(rect);
1050
                                                                tempPoint.Add(new Point(rect.Left, tempRectMidPoint.Y));
1051
                                                                tempPoint.Add(new Point(tempRectMidPoint.X, rect.Top));
1052
                                                                tempPoint.Add(new Point(rect.Right, tempRectMidPoint.Y));
1053
                                                                tempPoint.Add(new Point(tempRectMidPoint.X, rect.Bottom));
1054

  
1055
                                                                var newStartPoint = tempStartPoint;
1056
                                                                var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
1057
                                                                var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
1058

  
1059
                                                                //Point testPoint = tempEndPoint;
1060
                                                                //if (Angle != 0)
1061
                                                                //{
1062
                                                                //    testPoint = GetArrowTextControlTestPoint(0, newMidPoint, tempPoint, control.isFixed);
1063
                                                                //   //testPoint = Test(rect, newMidPoint);
1064
                                                                //}
1065

  
1066
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
1067
                                                                System.Drawing.Color FontColor = _SetColor;
1068
                                                                bool isHighlight = control.isHighLight;
1069
                                                                double Opacity = control.Opac;
1070
                                                                PaintSet Paint = PaintSet.None;
1071

  
1072
                                                                switch (control.ArrowStyle)
1122 1073
                                                                {
1123
                                                                    fontWeight = FontWeights.Bold;
1074
                                                                    case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal:
1075
                                                                        {
1076
                                                                            Paint = PaintSet.None;
1077
                                                                        }
1078
                                                                        break;
1079
                                                                    case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud:
1080
                                                                        {
1081
                                                                            Paint = PaintSet.Hatch;
1082
                                                                        }
1083
                                                                        break;
1084
                                                                    case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect:
1085
                                                                        {
1086
                                                                            Paint = PaintSet.Fill;
1087
                                                                        }
1088
                                                                        break;
1089
                                                                    default:
1090
                                                                        break;
1124 1091
                                                                }
1092
                                                                if (control.isHighLight) Paint |= PaintSet.Highlight;
1125 1093

  
1126
                                                                TextDecorationCollection decoration = TextDecorations.Baseline;
1127
                                                                if (control.fontConfig.Count() == 5)
1094
                                                                if (Paint == PaintSet.Hatch)
1128 1095
                                                                {
1129
                                                                    decoration = TextDecorations.Underline;
1096
                                                                    Text = control.ArrowText;
1130 1097
                                                                }
1131

  
1132
                                                                if (control.isTrans)
1098
                                                                else
1133 1099
                                                                {
1134
                                                                    //인구 수정 Arrow Text Style적용 되도록 변경
1135
                                                                    Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1136
                                                                    newStartPoint, tempMidPoint, newEndPoint, control.isFixed,
1137
                                                                    LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1100
                                                                    Text = control.ArrowText;
1138 1101
                                                                }
1139
                                                                else
1102

  
1103
                                                                try
1140 1104
                                                                {
1141
                                                                    if (control.isFixed)
1105
                                                                    if (control.fontConfig.Count == 4)
1106
                                                                    {
1107
                                                                        fontsize = Convert.ToDouble(control.fontConfig[3]);
1108
                                                                    }
1109

  
1110
                                                                    //강인구 수정(2018.04.17)
1111
                                                                    var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
1112

  
1113
                                                                    FontStyle fontStyle = FontStyles.Normal;
1114
                                                                    if (FontStyles.Italic == TextStyle)
1115
                                                                    {
1116
                                                                        fontStyle = FontStyles.Italic;
1117
                                                                    }
1118

  
1119
                                                                    FontWeight fontWeight = FontWeights.Black;
1120

  
1121
                                                                    var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
1122
                                                                    if (FontWeights.Bold == TextWeight)
1123
                                                                    {
1124
                                                                        fontWeight = FontWeights.Bold;
1125
                                                                    }
1126

  
1127
                                                                    TextDecorationCollection decoration = TextDecorations.Baseline;
1128
                                                                    if (control.fontConfig.Count() == 5)
1129
                                                                    {
1130
                                                                        decoration = TextDecorations.Underline;
1131
                                                                    }
1132

  
1133
                                                                    if (control.isTrans)
1142 1134
                                                                    {
1143
                                                                        var testP = new Point(0, 0);
1144
                                                                        if (control.isFixed)
1145
                                                                        {
1146
                                                                            if (tempPoint[1] == newEndPoint)
1147
                                                                            {
1148
                                                                                testP = new Point(newEndPoint.X, newEndPoint.Y - 10);
1149
                                                                            }
1150
                                                                            else if (tempPoint[3] == newEndPoint)
1151
                                                                            {
1152
                                                                                testP = new Point(newEndPoint.X, newEndPoint.Y + 10);
1153
                                                                            }
1154
                                                                            else if (tempPoint[0] == newEndPoint)
1155
                                                                            {
1156
                                                                                testP = new Point(newEndPoint.X - 10, newEndPoint.Y);
1157
                                                                            }
1158
                                                                            else if (tempPoint[2] == newEndPoint)
1159
                                                                            {
1160
                                                                                testP = new Point(newEndPoint.X + 10, newEndPoint.Y);
1161
                                                                            }
1162
                                                                        }
1163 1135
                                                                        //인구 수정 Arrow Text Style적용 되도록 변경
1164 1136
                                                                        Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1165
                                                                            tempStartPoint, testP, tempEndPoint, control.isFixed,
1166
                                                                            LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight,
1167
                                                                        FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1137
                                                                        newStartPoint, tempMidPoint, newEndPoint, control.isFixed,
1138
                                                                        LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1168 1139
                                                                    }
1169 1140
                                                                    else
1170 1141
                                                                    {
1171
                                                                        //인구 수정 Arrow Text Style적용 되도록 변경
1172
                                                                        Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1173
                                                                            newStartPoint, tempMidPoint, tempEndPoint, control.isFixed,
1174
                                                                            LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1142
                                                                        if (control.isFixed)
1143
                                                                        {
1144
                                                                            var testP = new Point(0, 0);
1145
                                                                            if (control.isFixed)
1146
                                                                            {
1147
                                                                                if (tempPoint[1] == newEndPoint)
1148
                                                                                {
1149
                                                                                    testP = new Point(newEndPoint.X, newEndPoint.Y - 10);
1150
                                                                                }
1151
                                                                                else if (tempPoint[3] == newEndPoint)
1152
                                                                                {
1153
                                                                                    testP = new Point(newEndPoint.X, newEndPoint.Y + 10);
1154
                                                                                }
1155
                                                                                else if (tempPoint[0] == newEndPoint)
1156
                                                                                {
1157
                                                                                    testP = new Point(newEndPoint.X - 10, newEndPoint.Y);
1158
                                                                                }
1159
                                                                                else if (tempPoint[2] == newEndPoint)
1160
                                                                                {
1161
                                                                                    testP = new Point(newEndPoint.X + 10, newEndPoint.Y);
1162
                                                                                }
1163
                                                                            }
1164
                                                                            //인구 수정 Arrow Text Style적용 되도록 변경
1165
                                                                            Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1166
                                                                                tempStartPoint, testP, tempEndPoint, control.isFixed,
1167
                                                                                LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight,
1168
                                                                            FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1169
                                                                        }
1170
                                                                        else
1171
                                                                        {
1172
                                                                            //인구 수정 Arrow Text Style적용 되도록 변경
1173
                                                                            Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1174
                                                                                newStartPoint, tempMidPoint, tempEndPoint, control.isFixed,
1175
                                                                                LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1176
                                                                        }
1175 1177
                                                                    }
1176 1178
                                                                }
1179
                                                                catch (Exception ex)
1180
                                                                {
1181
                                                                    throw ex;
1182
                                                                }
1183

  
1177 1184
                                                            }
1178
                                                            catch (Exception ex)
1185
                                                            break;
1186
                                                        #endregion
1187
                                                        #region SignControl
1188
                                                        case "SignControl":
1189
                                                            using (S_SignControl control = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
1179 1190
                                                            {
1180
                                                                throw ex;
1191
                                                                double Angle = control.Angle;
1192
                                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
1193
                                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
1194
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1195
                                                                double Opacity = control.Opac;
1196
                                                                string UserNumber = control.UserNumber;
1197
                                                                Controls_PDF.DrawSet_Image.DrawSign(StartPoint, EndPoint, PointSet, contentByte, UserNumber, Angle, Opacity, finaldata.PROJECT_NO);
1181 1198
                                                            }
1182

  
1183
                                                        }
1184
                                                        break;
1185
                                                    #endregion
1186
                                                    #region SignControl
1187
                                                    case "SignControl":
1188
                                                        using (S_SignControl control = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
1189
                                                        {
1190
                                                            double Angle = control.Angle;
1191
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1192
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1193
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1194
                                                            double Opacity = control.Opac;
1195
                                                            string UserNumber = control.UserNumber;
1196
                                                            Controls_PDF.DrawSet_Image.DrawSign(StartPoint, EndPoint, PointSet, contentByte, UserNumber, Angle, Opacity, finaldata.PROJECT_NO);
1197
                                                        }
1198
                                                        break;
1199
                                                    #endregion
1200
                                                    #region MyRegion
1201
                                                    case "DateControl":
1202
                                                        using (S_DateControl control = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
1203
                                                        {
1204
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1205
                                                            string Text = control.Text;
1206
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1207
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1208
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1209
                                                            System.Drawing.Color FontColor = _SetColor;
1210
                                                            double Angle = control.Angle;
1211
                                                            double Opacity = control.Opac;
1212
                                                            Controls_PDF.PDFLib_DrawSet_Text.DrawDate(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Text, Angle, Opacity);
1213
                                                        }
1214
                                                        break;
1215
                                                    #endregion
1216
                                                    #region SymControlN (APPROVED)
1217
                                                    case "SymControlN":
1218
                                                        using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1219
                                                        {
1220
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1221
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1222
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1223
                                                            System.Drawing.Color FontColor = _SetColor;
1224
                                                            double Angle = control.Angle;
1225
                                                            double Opacity = control.Opac;
1226

  
1227
                                                            var stamp = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP");
1228

  
1229
                                                            if (stamp.Count() > 0)
1199
                                                            break;
1200
                                                        #endregion
1201
                                                        #region MyRegion
1202
                                                        case "DateControl":
1203
                                                            using (S_DateControl control = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
1230 1204
                                                            {
1231
                                                                var xamldata = Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(stamp.First().VALUE);
1205
                                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1206
                                                                string Text = control.Text;
1207
                                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
1208
                                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
1209
                                                                List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1210
                                                                System.Drawing.Color FontColor = _SetColor;
1211
                                                                double Angle = control.Angle;
1212
                                                                double Opacity = control.Opac;
1213
                                                                Controls_PDF.PDFLib_DrawSet_Text.DrawDate(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Text, Angle, Opacity);
1214
                                                            }
1215
                                                            break;
1216
                                                        #endregion
1217
                                                        #region SymControlN (APPROVED)
1218
                                                        case "SymControlN":
1219
                                                            using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1220
                                                            {
1221
                                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
1222
                                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
1223
                                                                List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1224
                                                                System.Drawing.Color FontColor = _SetColor;
1225
                                                                double Angle = control.Angle;
1226
                                                                double Opacity = control.Opac;
1232 1227

  
1233
                                                                var Contents = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP_CONTENTS");
1234
                                                                
1235
                                                                if (Contents?.Count() > 0)
1228
                                                                var stamp = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP");
1229

  
1230
                                                                if (stamp.Count() > 0)
1236 1231
                                                                {
1237
                                                                    foreach (var content in Contents)
1232
                                                                    var xamldata = Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(stamp.First().VALUE);
1233

  
1234
                                                                    var Contents = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP_CONTENTS");
1235

  
1236
                                                                    if (Contents?.Count() > 0)
1238 1237
                                                                    {
1239
                                                                        xamldata = xamldata.Replace(content.PROPERTY, System.Security.SecurityElement.Escape(content.VALUE));
1238
                                                                        foreach (var content in Contents)
1239
                                                                        {
1240
                                                                            xamldata = xamldata.Replace(content.PROPERTY, System.Security.SecurityElement.Escape(content.VALUE));
1241
                                                                        }
1240 1242
                                                                    }
1243

  
1244
                                                                    Controls_PDF.PDFLib_DrawSet_Symbol.DrawApprovalXamlData(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, xamldata);
1241 1245
                                                                }
1242 1246

  
1243
                                                                Controls_PDF.PDFLib_DrawSet_Symbol.DrawApprovalXamlData(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, xamldata);
1244
                                                            }
1247
                                                                string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", "");
1245 1248

  
1246
                                                            string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", "");
1247

  
1248
                                                        }
1249
                                                        break;
1250
                                                    case "SymControl":
1251
                                                        using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1252
                                                        {
1253
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1254
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1255
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1256
                                                            System.Drawing.Color FontColor = _SetColor;
1257
                                                            double Angle = control.Angle;
1258
                                                            double Opacity = control.Opac;
1259

  
1260
                                                            string imgpath = CommonLib.Common.GetConfigString("CheckmarkImgPath", "URL", "");
1261
                                                            Controls_PDF.PDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath);
1262
                                                        }
1263
                                                        break;
1264
                                                    #endregion
1265
                                                    #region Image
1266
                                                    case "ImgControl":
1267
                                                        using (S_ImgControl control = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
1268
                                                        {
1269
                                                            double Angle = control.Angle;
1270
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1271
                                                            Point TopRightPoint = GetPdfPointSystem(control.TR);
1272
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1273
                                                            Point LeftBottomPoint = GetPdfPointSystem(control.LB);
1274
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1275
                                                            double Opacity = control.Opac;
1276
                                                            string FilePath = control.ImagePath;
1277
                                                            //Uri uri = new Uri(s.ImagePath);
1278

  
1279
                                                            try
1249
                                                            }
1250
                                                            break;
1251
                                                        case "SymControl":
1252
                                                            using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1280 1253
                                                            {
1281
                                                                Controls_PDF.DrawSet_Image.DrawImage(StartPoint, EndPoint, PointSet, contentByte, FilePath, Angle, Opacity);
1254
                                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
1255
                                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
1256
                                                                List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1257
                                                                System.Drawing.Color FontColor = _SetColor;
1258
                                                                double Angle = control.Angle;
1259
                                                                double Opacity = control.Opac;
1260

  
1261
                                                                string imgpath = CommonLib.Common.GetConfigString("CheckmarkImgPath", "URL", "");
1262
                                                                Controls_PDF.PDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath);
1282 1263
                                                            }
1283
                                                            catch (Exception ex)
1264
                                                            break;
1265
                                                        #endregion
1266
                                                        #region Image
1267
                                                        case "ImgControl":
1268
                                                            using (S_ImgControl control = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
1284 1269
                                                            {
1285
                                                                SetFinalPDFLog(FinalItem.ID, FinalItem.PROJECT_NO, ex.StackTrace);
1270
                                                                double Angle = control.Angle;
1271
                                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
1272
                                                                Point TopRightPoint = GetPdfPointSystem(control.TR);
1273
                                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
1274
                                                                Point LeftBottomPoint = GetPdfPointSystem(control.LB);
1275
                                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1276
                                                                double Opacity = control.Opac;
1277
                                                                string FilePath = control.ImagePath;
1278
                                                                //Uri uri = new Uri(s.ImagePath);
1279

  
1280
                                                                try
1281
                                                                {
1282
                                                                    Controls_PDF.DrawSet_Image.DrawImage(StartPoint, EndPoint, PointSet, contentByte, FilePath, Angle, Opacity);
1283
                                                                }
1284
                                                                catch (Exception ex)
1285
                                                                {
1286
                                                                    SetFinalPDFLog(FinalItem.ID, FinalItem.PROJECT_NO, ex.StackTrace);
1287
                                                                }
1286 1288
                                                            }
1287
                                                        }
1288
                                                        break;
1289
                                                    #endregion
1290
                                                    default:
1291
                                                        StatusChange($"{ControlT.Name} Not Support", 0);
1292
                                                        break;
1293
                                                }
1289
                                                            break;
1290
                                                        #endregion
1291
                                                        default:
1292
                                                            StatusChange($"{ControlT.Name} Not Support", 0);
1293
                                                            break;
1294
                                                    }
1294 1295

  
1295
                                            }
1296
                                            catch (Exception ex)
1297
                                            {
1298
                                                StatusChange($"markupItem : {markupItem.ID}" + ex.ToString(), 0);
1299
                                            }
1300
                                            finally
1301
                                            {
1302
                                                //if (ControlT?.Name != null)
1303
                                                //{
1304
                                                //    strLog.Append($"{ControlT.Name},");
1305
                                                //}
1296
                                                }
1297
                                                catch (Exception ex)
1298
                                                {
1299
                                                    StatusChange($"markupItem : {ControlT.Name}" + ex.ToString(), 0);
1300
                                                }
1301
                                                finally
1302
                                                {
1303
                                                    //if (ControlT?.Name != null)
1304
                                                    //{
1305
                                                    //    strLog.Append($"{ControlT.Name},");
1306
                                                    //}
1307
                                                }
1306 1308
                                            }
1307 1309
                                        }
1308

  
1309 1310
                                    }
1310 1311
                                }
1311 1312

  
FinalService/KCOM_FinalService_DL/MarkupToPDF/Serialize/S_Control/Base/S_BaseControl.cs
41 41
        public double Angle { get; set; } //Angle Point
42 42
        [DataMember]
43 43
        public string Memo { get; set; }
44

  
45
        [DataMember]
46
        public int ZIndex { get; set; } = 10;
47

  
48
        [DataMember]
49
        public int Index { get; set; }
44 50
    }
45 51
}

내보내기 Unified diff

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