프로젝트

일반

사용자정보

개정판 1588306f

ID1588306fd1f25cb59c3c950fde1f492e40b3343b
상위 92e69742
하위 206eb77c

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

Fix: MARKUS 라인 사이즈를 PDF 라인 사이즈로 변경하는 로직 수정

Change-Id: I45b491b8bcc9b996d48c73bf3dc35b728df035a6

차이점 보기:

FinalService/KCOM_FinalService/MarkupToPDF/Common/ConverterLineSize.cs
7 7
{
8 8
    public static class ConverterLineSize
9 9
    {
10
        /// private static double[] factors = new double[11]{0.5, 0.5, 0.5, 0.5, 0.4, 0.3, 0.3, 0.3, 0.2, 0.2, 0.2};
11
        public static double Convert(int iLineSize)
10
        /// <summary>
11
        /// MARKUS 라인 사이즈를 PDF 라인 사이즈로 변환 
12
        /// </summary>
13
        /// <param name="iLineSize"></param>
14
        /// <param name="Scale">이미지 사이즈 / PDF 사이즈</param>
15
        /// <returns></returns>
16
        public static double Convert(int iLineSize, double Scale)
12 17
        {
13
            double factor = 0.2;/// factors[iLineSize % 10];
18
            double factor = 1 / Scale;
14 19
            /// WPF defines a device-independent pixel as 1 / 96 per inch
15 20
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
16 21
            return iLineSize * 72 / 96 * factor;
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/PDFLib_DrawSet_Text.cs
66 66

  
67 67
        public static void DrawDate(Point sp, Point ep, List<Point> pointSet, PdfContentByte contentByte, System.Drawing.Color color, string text, double angle, double opac)
68 68
        {
69

  
70

  
71 69
            bool isError = false;
72 70
            BaseColor bs = new BaseColor(color);
73 71
            contentByte.SaveState();
......
106 104
        
107 105
            var fontSize = (int)size.Height;
108 106
            float width = bf.GetWidthPoint(text, fontSize);
109
            float height = bf.GetAscentPoint(text, fontSize)
110
               - bf.GetDescentPoint(text, fontSize);
111

  
107
            float height = bf.GetAscentPoint(text, fontSize) - bf.GetDescentPoint(text, fontSize);
112 108

  
113 109
            PdfTemplate template = contentByte.CreateTemplate(width, height + 1);
114 110
            template.BeginText();
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs
692 692
                                                            var PaintStyle = control.PaintState;
693 693
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
694 694
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
695
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
695
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
696 696
                                                            double Opacity = control.Opac;
697 697
                                                            DoubleCollection DashSize = control.DashSize;
698 698

  
......
716 716

  
717 717
                                                                var Opacity = control.Opac;
718 718
                                                                string UserID = control.UserID;
719
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
719
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
720 720
                                                                bool IsTransOn = control.IsTransOn;
721 721

  
722 722
                                                                if (control.IsTransOn)
......
743 743
                                                        using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
744 744
                                                        {
745 745
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
746
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
746
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
747 747
                                                            var PaintStyle = control.PaintState;
748 748
                                                            double Angle = control.Angle;
749 749
                                                            DoubleCollection DashSize = control.DashSize;
......
759 759
                                                        using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
760 760
                                                        {
761 761
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
762
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
762
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
763 763
                                                            var PaintStyle = control.Paint;
764 764
                                                            double Angle = control.Angle;
765 765
                                                            //StrokeColor = _SetColor, //색상은 레드
......
776 776
                                                        using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
777 777
                                                        {
778 778
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
779
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
779
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
780 780
                                                            var StartPoint = GetPdfPointSystem(control.StartPoint);
781 781
                                                            var EndPoint = GetPdfPointSystem(control.EndPoint);
782 782
                                                            var PaintStyle = control.PaintState;
......
794 794
                                                        using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
795 795
                                                        {
796 796
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
797
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
797
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
798 798
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
799 799
                                                            double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
800 800

  
......
819 819
                                                        using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
820 820
                                                        {
821 821
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
822
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
822
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
823 823
                                                            double Toler = control.Toler;
824 824
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
825 825
                                                            double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
......
948 948
                                                            //   //testPoint = Test(rect, newMidPoint);
949 949
                                                            //}
950 950

  
951
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
951
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
952 952
                                                            System.Drawing.Color FontColor = _SetColor;
953 953
                                                            bool isHighlight = control.isHighLight;
954 954
                                                            double Opacity = control.Opac;
......
1412 1412
            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1413 1413
            DoubleCollection DashSize = control.DashSize;
1414 1414
            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1415
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
1415
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
1416 1416

  
1417 1417
            double Opacity = control.Opac;
1418 1418

  
......
1440 1440
            var Opacity = control.Opac;
1441 1441
            string UserID = control.UserID;
1442 1442
            double Interval = control.Interval;
1443
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
1443
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
1444 1444
            Controls_PDF.DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, setColor, Opacity);
1445 1445
            switch (control.LineStyleSet)
1446 1446
            {
......
1525 1525
            }
1526 1526
            if (control.isHighLight) paint |= PaintSet.Highlight;
1527 1527

  
1528
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1528
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
1529 1529
            double TextSize = Convert.ToDouble(data2[1]);
1530 1530
            System.Drawing.Color FontColor = setColor;
1531 1531
            double Angle = control.Angle;
FinalService/KCOM_FinalService/MarkupToPDF/Serialize/Core/JsonSerializerHelper.cs
27 27
        /// <param name="json">Json 데이터가 들어와야 합니다.</param>
28 28
        /// <returns></returns>
29 29

  
30

  
31 30
        public static TObj JsonDeserialize<TObj>(this string json)
32 31
        {
33 32

  

내보내기 Unified diff

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