프로젝트

일반

사용자정보

개정판 4f017ed3

ID4f017ed300546aa9269405c789f27a9b4fbadb49
상위 d2279f18
하위 324fcf3e

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

Final ArrowTextControl 수정

Change-Id: Ifdd9876909e6a4ce288d70acb74a00b37e88e6a0

차이점 보기:

FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs
699 699
                                                {
700 700
                                                    using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
701 701
                                                    {
702
                                                        string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
703
                                                        Point StartPoint = GetPdfPointSystem(control.StartPoint);
704
                                                        Point EndPoint = GetPdfPointSystem(control.EndPoint);
705
                                                        DoubleCollection DashSize = control.DashSize;
706
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
707

  
708
                                                        var Opacity = control.Opac;
709
                                                        string UserID = control.UserID;
710
                                                        double Interval = control.Interval;
711
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
712
                                                        Controls_PDF.DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, _SetColor, Opacity);
713
                                                        switch (control.LineStyleSet)
714
                                                        {
715
                                                            case LineStyleSet.ArrowLine:
716
                                                                Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, LineSize, contentByte, _SetColor, Opacity);
717
                                                                break;
718
                                                            case LineStyleSet.CancelLine:
719
                                                                {
720
                                                                    var x = Math.Abs((Math.Abs(StartPoint.X) - Math.Abs(EndPoint.X)));
721
                                                                    var y = Math.Abs((Math.Abs(StartPoint.Y) - Math.Abs(EndPoint.Y)));
722

  
723
                                                                    if (x > y)
724
                                                                    {
725
                                                                        StartPoint = new Point(StartPoint.X, StartPoint.Y - (float)(control.Interval / 3.0));
726
                                                                        EndPoint = new Point(EndPoint.X, EndPoint.Y - (float)(control.Interval / 3.0));
727
                                                                        Controls_PDF.DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, Opacity);
728
                                                                    }
729
                                                                }
730
                                                                break;
731
                                                            case LineStyleSet.TwinLine:
732
                                                                {
733
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, LineSize, contentByte, _SetColor, Opacity);
734
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity);
735
                                                                }
736
                                                                break;
737
                                                            case LineStyleSet.DimLine:
738
                                                                {
739
                                                                    Controls_PDF.DrawSet_Arrow.DimAllow(StartPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity);
740
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, LineSize, contentByte, _SetColor, Opacity);
741
                                                                    Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity);
742
                                                                }
743
                                                                break;
744
                                                            default:
745
                                                                break;
746
                                                        }
747

  
748

  
702
                                                        DrawLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
749 703
                                                    }
750 704
                                                }
751 705
                                                break;
......
755 709
                                                {
756 710
                                                    using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
757 711
                                                    {
758
                                                        string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
759
                                                        Point StartPoint = GetPdfPointSystem(control.StartPoint);
760
                                                        Point MidPoint = GetPdfPointSystem(control.MidPoint);
761
                                                        Point EndPoint = GetPdfPointSystem(control.EndPoint);
762
                                                        DoubleCollection DashSize = control.DashSize;
763
                                                        List<Point> PointSet = GetPdfPointSystem(control.PointSet);
764
                                                        double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
765

  
766
                                                        double Opacity = control.Opac;
767

  
768
                                                        if (EndPoint == MidPoint)
769
                                                        {
770
                                                            Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, LineSize, contentByte, _SetColor, Opacity);
771
                                                        }
772
                                                        else
773
                                                        {
774
                                                            Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity);
775
                                                        }
776

  
777
                                                        Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
778

  
712
                                                       DrawMultiArrowLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
779 713
                                                    }
780 714
                                                }
781 715
                                                break;
......
963 897
                                            case "TextControl":
964 898
                                                using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
965 899
                                                {
966
                                                    string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
967
                                                    string Text = control.Text;
900
                                                    DrawTextBox(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
901
                                                 }
902
                                                break;
903
                                            #endregion
904
                                            #region ArrowTextControl
905
                                            case "ArrowTextControl":
906
                                                using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
907
                                                {
908
                                                    //using (S_TextControl textcontrol = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
909
                                                    //{
910
                                                    //    textcontrol.Angle = control.Angle;
911
                                                    //    textcontrol.BoxH = control.BoxHeight;
912
                                                    //    textcontrol.BoxW = control.BoxWidth;
913
                                                    //    textcontrol.EndPoint = control.EndPoint;
914
                                                    //    textcontrol.FontColor = "#FFFF0000";
915
                                                    //    textcontrol.Name = "TextControl";
916
                                                    //    textcontrol.Opac = control.Opac;
917
                                                    //    textcontrol.PointSet = new List<Point>();
918
                                                    //    textcontrol.SizeSet = string.Join(delimiterChars2.First(), control.SizeSet.First(), control.fontConfig[3]);
919
                                                    //    textcontrol.StartPoint = control.StartPoint;
920
                                                    //    textcontrol.Text = control.ArrowText;
921
                                                    //    textcontrol.TransformPoint = control.TransformPoint;
922
                                                    //    textcontrol.UserID = null;
923
                                                    //    textcontrol.fontConfig = control.fontConfig;
924
                                                    //    textcontrol.isHighLight = control.isHighLight;
925
                                                    //    textcontrol.paintMethod = 1;
926

  
927
                                                    //    DrawTextBox(textcontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
928
                                                    //}
929

  
930
                                                    //using (S_ArrowControl_Multi linecontrol = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
931
                                                    //{
932
                                                    //    linecontrol.Angle = control.Angle;
933
                                                    //    linecontrol.DashSize = new DoubleCollection(new[] {(double)999999 });
934
                                                    //    linecontrol.EndPoint = control.EndPoint;
935
                                                    //    linecontrol.MidPoint = control.MidPoint;
936
                                                    //    linecontrol.Name = "ArrowControl_Multi";
937
                                                    //    linecontrol.Opac = control.Opac;
938
                                                    //    linecontrol.PointSet = control.PointSet;
939
                                                    //    linecontrol.SizeSet = control.SizeSet;
940
                                                    //    linecontrol.StartPoint = control.StartPoint;
941
                                                    //    linecontrol.StrokeColor = control.StrokeColor;
942
                                                    //    linecontrol.TransformPoint = control.TransformPoint;
943

  
944
                                                    //    DrawMultiArrowLine(linecontrol, contentByte, delimiterChars, delimiterChars2, _SetColor);
945
                                                    //}
946
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
947
                                                Point tempStartPoint = GetPdfPointSystem(control.StartPoint);
948
                                                Point tempMidPoint = GetPdfPointSystem(control.MidPoint);
949
                                                Point tempEndPoint = GetPdfPointSystem(control.EndPoint);
950
                                                bool isUnderLine = false;
951
                                                string Text = "";
952
                                                double fontsize = 30;
953

  
954
                                                System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight);
955
                                                Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight));
956
                                                List<Point> tempPoint = new List<Point>();
957

  
958
                                                double Angle = control.Angle;
959

  
960
                                                if (Math.Abs(Angle).ToString() == "90")
961
                                                {
962
                                                    Angle = 270;
963
                                                }
964
                                                else if (Math.Abs(Angle).ToString() == "270")
965
                                                {
966
                                                    Angle = 90;
967
                                                }
968 968

  
969
                                                    bool isUnderline = false;
970
                                                    control.BoxW -= scaleWidth;
971
                                                    control.BoxH -= scaleHeight;
972
                                                    System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxW, (float)control.BoxH);
973
                                                    Point StartPoint = GetPdfPointSystem(control.StartPoint);
974
                                                    Point EndPoint = GetPdfPointSystem(new Point(control.StartPoint.X + control.BoxW, control.StartPoint.Y + control.BoxH));
969
                                                var tempRectMidPoint = MathSet.getRectMiddlePoint(rect);
970
                                                tempPoint.Add(new Point(rect.Left, tempRectMidPoint.Y));
971
                                                tempPoint.Add(new Point(tempRectMidPoint.X, rect.Top));
972
                                                tempPoint.Add(new Point(rect.Right, tempRectMidPoint.Y));
973
                                                tempPoint.Add(new Point(tempRectMidPoint.X, rect.Bottom));
974

  
975
                                                var newStartPoint = tempStartPoint;
976
                                                var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
977
                                                var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
978

  
979
                                                    //Point testPoint = tempEndPoint;
980
                                                    //if (Angle != 0)
981
                                                    //{
982
                                                    //    testPoint = GetArrowTextControlTestPoint(0, newMidPoint, tempPoint, control.isFixed);
983
                                                    //   //testPoint = Test(rect, newMidPoint);
984
                                                    //}
985

  
986
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
987
                                                SolidColorBrush FontColor = _SetColor;
988
                                                bool isHighlight = control.isHighLight;
989
                                                double Opacity = control.Opac;
990
                                                PaintSet Paint = PaintSet.None;
991

  
992
                                                switch (control.ArrowStyle)
993
                                                {
994
                                                    case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal:
995
                                                        {
996
                                                            Paint = PaintSet.None;
997
                                                        }
998
                                                        break;
999
                                                    case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud:
1000
                                                        {
1001
                                                            Paint = PaintSet.Hatch;
1002
                                                        }
1003
                                                        break;
1004
                                                    case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect:
1005
                                                        {
1006
                                                            Paint = PaintSet.Fill;
1007
                                                        }
1008
                                                        break;
1009
                                                    default:
1010
                                                        break;
1011
                                                }
1012
                                                if (control.isHighLight) Paint |= PaintSet.Highlight;
975 1013

  
976
                                                    List<Point> pointSet = new List<Point>();
977
                                                    pointSet.Add(StartPoint);
978
                                                    pointSet.Add(EndPoint);
1014
                                                if (Paint == PaintSet.Hatch)
1015
                                                {
1016
                                                    Text = control.ArrowText;
1017
                                                }
1018
                                                else
1019
                                                {
1020
                                                    Text = control.ArrowText;
1021
                                                }
979 1022

  
980
                                                    PaintSet paint = PaintSet.None;
981
                                                    switch (control.paintMethod)
1023
                                                try
1024
                                                {
1025
                                                    if (control.fontConfig.Count == 4)
982 1026
                                                    {
983
                                                        case 1:
984
                                                            {
985
                                                                paint = PaintSet.Fill;
986
                                                            }
987
                                                            break;
988
                                                        case 2:
989
                                                            {
990
                                                                paint = PaintSet.Hatch;
991
                                                            }
992
                                                            break;
993
                                                        default:
994
                                                            break;
1027
                                                        fontsize = Convert.ToDouble(control.fontConfig[3]);
995 1028
                                                    }
996
                                                    if (control.isHighLight) paint |= PaintSet.Highlight;
997 1029

  
998
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
999
                                                    double TextSize = Convert.ToDouble(data2[1]);
1000
                                                    SolidColorBrush FontColor = _SetColor;
1001
                                                    double Angle = control.Angle;
1002
                                                    double Opacity = control.Opac;
1003
                                                    FontFamily fontfamilly = FontHelper.GetFontFamily(control.fontConfig[0]);
1030
                                                    //강인구 수정(2018.04.17)
1004 1031
                                                    var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
1005
                                                    
1032

  
1006 1033
                                                    FontStyle fontStyle = FontStyles.Normal;
1007 1034
                                                    if (FontStyles.Italic == TextStyle)
1008 1035
                                                    {
......
1012 1039
                                                    FontWeight fontWeight = FontWeights.Black;
1013 1040

  
1014 1041
                                                    var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
1015
                                                    //강인구 수정(2018.04.17)
1016 1042
                                                    if (FontWeights.Bold == TextWeight)
1017
                                                    //if (FontWeights.ExtraBold == TextWeight)
1018 1043
                                                    {
1019 1044
                                                        fontWeight = FontWeights.Bold;
1020 1045
                                                    }
1021 1046

  
1022 1047
                                                    TextDecorationCollection decoration = TextDecorations.Baseline;
1023
                                                    if (control.fontConfig.Count() == 4)
1048
                                                    if (control.fontConfig.Count() == 5)
1024 1049
                                                    {
1025 1050
                                                        decoration = TextDecorations.Underline;
1026 1051
                                                    }
1027 1052

  
1028
                                                    Controls_PDF.DrawSet_Text.DrawString(StartPoint, EndPoint, LineSize, contentByte, _SetColor, paint, TextSize, fontfamilly, fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1029
                                                }
1030
                                                break;
1031
                                            #endregion
1032
                                            #region ArrowTextControl
1033
                                            case "ArrowTextControl":
1034
                                                using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
1035
                                                {
1036
                                                    string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1037
                                                    Point tempStartPoint = GetPdfPointSystem(control.StartPoint);
1038
                                                    Point tempMidPoint = GetPdfPointSystem(control.MidPoint);
1039
                                                    Point tempEndPoint = GetPdfPointSystem(control.EndPoint);
1040
                                                    bool isUnderLine = false;
1041
                                                    string Text = "";
1042
                                                    double fontsize = 30;
1043

  
1044
                                                    System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight);
1045
                                                    Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight));
1046
                                                    List<Point> tempPoint = new List<Point>();
1047

  
1048
                                                    var tempRectMidPoint = MathSet.getRectMiddlePoint(rect);
1049

  
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
                                                    double Angle = control.Angle;
1055
                                                    var newStartPoint = tempStartPoint;
1056
                                                    var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
1057
                                                    var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
1058

  
1059
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1060
                                                    SolidColorBrush FontColor = _SetColor;
1061
                                                    bool isHighlight = control.isHighLight;
1062
                                                    double Opacity = control.Opac;
1063
                                                    PaintSet Paint = PaintSet.None;
1064

  
1065
                                                    switch (control.ArrowStyle)
1066
                                                    {
1067
                                                        case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal:
1068
                                                            {
1069
                                                                Paint = PaintSet.None;
1070
                                                            }
1071
                                                            break;
1072
                                                        case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud:
1073
                                                            {
1074
                                                                Paint = PaintSet.Hatch;
1075
                                                            }
1076
                                                            break;
1077
                                                        case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect:
1078
                                                            {
1079
                                                                Paint = PaintSet.Fill;
1080
                                                            }
1081
                                                            break;
1082
                                                        default:
1083
                                                            break;
1084
                                                    }
1085
                                                    if (control.isHighLight) Paint |= PaintSet.Highlight;
1086

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

  
1096
                                                    try
1097
                                                    {
1098
                                                        if (control.fontConfig.Count == 4)
1099
                                                        {
1100
                                                            fontsize = Convert.ToDouble(control.fontConfig[3]);
1101
                                                        }
1102

  
1103
                                                        //강인구 수정(2018.04.17)
1104
                                                        var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
1105

  
1106
                                                        FontStyle fontStyle = FontStyles.Normal;
1107
                                                        if (FontStyles.Italic == TextStyle)
1108
                                                        {
1109
                                                            fontStyle = FontStyles.Italic;
1110
                                                        }
1111

  
1112
                                                        FontWeight fontWeight = FontWeights.Black;
1113

  
1114
                                                        var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
1115
                                                        if (FontWeights.Bold == TextWeight)
1116
                                                        {
1117
                                                            fontWeight = FontWeights.Bold;
1118
                                                        }
1119

  
1120
                                                        TextDecorationCollection decoration = TextDecorations.Baseline;
1121
                                                        if (control.fontConfig.Count() == 5)
1122
                                                        {
1123
                                                            decoration = TextDecorations.Underline;
1124
                                                        }
1125

  
1126
                                                        if (control.isTrans)
1127
                                                        {
1128
                                                            //인구 수정 Arrow Text Style적용 되도록 변경
1129
                                                            Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1130
                                                                newStartPoint, tempMidPoint, control.isFixed,
1131
                                                                LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1132
                                                        }
1133
                                                        else
1062
                                                        if (control.isFixed)
1134 1063
                                                        {
1064
                                                            var testP = new Point(0, 0);
1135 1065
                                                            if (control.isFixed)
1136 1066
                                                            {
1137
                                                                var testP = new Point(0, 0);
1138
                                                                if (control.isFixed)
1067
                                                                if (tempPoint[1] == newEndPoint)
1139 1068
                                                                {
1140
                                                                    if (tempPoint[1] == newEndPoint)
1141
                                                                    {
1142
                                                                        testP = new Point(newEndPoint.X, newEndPoint.Y - 10);
1143
                                                                    }
1144
                                                                    else if (tempPoint[3] == newEndPoint)
1145
                                                                    {
1146
                                                                        testP = new Point(newEndPoint.X, newEndPoint.Y + 10);
1147
                                                                    }
1148
                                                                    else if (tempPoint[0] == newEndPoint)
1149
                                                                    {
1150
                                                                        testP = new Point(newEndPoint.X - 10, newEndPoint.Y);
1151
                                                                    }
1152
                                                                    else if (tempPoint[2] == newEndPoint)
1153
                                                                    {
1154
                                                                        testP = new Point(newEndPoint.X + 10, newEndPoint.Y);
1155
                                                                    }
1069
                                                                    testP = new Point(newEndPoint.X, newEndPoint.Y - 10);
1070
                                                                }
1071
                                                                else if (tempPoint[3] == newEndPoint)
1072
                                                                {
1073
                                                                    testP = new Point(newEndPoint.X, newEndPoint.Y + 10);
1074
                                                                }
1075
                                                                else if (tempPoint[0] == newEndPoint)
1076
                                                                {
1077
                                                                    testP = new Point(newEndPoint.X - 10, newEndPoint.Y);
1078
                                                                }
1079
                                                                else if (tempPoint[2] == newEndPoint)
1080
                                                                {
1081
                                                                    testP = new Point(newEndPoint.X + 10, newEndPoint.Y);
1156 1082
                                                                }
1157
                                                                //인구 수정 Arrow Text Style적용 되도록 변경
1158
                                                                Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1159
                                                                    tempStartPoint, testP, control.isFixed ,
1160
                                                                    LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight,
1161
                                                                FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1162
                                                            }
1163
                                                            else
1164
                                                            {
1165
                                                                //인구 수정 Arrow Text Style적용 되도록 변경
1166
                                                                Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1167
                                                                    newStartPoint, tempMidPoint, control.isFixed,
1168
                                                                    LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1169 1083
                                                            }
1084
                                                            //인구 수정 Arrow Text Style적용 되도록 변경
1085
                                                            Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1086
                                                                tempStartPoint, testP, tempEndPoint, control.isFixed,
1087
                                                                LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight,
1088
                                                            FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1089
                                                        }
1090
                                                        else
1091
                                                        {
1092
                                                            //인구 수정 Arrow Text Style적용 되도록 변경
1093
                                                            Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight),
1094
                                                                newStartPoint, tempMidPoint, tempEndPoint, control.isFixed,
1095
                                                                LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1170 1096
                                                        }
1171 1097
                                                    }
1172
                                                    catch (Exception ex)
1173
                                                    {
1174
                                                        throw ex;
1175
                                                    }
1098
                                                }
1099
                                                catch (Exception ex)
1100
                                                {
1101
                                                    throw ex;
1102
                                                }
1103

  
1176 1104
                                                }
1177 1105
                                                break;
1178 1106
                                            #endregion
......
1317 1245
            }
1318 1246
            return false;
1319 1247
        }
1248

  
1249
        /// <summary>
1250
        /// kcom의 화살표방향과 틀려 추가함
1251
        /// </summary>
1252
        /// <param name="PageAngle"></param>
1253
        /// <param name="endP"></param>
1254
        /// <param name="ps">box Points</param>
1255
        /// <param name="IsFixed"></param>
1256
        /// <returns></returns>
1257
        private Point GetArrowTextControlTestPoint(double PageAngle,Point endP,List<Point> ps,bool IsFixed)
1258
        {
1259
            Point testP = endP;
1260

  
1261
            try
1262
            {
1263
                switch (Math.Abs(PageAngle).ToString())
1264
                {
1265
                    case "90":
1266
                        testP = new Point(endP.X + 50, endP.Y);
1267
                        break;
1268
                    case "270":
1269
                        testP = new Point(endP.X - 50, endP.Y);
1270
                        break;
1271
                }
1272

  
1273
                //20180910 LJY 각도에 따라.
1274
                switch (Math.Abs(PageAngle).ToString())
1275
                {
1276
                    case "90":
1277
                        if (IsFixed)
1278
                        {
1279
                            if (ps[0] == endP) //상단
1280
                            {
1281
                                testP = new Point(endP.X, endP.Y + 50);
1282
                                //System.Diagnostics.Debug.WriteLine("상단"+ testP);
1283
                            }
1284
                            else if (ps[1] == endP) //하단
1285
                            {
1286
                                testP = new Point(endP.X, endP.Y - 50);
1287
                                //System.Diagnostics.Debug.WriteLine("하단"+ testP);
1288
                            }
1289
                            else if (ps[2] == endP) //좌단
1290
                            {
1291
                                testP = new Point(endP.X - 50, endP.Y);
1292
                                //System.Diagnostics.Debug.WriteLine("좌단"+ testP);
1293
                            }
1294
                            else if (ps[3] == endP) //우단
1295
                            {
1296
                                testP = new Point(endP.X + 50, endP.Y);
1297
                                //System.Diagnostics.Debug.WriteLine("우단"+ testP);
1298
                            }
1299
                        }
1300
                        break;
1301
                    case "270":
1302
                        if (IsFixed)
1303
                        {
1304
                            if (ps[0] == endP) //상단
1305
                            {
1306
                                testP = new Point(endP.X, endP.Y - 50);
1307
                                //System.Diagnostics.Debug.WriteLine("상단" + testP);
1308
                            }
1309
                            else if (ps[1] == endP) //하단
1310
                            {
1311
                                testP = new Point(endP.X, endP.Y + 50);
1312
                                //System.Diagnostics.Debug.WriteLine("하단" + testP);
1313
                            }
1314
                            else if (ps[2] == endP) //좌단
1315
                            {
1316
                                testP = new Point(endP.X + 50, endP.Y);
1317
                                //System.Diagnostics.Debug.WriteLine("좌단" + testP);
1318
                            }
1319
                            else if (ps[3] == endP) //우단
1320
                            {
1321
                                testP = new Point(endP.X - 50, endP.Y);
1322
                                //System.Diagnostics.Debug.WriteLine("우단" + testP);
1323
                            }
1324
                        }
1325
                        break;
1326
                    default:
1327
                        if (IsFixed)
1328
                        {
1329

  
1330
                            if (ps[0] == endP) //상단
1331
                            {
1332
                                testP = new Point(endP.X, endP.Y - 50);
1333
                                //System.Diagnostics.Debug.WriteLine("상단");
1334
                            }
1335
                            else if (ps[1] == endP) //하단
1336
                            {
1337
                                testP = new Point(endP.X, endP.Y + 50);
1338
                                //System.Diagnostics.Debug.WriteLine("하단");
1339
                            }
1340
                            else if (ps[2] == endP) //좌단
1341
                            {
1342
                                testP = new Point(endP.X - 50, endP.Y);
1343
                                //System.Diagnostics.Debug.WriteLine("좌단");
1344
                            }
1345
                            else if (ps[3] == endP) //우단
1346
                            {
1347
                                testP = new Point(endP.X + 50, endP.Y);
1348
                                //System.Diagnostics.Debug.WriteLine("우단");
1349
                            }
1350
                        }
1351
                        break;
1352
                }
1353

  
1354
            }
1355
            catch (Exception)
1356
            {
1357
            }
1358

  
1359
            return testP;
1360
        }
1361

  
1362
        private Point Test(Rect rect,Point point)
1363
        {
1364
            Point result = new Point();
1365

  
1366
            Point newPoint = new Point();
1367

  
1368
            double oldNear = 0;
1369
            double newNear = 0;
1370

  
1371
            oldNear = MathSet.GetShortestDistance(point, rect.TopLeft, rect.TopRight, out result);
1372

  
1373
            newNear = MathSet.GetShortestDistance(point, rect.TopLeft, rect.BottomLeft, out newPoint);
1374

  
1375
            if (newNear < oldNear)
1376
            {
1377
                oldNear = newNear;
1378
                result = newPoint;
1379
            }
1380

  
1381
            newNear = MathSet.GetShortestDistance(point, rect.TopRight, rect.BottomRight, out newPoint);
1382

  
1383
            if (newNear < oldNear)
1384
            {
1385
                oldNear = newNear;
1386
                result = newPoint;
1387
            }
1388

  
1389

  
1390
            newNear = MathSet.GetShortestDistance(point, rect.BottomLeft, rect.BottomRight, out newPoint);
1391

  
1392
            if (newNear < oldNear)
1393
            {
1394
                oldNear = newNear;
1395
                result = newPoint;
1396
            }
1397

  
1398
            return result;
1399
        }
1400

  
1401
        private void DrawMultiArrowLine(S_ArrowControl_Multi control, PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2, SolidColorBrush setColor)
1402
        {
1403
            string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1404
            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1405
            Point MidPoint = GetPdfPointSystem(control.MidPoint);
1406
            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1407
            DoubleCollection DashSize = control.DashSize;
1408
            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1409
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
1410

  
1411
            double Opacity = control.Opac;
1412

  
1413
            if (EndPoint == MidPoint)
1414
            {
1415
                Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, LineSize, contentByte, setColor, Opacity);
1416
            }
1417
            else
1418
            {
1419
                Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, LineSize, contentByte, setColor, Opacity);
1420
            }
1421

  
1422
            Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, setColor, Opacity);
1423

  
1424
        }
1425

  
1426
        private void DrawLine(S_LineControl control, PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2, SolidColorBrush setColor)
1427
        {
1428
            string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1429
            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1430
            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1431
            DoubleCollection DashSize = control.DashSize;
1432
            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1433

  
1434
            var Opacity = control.Opac;
1435
            string UserID = control.UserID;
1436
            double Interval = control.Interval;
1437
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
1438
            Controls_PDF.DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, setColor, Opacity);
1439
            switch (control.LineStyleSet)
1440
            {
1441
                case LineStyleSet.ArrowLine:
1442
                    Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, LineSize, contentByte, setColor, Opacity);
1443
                    break;
1444
                case LineStyleSet.CancelLine:
1445
                    {
1446
                        var x = Math.Abs((Math.Abs(StartPoint.X) - Math.Abs(EndPoint.X)));
1447
                        var y = Math.Abs((Math.Abs(StartPoint.Y) - Math.Abs(EndPoint.Y)));
1448

  
1449
                        if (x > y)
1450
                        {
1451
                            StartPoint = new Point(StartPoint.X, StartPoint.Y - (float)(control.Interval / 3.0));
1452
                            EndPoint = new Point(EndPoint.X, EndPoint.Y - (float)(control.Interval / 3.0));
1453
                            Controls_PDF.DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, DashSize, setColor, Opacity);
1454
                        }
1455
                    }
1456
                    break;
1457
                case LineStyleSet.TwinLine:
1458
                    {
1459
                        Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, LineSize, contentByte, setColor, Opacity);
1460
                        Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, LineSize, contentByte, setColor, Opacity);
1461
                    }
1462
                    break;
1463
                case LineStyleSet.DimLine:
1464
                    {
1465
                        Controls_PDF.DrawSet_Arrow.DimAllow(StartPoint, EndPoint, LineSize, contentByte, setColor, Opacity);
1466
                        Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, LineSize, contentByte, setColor, Opacity);
1467
                        Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, LineSize, contentByte, setColor, Opacity);
1468
                    }
1469
                    break;
1470
                default:
1471
                    break;
1472
            }
1473

  
1474
        }
1475

  
1476
        private void DrawTextBox(S_TextControl control,PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2,SolidColorBrush setColor)
1477
        {
1478
            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1479
            string Text = control.Text;
1480

  
1481
            bool isUnderline = false;
1482
            control.BoxW -= scaleWidth;
1483
            control.BoxH -= scaleHeight;
1484
            System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxW, (float)control.BoxH);
1485
            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1486
            Point EndPoint = GetPdfPointSystem(new Point(control.StartPoint.X + control.BoxW, control.StartPoint.Y + control.BoxH));
1487

  
1488
            List<Point> pointSet = new List<Point>();
1489
            pointSet.Add(StartPoint);
1490
            pointSet.Add(EndPoint);
1491

  
1492
            PaintSet paint = PaintSet.None;
1493
            switch (control.paintMethod)
1494
            {
1495
                case 1:
1496
                    {
1497
                        paint = PaintSet.Fill;
1498
                    }
1499
                    break;
1500
                case 2:
1501
                    {
1502
                        paint = PaintSet.Hatch;
1503
                    }
1504
                    break;
1505
                default:
1506
                    break;
1507
            }
1508
            if (control.isHighLight) paint |= PaintSet.Highlight;
1509

  
1510
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1511
            double TextSize = Convert.ToDouble(data2[1]);
1512
            SolidColorBrush FontColor = setColor;
1513
            double Angle = control.Angle;
1514
            double Opacity = control.Opac;
1515
            FontFamily fontfamilly = FontHelper.GetFontFamily(control.fontConfig[0]);
1516
            var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]);
1517

  
1518
            FontStyle fontStyle = FontStyles.Normal;
1519
            if (FontStyles.Italic == TextStyle)
1520
            {
1521
                fontStyle = FontStyles.Italic;
1522
            }
1523

  
1524
            FontWeight fontWeight = FontWeights.Black;
1525

  
1526
            var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]);
1527
            //강인구 수정(2018.04.17)
1528
            if (FontWeights.Bold == TextWeight)
1529
            //if (FontWeights.ExtraBold == TextWeight)
1530
            {
1531
                fontWeight = FontWeights.Bold;
1532
            }
1533

  
1534
            TextDecorationCollection decoration = TextDecorations.Baseline;
1535
            if (control.fontConfig.Count() == 4)
1536
            {
1537
                decoration = TextDecorations.Underline;
1538
            }
1539

  
1540
            Controls_PDF.DrawSet_Text.DrawString(StartPoint, EndPoint, LineSize, contentByte, setColor, paint, TextSize, fontfamilly, fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
1541
        }
1320 1542
    
1321 1543

  
1322 1544
        ~MarkupToPDF()

내보내기 Unified diff

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