프로젝트

일반

사용자정보

개정판 4804a4fb

ID4804a4fb9474afcd10ce2b091ff16f01264ebae4
상위 2dfbf711
하위 836132c4

백흠경이(가) 5년 이상 전에 추가함

issue #937: line size 계산 로직 수정, 텍스트가 뒤집혀 나오는 현상 수정, arc length 계산 로직 추가

Change-Id: I74b1e59bd6f2983c8cc107ea34654ecf791fc470

차이점 보기:

FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs
333 333
        #endregion
334 334

  
335 335
        #region PDF
336
        float scaleWidth = 0;
337
        float scaleHeight = 0;
338

  
336
        public static float scaleWidth = 0;
337
        public static float scaleHeight = 0;
339 338
         
340 339
        private string SetFlattingPDF(string tempFileInfo)
341 340
        {
......
496 495
                            
497 496
                            foreach (var data in markedData)
498 497
                            {
499
                                
500 498
                                var item = JsonSerializerHelper.UnCompressString(data);
501
                                //item = data.Replace("H", "_h");
502 499
                                var ControlT = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item);
503 500

  
504 501
                                try
......
519 516
                                                    var Opacity = control.Opac;
520 517
                                                    string UserID = control.UserID;
521 518
                                                    double Interval = control.Interval;
522
                                                    double LineSize = Convert.ToDouble(InnerData.First());
519
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
523 520
                                                    Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, _SetColor, Opacity);
524 521
                                                    switch (control.LineStyleSet)
525 522
                                                    {
526
                                                        //case LineStyleSet.SingleLine:
527
                                                        //    Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
528
                                                        //    break;
529 523
                                                        case LineStyleSet.ArrowLine:
530
                                                            //Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity);
531 524
                                                            Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
532 525
                                                            break;
533 526
                                                        case LineStyleSet.CancelLine:
......
546 539
                                                        case LineStyleSet.TwinLine:
547 540
                                                            {
548 541
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
549
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.ConverseAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
550
                                                                //Controls_PDF.HoneyPDFLib_DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, _SetColor, Opacity);
542
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
551 543
                                                            }
552 544
                                                            break;
553 545
                                                        case LineStyleSet.DimLine:
554 546
                                                            {
555 547
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.DimAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
556 548
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
557
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.ConverseAllow(EndPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity);
549
                                                                Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(StartPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity);
558 550
                                                            }
559 551
                                                            break;
560 552
                                                        default:
......
577 569
                                                    Point EndPoint = GetPdfPointSystem(control.EndPoint);
578 570
                                                    DoubleCollection DashSize = control.DashSize;
579 571
                                                    List<Point> PointSet = GetPdfPointSystem(control.PointSet);
580
                                                    double LineSize = Convert.ToDouble(InnerData.First());
572
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
581 573

  
582 574
                                                    double Opacity = control.Opac;
583 575

  
......
604 596
                                                Point StartPoint = GetPdfPointSystem(control.StartPoint);
605 597
                                                Point EndPoint = GetPdfPointSystem(control.EndPoint);
606 598
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
607
                                                double LineSize = Convert.ToDouble(InnerData.First());
599
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
608 600
                                                double Opacity = control.Opac;
609 601
                                                DoubleCollection DashSize = control.DashSize;
610 602

  
......
626 618

  
627 619
                                                    var Opacity = control.Opac;
628 620
                                                    string UserID = control.UserID;
629
                                                    double LineSize = Convert.ToDouble(InnerData.First());
621
                                                    double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
630 622
                                                    bool IsTransOn = control.IsTransOn;
631 623

  
632 624
                                                    if (control.IsTransOn)
633 625
                                                    {
634 626
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
635
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.ConverseAllow(EndPoint, MidPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
627
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true);
636 628
                                                    }
637 629
                                                    else
638 630
                                                    {
......
648 640
                                        using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
649 641
                                        {
650 642
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
651
                                                double LineSize = Convert.ToDouble(data2.First());
643
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
652 644
                                                var PaintStyle = control.PaintState;
653 645
                                                double Angle = control.Angle;
654 646
                                                DoubleCollection DashSize = control.DashSize;
......
664 656
                                        using (S_TriControl control  = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
665 657
                                        {
666 658
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
667
                                                double LineSize = Convert.ToDouble(data2.First());
659
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
668 660
                                                var PaintStyle = control.Paint;
669 661
                                                double Angle = control.Angle;
670 662
                                                //StrokeColor = _SetColor, //색상은 레드
......
681 673
                                            using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
682 674
                                            {
683 675
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
684
                                                double LineSize = Convert.ToDouble(data2.First());
676
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
685 677
                                                var StartPoint = GetPdfPointSystem(control.StartPoint);
686 678
                                                var EndPoint = GetPdfPointSystem(control.EndPoint);
687 679
                                                var PaintStyle = control.PaintState;
......
699 691
                                            using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
700 692
                                            {
701 693
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
702
                                                double LineSize = Convert.ToDouble(data2.First());
694
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
703 695
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
704
                                                //double ArcLength = 30;
705 696
                                                double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
706 697

  
707

  
708
                                                double ArcLength = control.ArcLength == 0 ? 10 : control.ArcLength;
698
                                                double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength)/(scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
709 699

  
710 700
                                                var PaintStyle = control.PaintState;
711 701
                                                double Opacity = control.Opac;
......
732 722
                                            using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
733 723
                                            {
734 724
                                                string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
735
                                                double LineSize = Convert.ToDouble(data2.First());
725
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
736 726
                                                double Toler = control.Toler;
737 727
                                                List<Point> PointSet = GetPdfPointSystem(control.PointSet);
738
                                                double ArcLength = control.ArcLength == 0 ? 10 : control.ArcLength;
728
                                                double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength)/(scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
739 729
                                                var PaintStyle = control.PaintState;
740 730
                                                double Opacity = control.Opac;
741 731
                                                bool isTransOn = control.IsTrans;
......
807 797
                                                }
808 798
                                                if (control.isHighLight) paint |= PaintSet.Highlight;
809 799

  
810
                                                double LineSize = Convert.ToDouble(data2.First());
800
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
811 801
                                                double TextSize = Convert.ToDouble(data2[1]);
812 802
                                                SolidColorBrush FontColor = _SetColor;
813 803
                                                double Angle = control.Angle;
......
837 827
                                                    decoration = TextDecorations.Underline;
838 828
                                                }
839 829

  
840
                                                if (LineSize <= 3)
841
                                                {
842
                                                    LineSize = 3;
843
                                                }
844

  
845 830
                                                Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString(StartPoint, EndPoint, LineSize, contentByte, _SetColor, paint, TextSize, fontfamilly, fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
846 831
                                            }
847 832
                                            break;
......
873 858
                                                var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint);
874 859
                                                var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint);
875 860

  
876
                                                double LineSize = Convert.ToDouble(data2.First());
861
                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
877 862
                                                SolidColorBrush FontColor = _SetColor;
878 863
                                                bool isHighlight = control.isHighLight;
879 864
                                                double Opacity = control.Opac;
......
983 968
                                                        Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), 
984 969
                                                            newStartPoint, newMidPoint,
985 970
                                                            LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, new FontFamily(), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
986

  
987

  
988 971
                                                        }
989
                                                }
990

  
972
                                                    }
991 973
                                                }
992 974
                                                catch (Exception ex)
993 975
                                                {

내보내기 Unified diff

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