프로젝트

일반

사용자정보

개정판 43e1d368

ID43e1d3684849725d38b5c74b43d4bb593f546d7a
상위 d91efe5c
하위 42d49521

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

issue #0000 코드 정리

Change-Id: I7c8ba4ef6d78a7e4f51b72f226507cddac722939

차이점 보기:

FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs
636 636
                                root.Add(bookmark);
637 637
                            }
638 638

  
639

  
639
                            iTextSharp.text.Version.GetInstance();
640 640
                            using (PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(pdfFilePath, FileMode.Create)))
641 641
                            {
642 642
                                try
......
651 651
                                    SetNotice(FinalItem.ID, "this pdf is not AcroForm.");
652 652
                                }
653 653

  
654
                                var _SetColor = new SolidColorBrush(Colors.Red);
654
                                System.Drawing.Color _SetColor = System.Drawing.Color.FromArgb(255, System.Drawing.Color.Red);
655
                                
655 656

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

  
659 660
                                //pdfStamper.FormFlattening = true; //이미 선처리 작업함
660 661
                                pdfStamper.SetFullCompression();
661
                                _SetColor = new SolidColorBrush(Colors.Red);
662
                                _SetColor = System.Drawing.Color.FromArgb(255, System.Drawing.Color.Red);
662 663

  
663 664
                                StringBuilder strLog = new StringBuilder();
664 665
                                int lastPageNo = 0;
......
754 755
                                                        {
755 756
                                                            string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
756 757
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
758
                                                            var PaintStyle = control.PaintState;
757 759
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
758 760
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
759 761
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
760 762
                                                            double Opacity = control.Opac;
761 763
                                                            DoubleCollection DashSize = control.DashSize;
762 764

  
763
                                                            Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
765
                                                            Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor,PaintStyle| PaintSet.Outline, Opacity);
766
                                                            //Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
764 767
                                                        }
765 768
                                                        break;
766 769
                                                    #endregion
......
830 833
                                                            double Opacity = control.Opac;
831 834
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
832 835

  
833
                                                            Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity);
836
                                                            Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle | PaintSet.Outline, Opacity);
834 837
                                                        }
835 838
                                                        break;
836 839
                                                    #endregion
......
872 875

  
873 876
                                                            double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet));
874 877
                                                            bool reverse = (area < 0);
875
                                                            if (PaintStyle == PaintSet.None)
876
                                                            {
877
                                                                Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
878
                                                            }
879
                                                            else
880
                                                            {
881
                                                                Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
882
                                                            }
878
                                                    
879
                                                            Controls_PDF.DrawSet_Cloud.DrawCloudRect(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity);
883 880
                                                        }
884 881
                                                        break;
885 882
                                                    #endregion
......
1018 1015
                                                            //}
1019 1016

  
1020 1017
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1021
                                                            SolidColorBrush FontColor = _SetColor;
1018
                                                            System.Drawing.Color FontColor = _SetColor;
1022 1019
                                                            bool isHighlight = control.isHighLight;
1023 1020
                                                            double Opacity = control.Opac;
1024 1021
                                                            PaintSet Paint = PaintSet.None;
......
1164 1161
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1165 1162
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1166 1163
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1167
                                                            SolidColorBrush FontColor = _SetColor;
1164
                                                            System.Drawing.Color FontColor = _SetColor;
1168 1165
                                                            double Angle = control.Angle;
1169 1166
                                                            double Opacity = control.Opac;
1170 1167
                                                            Controls_PDF.PDFLib_DrawSet_Text.DrawDate(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Text, Angle, Opacity);
......
1178 1175
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1179 1176
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1180 1177
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1181
                                                            SolidColorBrush FontColor = _SetColor;
1178
                                                            System.Drawing.Color FontColor = _SetColor;
1182 1179
                                                            double Angle = control.Angle;
1183 1180
                                                            double Opacity = control.Opac;
1184 1181

  
......
1188 1185
                                                            {
1189 1186
                                                                var xamldata = Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(stamp.First().VALUE);
1190 1187

  
1188
                                                                var Contents = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP_CONTENTS");
1189
                                                                
1190
                                                                if (Contents?.Count() > 0)
1191
                                                                {
1192
                                                                    foreach (var content in Contents)
1193
                                                                    {
1194
                                                                        xamldata = xamldata.Replace(content.PROPERTY, System.Security.SecurityElement.Escape(content.VALUE));
1195
                                                                    }
1196
                                                                }
1197

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

  
......
1201 1208
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1202 1209
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1203 1210
                                                            List<Point> pointSet = GetPdfPointSystem(control.PointSet);
1204
                                                            SolidColorBrush FontColor = _SetColor;
1211
                                                            System.Drawing.Color FontColor = _SetColor;
1205 1212
                                                            double Angle = control.Angle;
1206 1213
                                                            double Opacity = control.Opac;
1207 1214

  
......
1464 1471
            return result;
1465 1472
        }
1466 1473

  
1467
        private void DrawMultiArrowLine(S_ArrowControl_Multi control, PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2, SolidColorBrush setColor)
1474
        private void DrawMultiArrowLine(S_ArrowControl_Multi control, PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2, System.Drawing.Color setColor)
1468 1475
        {
1469 1476
            string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1470 1477
            Point StartPoint = GetPdfPointSystem(control.StartPoint);
......
1489 1496

  
1490 1497
        }
1491 1498

  
1492
        private void DrawLine(S_LineControl control, PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2, SolidColorBrush setColor)
1499
        private void DrawLine(S_LineControl control, PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2, System.Drawing.Color setColor)
1493 1500
        {
1494 1501
            string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1495 1502
            Point StartPoint = GetPdfPointSystem(control.StartPoint);
......
1509 1516
                    break;
1510 1517
                case LineStyleSet.CancelLine:
1511 1518
                    {
1512
                        var x = Math.Abs((Math.Abs(StartPoint.X) - Math.Abs(EndPoint.X)));
1513
                        var y = Math.Abs((Math.Abs(StartPoint.Y) - Math.Abs(EndPoint.Y)));
1519
                        var x = Math.Abs((Math.Abs(control.StartPoint.X) - Math.Abs(control.EndPoint.X)));
1520
                        var y = Math.Abs((Math.Abs(control.StartPoint.Y) - Math.Abs(control.EndPoint.Y)));
1521

  
1522
                        Point newStartPoint = new Point();
1523
                        Point newEndPoint = new Point();
1514 1524

  
1515 1525
                        if (x > y)
1516 1526
                        {
1517
                            StartPoint = new Point(StartPoint.X, StartPoint.Y - (float)(control.Interval / 3.0));
1518
                            EndPoint = new Point(EndPoint.X, EndPoint.Y - (float)(control.Interval / 3.0));
1519
                            Controls_PDF.DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, DashSize, setColor, Opacity);
1527
                            newStartPoint = new Point(control.StartPoint.X, control.StartPoint.Y + control.Interval);
1528
                            newEndPoint = new Point(control.EndPoint.X, control.EndPoint.Y + control.Interval);
1520 1529
                        }
1530
                        else
1531
                        {
1532
                            newStartPoint = new Point(control.StartPoint.X + control.Interval, control.StartPoint.Y);
1533
                            newEndPoint = new Point(control.EndPoint.X + control.Interval, control.EndPoint.Y);
1534
                        }
1535

  
1536
                        newStartPoint = GetPdfPointSystem(newStartPoint);
1537
                        newEndPoint = GetPdfPointSystem(newEndPoint);
1538

  
1539
                        Controls_PDF.DrawSet_Line.DrawLine(newStartPoint, newEndPoint, LineSize, contentByte, DashSize, setColor, Opacity);
1521 1540
                    }
1522 1541
                    break;
1523 1542
                case LineStyleSet.TwinLine:
......
1539 1558

  
1540 1559
        }
1541 1560

  
1542
        private void DrawTextBox(S_TextControl control,PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2,SolidColorBrush setColor)
1561
        private void DrawTextBox(S_TextControl control,PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2,System.Drawing.Color setColor)
1543 1562
        {
1544 1563
            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1545 1564
            string Text = control.Text;
......
1554 1573
            List<Point> pointSet = new List<Point>();
1555 1574
            pointSet.Add(StartPoint);
1556 1575
            pointSet.Add(EndPoint);
1557

  
1576
            
1558 1577
            PaintSet paint = PaintSet.None;
1559 1578
            switch (control.paintMethod)
1560 1579
            {
......
1575 1594

  
1576 1595
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1577 1596
            double TextSize = Convert.ToDouble(data2[1]);
1578
            SolidColorBrush FontColor = setColor;
1597
            System.Drawing.Color FontColor = setColor;
1579 1598
            double Angle = control.Angle;
1580 1599
            double Opacity = control.Opac;
1581 1600
            FontFamily fontfamilly = FontHelper.GetFontFamily(control.fontConfig[0]);

내보내기 Unified diff

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