개정판 50ffdad1
Fix: FinalSerivce에서 Z 정렬을 적용하도록 수정
Change-Id: I7bb3e4cdda1e3fdd2516bad6475192cdf5f731b8
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
27 | 27 |
} |
28 | 28 |
|
29 | 29 |
#region 초기 데이터 |
30 |
private static iTextSharp.text.Rectangle mediaBox; |
|
31 | 30 |
private FileInfo PdfFilePath = null; |
32 | 31 |
private FileInfo FinalPDFPath = null; |
33 | 32 |
private string _FinalPDFStorgeLocal = null; |
... | ... | |
616 | 615 |
})); |
617 | 616 |
} |
618 | 617 |
|
619 |
var ordered = items.OrderBy(x => x.Item2.ZIndex);
|
|
618 |
var zgroups = items.GroupBy(x => x.Item2.ZIndex).OrderBy(x => x.Key);
|
|
620 | 619 |
#endregion |
621 | 620 |
|
622 |
foreach (var order in ordered)
|
|
621 |
foreach (var zgroup in zgroups)
|
|
623 | 622 |
{ |
624 |
/// 2020.11.13 김태성 |
|
625 |
/// 원본 PDF의 페이지수가 변경된 경우 이전 markup의 페이지를 찾지 못해 수정함. |
|
626 |
var pageitems = DocPageItem.Where(d => d.PAGE_NUMBER == PageNumber); |
|
627 |
if (pageitems.Any()) |
|
623 |
var ordered = zgroup.OrderBy(x => x.Item2.Index); |
|
624 |
foreach (var order in ordered) |
|
628 | 625 |
{ |
629 |
var currentPage = pageitems.First(); |
|
630 |
pdfSize = pdfReader.GetPageSizeWithRotation(PageNumber); |
|
631 |
lastPageNo = PageNumber; |
|
626 |
/// 2020.11.13 김태성 |
|
627 |
/// 원본 PDF의 페이지수가 변경된 경우 이전 markup의 페이지를 찾지 못해 수정함. |
|
628 |
var pageitems = DocPageItem.Where(d => d.PAGE_NUMBER == PageNumber); |
|
629 |
if (pageitems.Any()) |
|
630 |
{ |
|
631 |
var currentPage = pageitems.First(); |
|
632 |
pdfSize = pdfReader.GetPageSizeWithRotation(PageNumber); |
|
633 |
lastPageNo = PageNumber; |
|
632 | 634 |
|
633 |
mediaBox = pdfReader.GetPageSize(PageNumber); |
|
634 |
var cropBox = pdfReader.GetCropBox(PageNumber); |
|
635 |
iTextSharp.text.Rectangle mediaBox = pdfReader.GetPageSize(PageNumber);
|
|
636 |
var cropBox = pdfReader.GetCropBox(PageNumber);
|
|
635 | 637 |
|
636 |
/// media box와 crop box가 다를 경우 media box를 crop box와 일치시킨다 |
|
637 |
if (cropBox != null && |
|
638 |
(cropBox.Left != mediaBox.Left || cropBox.Top != mediaBox.Top || cropBox.Right != mediaBox.Right || cropBox.Bottom != mediaBox.Bottom)) |
|
639 |
{ |
|
640 |
PdfDictionary dict = pdfReader.GetPageN(PageNumber); |
|
638 |
/// media box와 crop box가 다를 경우 media box를 crop box와 일치시킨다
|
|
639 |
if (cropBox != null &&
|
|
640 |
(cropBox.Left != mediaBox.Left || cropBox.Top != mediaBox.Top || cropBox.Right != mediaBox.Right || cropBox.Bottom != mediaBox.Bottom))
|
|
641 |
{
|
|
642 |
PdfDictionary dict = pdfReader.GetPageN(PageNumber);
|
|
641 | 643 |
|
642 |
PdfArray oNewMediaBox = new PdfArray(); |
|
643 |
oNewMediaBox.Add(new PdfNumber(cropBox.Left)); |
|
644 |
oNewMediaBox.Add(new PdfNumber(cropBox.Top)); |
|
645 |
oNewMediaBox.Add(new PdfNumber(cropBox.Right)); |
|
646 |
oNewMediaBox.Add(new PdfNumber(cropBox.Bottom)); |
|
647 |
dict.Put(PdfName.MEDIABOX, oNewMediaBox); |
|
644 |
PdfArray oNewMediaBox = new PdfArray();
|
|
645 |
oNewMediaBox.Add(new PdfNumber(cropBox.Left));
|
|
646 |
oNewMediaBox.Add(new PdfNumber(cropBox.Top));
|
|
647 |
oNewMediaBox.Add(new PdfNumber(cropBox.Right));
|
|
648 |
oNewMediaBox.Add(new PdfNumber(cropBox.Bottom));
|
|
649 |
dict.Put(PdfName.MEDIABOX, oNewMediaBox);
|
|
648 | 650 |
|
649 |
pdfSize = cropBox; |
|
650 |
} |
|
651 |
pdfSize = cropBox;
|
|
652 |
}
|
|
651 | 653 |
|
652 |
scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width; |
|
653 |
scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height; |
|
654 |
scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width;
|
|
655 |
scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height;
|
|
654 | 656 |
|
655 |
pdfLink.CURRENT_PAGE = PageNumber; |
|
656 |
_entity.SaveChanges(); |
|
657 |
pdfLink.CURRENT_PAGE = PageNumber;
|
|
658 |
_entity.SaveChanges();
|
|
657 | 659 |
|
658 |
PdfContentByte contentByte = pdfStamper.GetOverContent(PageNumber); |
|
659 |
var item = order.Item1; |
|
660 |
var ControlT = order.Item2; |
|
660 |
PdfContentByte contentByte = pdfStamper.GetOverContent(PageNumber);
|
|
661 |
var item = order.Item1;
|
|
662 |
var ControlT = order.Item2;
|
|
661 | 663 |
|
662 |
try |
|
663 |
{ |
|
664 |
switch (ControlT.Name) |
|
664 |
try |
|
665 | 665 |
{ |
666 |
#region LINE
|
|
667 |
case "LineControl":
|
|
668 |
{
|
|
669 |
using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
|
|
666 |
switch (ControlT.Name)
|
|
667 |
{
|
|
668 |
#region LINE
|
|
669 |
case "LineControl":
|
|
670 | 670 |
{ |
671 |
DrawLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
671 |
using (S_LineControl control = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item)) |
|
672 |
{ |
|
673 |
DrawLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
674 |
} |
|
672 | 675 |
} |
673 |
} |
|
674 |
break; |
|
675 |
#endregion |
|
676 |
#region ArrowControlMulti |
|
677 |
case "ArrowControl_Multi": |
|
678 |
{ |
|
679 |
using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item)) |
|
676 |
break; |
|
677 |
#endregion |
|
678 |
#region ArrowControlMulti |
|
679 |
case "ArrowControl_Multi": |
|
680 | 680 |
{ |
681 |
DrawMultiArrowLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
681 |
using (S_ArrowControl_Multi control = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item)) |
|
682 |
{ |
|
683 |
DrawMultiArrowLine(control, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
684 |
} |
|
682 | 685 |
} |
683 |
} |
|
684 |
break; |
|
685 |
#endregion |
|
686 |
#region PolyControl |
|
687 |
case "PolygonControl": |
|
688 |
using (S_PolyControl control = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item)) |
|
689 |
{ |
|
690 |
string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
691 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
692 |
var PaintStyle = control.PaintState; |
|
693 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
694 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
695 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth); |
|
696 |
double Opacity = control.Opac; |
|
697 |
DoubleCollection DashSize = control.DashSize; |
|
698 |
|
|
699 |
Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle | PaintSet.Outline, Opacity); |
|
700 |
//Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity); |
|
701 |
} |
|
702 |
break; |
|
703 |
#endregion |
|
704 |
#region ArcControl or ArrowArcControl |
|
705 |
case "ArcControl": |
|
706 |
case "ArrowArcControl": |
|
707 |
{ |
|
708 |
using (S_ArcControl control = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item)) |
|
686 |
break; |
|
687 |
#endregion |
|
688 |
#region PolyControl |
|
689 |
case "PolygonControl": |
|
690 |
using (S_PolyControl control = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item)) |
|
709 | 691 |
{ |
710 | 692 |
string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
711 | 693 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
694 |
var PaintStyle = control.PaintState; |
|
712 | 695 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
713 |
Point MidPoint = GetPdfPointSystem(control.MidPoint); |
|
714 |
DoubleCollection DashSize = control.DashSize; |
|
715 | 696 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
716 |
|
|
717 |
var Opacity = control.Opac; |
|
718 |
string UserID = control.UserID; |
|
719 | 697 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth); |
720 |
bool IsTransOn = control.IsTransOn; |
|
721 |
|
|
722 |
if (control.IsTransOn) |
|
723 |
{ |
|
724 |
Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true); |
|
725 |
Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true); |
|
726 |
} |
|
727 |
else |
|
728 |
{ |
|
729 |
Controls_PDF.DrawSet_Arc.DrawArc(StartPoint, MidPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity); |
|
730 |
} |
|
698 |
double Opacity = control.Opac; |
|
699 |
DoubleCollection DashSize = control.DashSize; |
|
731 | 700 |
|
732 |
if (ControlT.Name == "ArrowArcControl") |
|
733 |
{ |
|
734 |
Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity); |
|
735 |
Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity); |
|
736 |
} |
|
737 |
} |
|
738 |
} |
|
739 |
break; |
|
740 |
#endregion |
|
741 |
#region RectangleControl |
|
742 |
case "RectangleControl": |
|
743 |
using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item)) |
|
744 |
{ |
|
745 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
746 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
747 |
var PaintStyle = control.PaintState; |
|
748 |
double Angle = control.Angle; |
|
749 |
DoubleCollection DashSize = control.DashSize; |
|
750 |
double Opacity = control.Opac; |
|
751 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
752 |
|
|
753 |
Controls_PDF.DrawSet_Shape.DrawRectangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity); |
|
754 |
} |
|
755 |
break; |
|
756 |
#endregion |
|
757 |
#region TriControl |
|
758 |
case "TriControl": |
|
759 |
using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item)) |
|
760 |
{ |
|
761 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
762 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
763 |
var PaintStyle = control.Paint; |
|
764 |
double Angle = control.Angle; |
|
765 |
//StrokeColor = _SetColor, //색상은 레드 |
|
766 |
DoubleCollection DashSize = control.DashSize; |
|
767 |
double Opacity = control.Opac; |
|
768 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
769 |
|
|
770 |
Controls_PDF.DrawSet_Shape.DrawTriangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle | PaintSet.Outline, Opacity); |
|
771 |
} |
|
772 |
break; |
|
773 |
#endregion |
|
774 |
#region CircleControl |
|
775 |
case "CircleControl": |
|
776 |
using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item)) |
|
777 |
{ |
|
778 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
779 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
780 |
var StartPoint = GetPdfPointSystem(control.StartPoint); |
|
781 |
var EndPoint = GetPdfPointSystem(control.EndPoint); |
|
782 |
var PaintStyle = control.PaintState; |
|
783 |
double Angle = control.Angle; |
|
784 |
DoubleCollection DashSize = control.DashSize; |
|
785 |
double Opacity = control.Opac; |
|
786 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
787 |
Controls_PDF.DrawSet_Shape.DrawCircle(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity, Angle, PointSet); |
|
788 |
|
|
789 |
} |
|
790 |
break; |
|
791 |
#endregion |
|
792 |
#region RectCloudControl |
|
793 |
case "RectCloudControl": |
|
794 |
using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item)) |
|
795 |
{ |
|
796 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
797 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
798 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
799 |
double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint)); |
|
800 |
|
|
801 |
double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight); |
|
802 |
|
|
803 |
var PaintStyle = control.PaintState; |
|
804 |
double Opacity = control.Opac; |
|
805 |
DoubleCollection DashSize = control.DashSize; |
|
806 |
|
|
807 |
//드로잉 방식이 표현되지 않음 |
|
808 |
var rotate = returnAngle(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint)); |
|
809 |
|
|
810 |
double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet)); |
|
811 |
bool reverse = (area < 0); |
|
812 |
|
|
813 |
Controls_PDF.DrawSet_Cloud.DrawCloudRect(PointSet, LineSize, (int)rotate, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity); |
|
814 |
} |
|
815 |
break; |
|
816 |
#endregion |
|
817 |
#region CloudControl |
|
818 |
case "CloudControl": |
|
819 |
using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item)) |
|
820 |
{ |
|
821 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
822 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
823 |
double Toler = control.Toler; |
|
824 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
825 |
double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight); |
|
826 |
var PaintStyle = control.PaintState; |
|
827 |
double Opacity = control.Opac; |
|
828 |
bool isTransOn = control.IsTrans; |
|
829 |
bool isChain = control.IsChain; |
|
830 |
|
|
831 |
DoubleCollection DashSize = control.DashSize; |
|
832 |
|
|
833 |
if (isChain) |
|
834 |
{ |
|
835 |
Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity); |
|
701 |
Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle | PaintSet.Outline, Opacity); |
|
702 |
//Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity); |
|
836 | 703 |
} |
837 |
else |
|
704 |
break; |
|
705 |
#endregion |
|
706 |
#region ArcControl or ArrowArcControl |
|
707 |
case "ArcControl": |
|
708 |
case "ArrowArcControl": |
|
838 | 709 |
{ |
839 |
if (isTransOn)
|
|
710 |
using (S_ArcControl control = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
|
|
840 | 711 |
{ |
841 |
double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet)); |
|
842 |
bool reverse = (area < 0); |
|
843 |
|
|
844 |
if (PaintStyle == PaintSet.None) |
|
712 |
string[] InnerData = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
713 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
714 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
715 |
Point MidPoint = GetPdfPointSystem(control.MidPoint); |
|
716 |
DoubleCollection DashSize = control.DashSize; |
|
717 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
718 |
|
|
719 |
var Opacity = control.Opac; |
|
720 |
string UserID = control.UserID; |
|
721 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth); |
|
722 |
bool IsTransOn = control.IsTransOn; |
|
723 |
|
|
724 |
if (control.IsTransOn) |
|
845 | 725 |
{ |
846 |
Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity); |
|
726 |
Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, StartPoint, (int)LineSize, contentByte, _SetColor, Opacity, true); |
|
727 |
Controls_PDF.DrawSet_Arrow.SingleAllow(MidPoint, EndPoint, (int)LineSize, contentByte, _SetColor, Opacity, true); |
|
847 | 728 |
} |
848 | 729 |
else |
849 | 730 |
{ |
850 |
Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity); |
|
731 |
Controls_PDF.DrawSet_Arc.DrawArc(StartPoint, MidPoint, EndPoint, LineSize, contentByte, _SetColor, Opacity); |
|
732 |
} |
|
733 |
|
|
734 |
if (ControlT.Name == "ArrowArcControl") |
|
735 |
{ |
|
736 |
Controls_PDF.DrawSet_Arrow.SingleAllow(StartPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity); |
|
737 |
Controls_PDF.DrawSet_Arrow.SingleAllow(EndPoint, MidPoint, LineSize, contentByte, _SetColor, Opacity); |
|
851 | 738 |
} |
852 |
} |
|
853 |
else |
|
854 |
{ |
|
855 |
Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, control.DashSize, _SetColor, PaintStyle, Opacity); |
|
856 | 739 |
} |
857 | 740 |
} |
858 |
} |
|
859 |
break; |
|
860 |
#endregion |
|
861 |
#region TEXT |
|
862 |
case "TextControl": |
|
863 |
using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item)) |
|
864 |
{ |
|
865 |
DrawTextBox(control, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
866 |
} |
|
867 |
break; |
|
868 |
#endregion |
|
869 |
#region ArrowTextControl |
|
870 |
case "ArrowTextControl": |
|
871 |
using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item)) |
|
872 |
{ |
|
873 |
//using (S_TextControl textcontrol = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item)) |
|
874 |
//{ |
|
875 |
// textcontrol.Angle = control.Angle; |
|
876 |
// textcontrol.BoxH = control.BoxHeight; |
|
877 |
// textcontrol.BoxW = control.BoxWidth; |
|
878 |
// textcontrol.EndPoint = control.EndPoint; |
|
879 |
// textcontrol.FontColor = "#FFFF0000"; |
|
880 |
// textcontrol.Name = "TextControl"; |
|
881 |
// textcontrol.Opac = control.Opac; |
|
882 |
// textcontrol.PointSet = new List<Point>(); |
|
883 |
// textcontrol.SizeSet = string.Join(delimiterChars2.First(), control.SizeSet.First(), control.fontConfig[3]); |
|
884 |
// textcontrol.StartPoint = control.StartPoint; |
|
885 |
// textcontrol.Text = control.ArrowText; |
|
886 |
// textcontrol.TransformPoint = control.TransformPoint; |
|
887 |
// textcontrol.UserID = null; |
|
888 |
// textcontrol.fontConfig = control.fontConfig; |
|
889 |
// textcontrol.isHighLight = control.isHighLight; |
|
890 |
// textcontrol.paintMethod = 1; |
|
891 |
|
|
892 |
// DrawTextBox(textcontrol, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
893 |
//} |
|
894 |
|
|
895 |
//using (S_ArrowControl_Multi linecontrol = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item)) |
|
896 |
//{ |
|
897 |
// linecontrol.Angle = control.Angle; |
|
898 |
// linecontrol.DashSize = new DoubleCollection(new[] {(double)999999 }); |
|
899 |
// linecontrol.EndPoint = control.EndPoint; |
|
900 |
// linecontrol.MidPoint = control.MidPoint; |
|
901 |
// linecontrol.Name = "ArrowControl_Multi"; |
|
902 |
// linecontrol.Opac = control.Opac; |
|
903 |
// linecontrol.PointSet = control.PointSet; |
|
904 |
// linecontrol.SizeSet = control.SizeSet; |
|
905 |
// linecontrol.StartPoint = control.StartPoint; |
|
906 |
// linecontrol.StrokeColor = control.StrokeColor; |
|
907 |
// linecontrol.TransformPoint = control.TransformPoint; |
|
908 |
|
|
909 |
// DrawMultiArrowLine(linecontrol, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
910 |
//} |
|
911 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
912 |
Point tempStartPoint = GetPdfPointSystem(control.StartPoint); |
|
913 |
Point tempMidPoint = GetPdfPointSystem(control.MidPoint); |
|
914 |
Point tempEndPoint = GetPdfPointSystem(control.EndPoint); |
|
915 |
bool isUnderLine = false; |
|
916 |
string Text = ""; |
|
917 |
double fontsize = 30; |
|
918 |
|
|
919 |
System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight); |
|
920 |
Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight)); |
|
921 |
List<Point> tempPoint = new List<Point>(); |
|
922 |
|
|
923 |
double Angle = control.Angle; |
|
924 |
|
|
925 |
if (Math.Abs(Angle).ToString() == "90") |
|
741 |
break; |
|
742 |
#endregion |
|
743 |
#region RectangleControl |
|
744 |
case "RectangleControl": |
|
745 |
using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item)) |
|
926 | 746 |
{ |
927 |
Angle = 270; |
|
747 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
748 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
749 |
var PaintStyle = control.PaintState; |
|
750 |
double Angle = control.Angle; |
|
751 |
DoubleCollection DashSize = control.DashSize; |
|
752 |
double Opacity = control.Opac; |
|
753 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
754 |
|
|
755 |
Controls_PDF.DrawSet_Shape.DrawRectangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity); |
|
928 | 756 |
} |
929 |
else if (Math.Abs(Angle).ToString() == "270") |
|
757 |
break; |
|
758 |
#endregion |
|
759 |
#region TriControl |
|
760 |
case "TriControl": |
|
761 |
using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item)) |
|
930 | 762 |
{ |
931 |
Angle = 90; |
|
763 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
764 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
765 |
var PaintStyle = control.Paint; |
|
766 |
double Angle = control.Angle; |
|
767 |
//StrokeColor = _SetColor, //색상은 레드 |
|
768 |
DoubleCollection DashSize = control.DashSize; |
|
769 |
double Opacity = control.Opac; |
|
770 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
771 |
|
|
772 |
Controls_PDF.DrawSet_Shape.DrawTriangle(PointSet, LineSize, contentByte, DashSize, _SetColor, PaintStyle | PaintSet.Outline, Opacity); |
|
932 | 773 |
} |
774 |
break; |
|
775 |
#endregion |
|
776 |
#region CircleControl |
|
777 |
case "CircleControl": |
|
778 |
using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item)) |
|
779 |
{ |
|
780 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
781 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
782 |
var StartPoint = GetPdfPointSystem(control.StartPoint); |
|
783 |
var EndPoint = GetPdfPointSystem(control.EndPoint); |
|
784 |
var PaintStyle = control.PaintState; |
|
785 |
double Angle = control.Angle; |
|
786 |
DoubleCollection DashSize = control.DashSize; |
|
787 |
double Opacity = control.Opac; |
|
788 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
789 |
Controls_PDF.DrawSet_Shape.DrawCircle(StartPoint, EndPoint, LineSize, contentByte, DashSize, _SetColor, PaintStyle, Opacity, Angle, PointSet); |
|
933 | 790 |
|
934 |
var tempRectMidPoint = MathSet.getRectMiddlePoint(rect); |
|
935 |
tempPoint.Add(new Point(rect.Left, tempRectMidPoint.Y)); |
|
936 |
tempPoint.Add(new Point(tempRectMidPoint.X, rect.Top)); |
|
937 |
tempPoint.Add(new Point(rect.Right, tempRectMidPoint.Y)); |
|
938 |
tempPoint.Add(new Point(tempRectMidPoint.X, rect.Bottom)); |
|
939 |
|
|
940 |
var newStartPoint = tempStartPoint; |
|
941 |
var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint); |
|
942 |
var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint); |
|
943 |
|
|
944 |
//Point testPoint = tempEndPoint; |
|
945 |
//if (Angle != 0) |
|
946 |
//{ |
|
947 |
// testPoint = GetArrowTextControlTestPoint(0, newMidPoint, tempPoint, control.isFixed); |
|
948 |
// //testPoint = Test(rect, newMidPoint); |
|
949 |
//} |
|
950 |
|
|
951 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
952 |
System.Drawing.Color FontColor = _SetColor; |
|
953 |
bool isHighlight = control.isHighLight; |
|
954 |
double Opacity = control.Opac; |
|
955 |
PaintSet Paint = PaintSet.None; |
|
956 |
|
|
957 |
switch (control.ArrowStyle) |
|
791 |
} |
|
792 |
break; |
|
793 |
#endregion |
|
794 |
#region RectCloudControl |
|
795 |
case "RectCloudControl": |
|
796 |
using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item)) |
|
958 | 797 |
{ |
959 |
case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal: |
|
960 |
{ |
|
961 |
Paint = PaintSet.None; |
|
962 |
} |
|
963 |
break; |
|
964 |
case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud: |
|
798 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
799 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
800 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
801 |
double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint)); |
|
802 |
|
|
803 |
double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight); |
|
804 |
|
|
805 |
var PaintStyle = control.PaintState; |
|
806 |
double Opacity = control.Opac; |
|
807 |
DoubleCollection DashSize = control.DashSize; |
|
808 |
|
|
809 |
//드로잉 방식이 표현되지 않음 |
|
810 |
var rotate = returnAngle(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint)); |
|
811 |
|
|
812 |
double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet)); |
|
813 |
bool reverse = (area < 0); |
|
814 |
|
|
815 |
Controls_PDF.DrawSet_Cloud.DrawCloudRect(PointSet, LineSize, (int)rotate, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity); |
|
816 |
} |
|
817 |
break; |
|
818 |
#endregion |
|
819 |
#region CloudControl |
|
820 |
case "CloudControl": |
|
821 |
using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item)) |
|
822 |
{ |
|
823 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
824 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
825 |
double Toler = control.Toler; |
|
826 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
827 |
double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight); |
|
828 |
var PaintStyle = control.PaintState; |
|
829 |
double Opacity = control.Opac; |
|
830 |
bool isTransOn = control.IsTrans; |
|
831 |
bool isChain = control.IsChain; |
|
832 |
|
|
833 |
DoubleCollection DashSize = control.DashSize; |
|
834 |
|
|
835 |
if (isChain) |
|
836 |
{ |
|
837 |
Controls_PDF.DrawSet_Line.DrawLine(PointSet, LineSize, contentByte, DashSize, _SetColor, Opacity); |
|
838 |
} |
|
839 |
else |
|
840 |
{ |
|
841 |
if (isTransOn) |
|
965 | 842 |
{ |
966 |
Paint = PaintSet.Hatch; |
|
843 |
double area = MathSet.AreaOf(GetPdfPointSystem(control.PointSet)); |
|
844 |
bool reverse = (area < 0); |
|
845 |
|
|
846 |
if (PaintStyle == PaintSet.None) |
|
847 |
{ |
|
848 |
Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity); |
|
849 |
} |
|
850 |
else |
|
851 |
{ |
|
852 |
Controls_PDF.DrawSet_Cloud.DrawCloud(PointSet, LineSize, ArcLength, contentByte, control.DashSize, _SetColor, _SetColor, PaintStyle, Opacity); |
|
853 |
} |
|
967 | 854 |
} |
968 |
break; |
|
969 |
case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect: |
|
855 |
else |
|
970 | 856 |
{ |
971 |
Paint = PaintSet.Fill;
|
|
857 |
Controls_PDF.DrawSet_Shape.DrawPolygon(PointSet, LineSize, contentByte, control.DashSize, _SetColor, PaintStyle, Opacity);
|
|
972 | 858 |
} |
973 |
break; |
|
974 |
default: |
|
975 |
break; |
|
976 |
} |
|
977 |
if (control.isHighLight) Paint |= PaintSet.Highlight; |
|
978 |
|
|
979 |
if (Paint == PaintSet.Hatch) |
|
980 |
{ |
|
981 |
Text = control.ArrowText; |
|
859 |
} |
|
982 | 860 |
} |
983 |
else |
|
861 |
break; |
|
862 |
#endregion |
|
863 |
#region TEXT |
|
864 |
case "TextControl": |
|
865 |
using (S_TextControl control = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item)) |
|
984 | 866 |
{ |
985 |
Text = control.ArrowText;
|
|
867 |
DrawTextBox(control, contentByte, delimiterChars, delimiterChars2, _SetColor);
|
|
986 | 868 |
} |
987 |
|
|
988 |
try |
|
869 |
break; |
|
870 |
#endregion |
|
871 |
#region ArrowTextControl |
|
872 |
case "ArrowTextControl": |
|
873 |
using (S_ArrowTextControl control = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item)) |
|
989 | 874 |
{ |
990 |
if (control.fontConfig.Count == 4) |
|
875 |
//using (S_TextControl textcontrol = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item)) |
|
876 |
//{ |
|
877 |
// textcontrol.Angle = control.Angle; |
|
878 |
// textcontrol.BoxH = control.BoxHeight; |
|
879 |
// textcontrol.BoxW = control.BoxWidth; |
|
880 |
// textcontrol.EndPoint = control.EndPoint; |
|
881 |
// textcontrol.FontColor = "#FFFF0000"; |
|
882 |
// textcontrol.Name = "TextControl"; |
|
883 |
// textcontrol.Opac = control.Opac; |
|
884 |
// textcontrol.PointSet = new List<Point>(); |
|
885 |
// textcontrol.SizeSet = string.Join(delimiterChars2.First(), control.SizeSet.First(), control.fontConfig[3]); |
|
886 |
// textcontrol.StartPoint = control.StartPoint; |
|
887 |
// textcontrol.Text = control.ArrowText; |
|
888 |
// textcontrol.TransformPoint = control.TransformPoint; |
|
889 |
// textcontrol.UserID = null; |
|
890 |
// textcontrol.fontConfig = control.fontConfig; |
|
891 |
// textcontrol.isHighLight = control.isHighLight; |
|
892 |
// textcontrol.paintMethod = 1; |
|
893 |
|
|
894 |
// DrawTextBox(textcontrol, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
895 |
//} |
|
896 |
|
|
897 |
//using (S_ArrowControl_Multi linecontrol = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item)) |
|
898 |
//{ |
|
899 |
// linecontrol.Angle = control.Angle; |
|
900 |
// linecontrol.DashSize = new DoubleCollection(new[] {(double)999999 }); |
|
901 |
// linecontrol.EndPoint = control.EndPoint; |
|
902 |
// linecontrol.MidPoint = control.MidPoint; |
|
903 |
// linecontrol.Name = "ArrowControl_Multi"; |
|
904 |
// linecontrol.Opac = control.Opac; |
|
905 |
// linecontrol.PointSet = control.PointSet; |
|
906 |
// linecontrol.SizeSet = control.SizeSet; |
|
907 |
// linecontrol.StartPoint = control.StartPoint; |
|
908 |
// linecontrol.StrokeColor = control.StrokeColor; |
|
909 |
// linecontrol.TransformPoint = control.TransformPoint; |
|
910 |
|
|
911 |
// DrawMultiArrowLine(linecontrol, contentByte, delimiterChars, delimiterChars2, _SetColor); |
|
912 |
//} |
|
913 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
914 |
Point tempStartPoint = GetPdfPointSystem(control.StartPoint); |
|
915 |
Point tempMidPoint = GetPdfPointSystem(control.MidPoint); |
|
916 |
Point tempEndPoint = GetPdfPointSystem(control.EndPoint); |
|
917 |
bool isUnderLine = false; |
|
918 |
string Text = ""; |
|
919 |
double fontsize = 30; |
|
920 |
|
|
921 |
System.Drawing.SizeF sizeF = new System.Drawing.SizeF((float)control.BoxWidth, (float)control.BoxHeight); |
|
922 |
Rect rect = new Rect(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight)); |
|
923 |
List<Point> tempPoint = new List<Point>(); |
|
924 |
|
|
925 |
double Angle = control.Angle; |
|
926 |
|
|
927 |
if (Math.Abs(Angle).ToString() == "90") |
|
991 | 928 |
{ |
992 |
fontsize = Convert.ToDouble(control.fontConfig[3]);
|
|
929 |
Angle = 270;
|
|
993 | 930 |
} |
994 |
|
|
995 |
//강인구 수정(2018.04.17) |
|
996 |
var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]); |
|
997 |
|
|
998 |
FontStyle fontStyle = FontStyles.Normal; |
|
999 |
if (FontStyles.Italic == TextStyle) |
|
931 |
else if (Math.Abs(Angle).ToString() == "270") |
|
1000 | 932 |
{ |
1001 |
fontStyle = FontStyles.Italic;
|
|
933 |
Angle = 90;
|
|
1002 | 934 |
} |
1003 | 935 |
|
1004 |
FontWeight fontWeight = FontWeights.Black; |
|
1005 |
|
|
1006 |
var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]); |
|
1007 |
if (FontWeights.Bold == TextWeight) |
|
936 |
var tempRectMidPoint = MathSet.getRectMiddlePoint(rect); |
|
937 |
tempPoint.Add(new Point(rect.Left, tempRectMidPoint.Y)); |
|
938 |
tempPoint.Add(new Point(tempRectMidPoint.X, rect.Top)); |
|
939 |
tempPoint.Add(new Point(rect.Right, tempRectMidPoint.Y)); |
|
940 |
tempPoint.Add(new Point(tempRectMidPoint.X, rect.Bottom)); |
|
941 |
|
|
942 |
var newStartPoint = tempStartPoint; |
|
943 |
var newEndPoint = MathSet.getNearPoint(tempPoint, tempMidPoint); |
|
944 |
var newMidPoint = MathSet.getMiddlePoint(newStartPoint, newEndPoint); |
|
945 |
|
|
946 |
//Point testPoint = tempEndPoint; |
|
947 |
//if (Angle != 0) |
|
948 |
//{ |
|
949 |
// testPoint = GetArrowTextControlTestPoint(0, newMidPoint, tempPoint, control.isFixed); |
|
950 |
// //testPoint = Test(rect, newMidPoint); |
|
951 |
//} |
|
952 |
|
|
953 |
double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth); |
|
954 |
System.Drawing.Color FontColor = _SetColor; |
|
955 |
bool isHighlight = control.isHighLight; |
|
956 |
double Opacity = control.Opac; |
|
957 |
PaintSet Paint = PaintSet.None; |
|
958 |
|
|
959 |
switch (control.ArrowStyle) |
|
1008 | 960 |
{ |
1009 |
fontWeight = FontWeights.Bold; |
|
961 |
case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Normal: |
|
962 |
{ |
|
963 |
Paint = PaintSet.None; |
|
964 |
} |
|
965 |
break; |
|
966 |
case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud: |
|
967 |
{ |
|
968 |
Paint = PaintSet.Hatch; |
|
969 |
} |
|
970 |
break; |
|
971 |
case Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect: |
|
972 |
{ |
|
973 |
Paint = PaintSet.Fill; |
|
974 |
} |
|
975 |
break; |
|
976 |
default: |
|
977 |
break; |
|
1010 | 978 |
} |
979 |
if (control.isHighLight) Paint |= PaintSet.Highlight; |
|
1011 | 980 |
|
1012 |
TextDecorationCollection decoration = TextDecorations.Baseline; |
|
1013 |
if (control.fontConfig.Count() == 5) |
|
981 |
if (Paint == PaintSet.Hatch) |
|
1014 | 982 |
{ |
1015 |
decoration = TextDecorations.Underline;
|
|
983 |
Text = control.ArrowText;
|
|
1016 | 984 |
} |
1017 |
|
|
1018 |
if (control.isTrans) |
|
985 |
else |
|
1019 | 986 |
{ |
1020 |
//인구 수정 Arrow Text Style적용 되도록 변경 |
|
1021 |
Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), |
|
1022 |
newStartPoint, tempMidPoint, newEndPoint, control.isFixed, |
|
1023 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
987 |
Text = control.ArrowText; |
|
1024 | 988 |
} |
1025 |
else |
|
989 |
|
|
990 |
try |
|
1026 | 991 |
{ |
1027 |
if (control.isFixed) |
|
992 |
if (control.fontConfig.Count == 4) |
|
993 |
{ |
|
994 |
fontsize = Convert.ToDouble(control.fontConfig[3]); |
|
995 |
} |
|
996 |
|
|
997 |
//강인구 수정(2018.04.17) |
|
998 |
var TextStyle = Common.StringToFont.ConFontStyle(control.fontConfig[1]); |
|
999 |
|
|
1000 |
FontStyle fontStyle = FontStyles.Normal; |
|
1001 |
if (FontStyles.Italic == TextStyle) |
|
1002 |
{ |
|
1003 |
fontStyle = FontStyles.Italic; |
|
1004 |
} |
|
1005 |
|
|
1006 |
FontWeight fontWeight = FontWeights.Black; |
|
1007 |
|
|
1008 |
var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]); |
|
1009 |
if (FontWeights.Bold == TextWeight) |
|
1010 |
{ |
|
1011 |
fontWeight = FontWeights.Bold; |
|
1012 |
} |
|
1013 |
|
|
1014 |
TextDecorationCollection decoration = TextDecorations.Baseline; |
|
1015 |
if (control.fontConfig.Count() == 5) |
|
1016 |
{ |
|
1017 |
decoration = TextDecorations.Underline; |
|
1018 |
} |
|
1019 |
|
|
1020 |
if (control.isTrans) |
|
1028 | 1021 |
{ |
1029 |
var testP = new Point(0, 0); |
|
1030 |
if (control.isFixed) |
|
1031 |
{ |
|
1032 |
if (tempPoint[1] == newEndPoint) |
|
1033 |
{ |
|
1034 |
testP = new Point(newEndPoint.X, newEndPoint.Y - 10); |
|
1035 |
} |
|
1036 |
else if (tempPoint[3] == newEndPoint) |
|
1037 |
{ |
|
1038 |
testP = new Point(newEndPoint.X, newEndPoint.Y + 10); |
|
1039 |
} |
|
1040 |
else if (tempPoint[0] == newEndPoint) |
|
1041 |
{ |
|
1042 |
testP = new Point(newEndPoint.X - 10, newEndPoint.Y); |
|
1043 |
} |
|
1044 |
else if (tempPoint[2] == newEndPoint) |
|
1045 |
{ |
|
1046 |
testP = new Point(newEndPoint.X + 10, newEndPoint.Y); |
|
1047 |
} |
|
1048 |
} |
|
1049 | 1022 |
//인구 수정 Arrow Text Style적용 되도록 변경 |
1050 | 1023 |
Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), |
1051 |
tempStartPoint, testP, tempEndPoint, control.isFixed, |
|
1052 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, |
|
1053 |
FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
1024 |
newStartPoint, tempMidPoint, newEndPoint, control.isFixed, |
|
1025 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
1054 | 1026 |
} |
1055 | 1027 |
else |
1056 | 1028 |
{ |
1057 |
//인구 수정 Arrow Text Style적용 되도록 변경 |
|
1058 |
Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), |
|
1059 |
newStartPoint, tempMidPoint, tempEndPoint, control.isFixed, |
|
1060 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
1029 |
if (control.isFixed) |
|
1030 |
{ |
|
1031 |
var testP = new Point(0, 0); |
|
1032 |
if (control.isFixed) |
|
1033 |
{ |
|
1034 |
if (tempPoint[1] == newEndPoint) |
|
1035 |
{ |
|
1036 |
testP = new Point(newEndPoint.X, newEndPoint.Y - 10); |
|
1037 |
} |
|
1038 |
else if (tempPoint[3] == newEndPoint) |
|
1039 |
{ |
|
1040 |
testP = new Point(newEndPoint.X, newEndPoint.Y + 10); |
|
1041 |
} |
|
1042 |
else if (tempPoint[0] == newEndPoint) |
|
1043 |
{ |
|
1044 |
testP = new Point(newEndPoint.X - 10, newEndPoint.Y); |
|
1045 |
} |
|
1046 |
else if (tempPoint[2] == newEndPoint) |
|
1047 |
{ |
|
1048 |
testP = new Point(newEndPoint.X + 10, newEndPoint.Y); |
|
1049 |
} |
|
1050 |
} |
|
1051 |
//인구 수정 Arrow Text Style적용 되도록 변경 |
|
1052 |
Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), |
|
1053 |
tempStartPoint, testP, tempEndPoint, control.isFixed, |
|
1054 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, |
|
1055 |
FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
1056 |
} |
|
1057 |
else |
|
1058 |
{ |
|
1059 |
//인구 수정 Arrow Text Style적용 되도록 변경 |
|
1060 |
Controls_PDF.DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), |
|
1061 |
newStartPoint, tempMidPoint, tempEndPoint, control.isFixed, |
|
1062 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, FontHelper.GetFontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
1063 |
} |
|
1061 | 1064 |
} |
1062 | 1065 |
} |
1066 |
catch (Exception ex) |
|
1067 |
{ |
|
1068 |
throw ex; |
|
1069 |
} |
|
1070 |
|
|
1063 | 1071 |
} |
1064 |
catch (Exception ex) |
|
1072 |
break; |
|
1073 |
#endregion |
|
1074 |
#region SignControl |
|
1075 |
case "SignControl": |
|
1076 |
using (S_SignControl control = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item)) |
|
1065 | 1077 |
{ |
1066 |
throw ex; |
|
1067 |
} |
|
1068 | 1078 |
|
1069 |
} |
|
1070 |
break; |
|
1071 |
#endregion |
|
1072 |
#region SignControl |
|
1073 |
case "SignControl": |
|
1074 |
using (S_SignControl control = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item)) |
|
1075 |
{ |
|
1076 |
|
|
1077 |
double Angle = control.Angle; |
|
1078 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1079 |
Point TopRightPoint = GetPdfPointSystem(control.TR); |
|
1080 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1081 |
Point LeftBottomPoint = GetPdfPointSystem(control.LB); |
|
1082 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
1083 |
double Opacity = control.Opac; |
|
1084 |
string UserNumber = control.UserNumber; |
|
1085 |
Controls_PDF.DrawSet_Image.DrawSign(StartPoint, EndPoint, PointSet, contentByte, UserNumber, Angle, Opacity, finaldata.PROJECT_NO); |
|
1086 |
} |
|
1087 |
break; |
|
1088 |
#endregion |
|
1089 |
#region MyRegion |
|
1090 |
case "DateControl": |
|
1091 |
using (S_DateControl control = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item)) |
|
1092 |
{ |
|
1093 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
1094 |
string Text = control.Text; |
|
1095 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1096 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1097 |
List<Point> pointSet = GetPdfPointSystem(control.PointSet); |
|
1098 |
System.Drawing.Color FontColor = _SetColor; |
|
1099 |
double Angle = control.Angle; |
|
1100 |
double Opacity = control.Opac; |
|
1101 |
Controls_PDF.PDFLib_DrawSet_Text.DrawDate(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Text, Angle, Opacity); |
|
1102 |
} |
|
1103 |
break; |
|
1104 |
#endregion |
|
1105 |
#region SymControlN (APPROVED) |
|
1106 |
case "SymControlN": |
|
1107 |
using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item)) |
|
1108 |
{ |
|
1109 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1110 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1111 |
List<Point> pointSet = GetPdfPointSystem(control.PointSet); |
|
1112 |
System.Drawing.Color FontColor = _SetColor; |
|
1113 |
double Angle = control.Angle; |
|
1114 |
double Opacity = control.Opac; |
|
1115 |
|
|
1116 |
var stamp = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP"); |
|
1117 |
|
|
1118 |
if (stamp.Count() > 0) |
|
1079 |
double Angle = control.Angle; |
|
1080 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1081 |
Point TopRightPoint = GetPdfPointSystem(control.TR); |
|
1082 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1083 |
Point LeftBottomPoint = GetPdfPointSystem(control.LB); |
|
1084 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
1085 |
double Opacity = control.Opac; |
|
1086 |
string UserNumber = control.UserNumber; |
|
1087 |
Controls_PDF.DrawSet_Image.DrawSign(StartPoint, EndPoint, PointSet, contentByte, UserNumber, Angle, Opacity, finaldata.PROJECT_NO); |
|
1088 |
} |
|
1089 |
break; |
|
1090 |
#endregion |
|
1091 |
#region MyRegion |
|
1092 |
case "DateControl": |
|
1093 |
using (S_DateControl control = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item)) |
|
1094 |
{ |
|
1095 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
1096 |
string Text = control.Text; |
|
1097 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1098 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1099 |
List<Point> pointSet = GetPdfPointSystem(control.PointSet); |
|
1100 |
System.Drawing.Color FontColor = _SetColor; |
|
1101 |
double Angle = control.Angle; |
|
1102 |
double Opacity = control.Opac; |
|
1103 |
Controls_PDF.PDFLib_DrawSet_Text.DrawDate(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Text, Angle, Opacity); |
|
1104 |
} |
|
1105 |
break; |
|
1106 |
#endregion |
|
1107 |
#region SymControlN (APPROVED) |
|
1108 |
case "SymControlN": |
|
1109 |
using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item)) |
|
1119 | 1110 |
{ |
1120 |
var xamldata = Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(stamp.First().VALUE); |
|
1111 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1112 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1113 |
List<Point> pointSet = GetPdfPointSystem(control.PointSet); |
|
1114 |
System.Drawing.Color FontColor = _SetColor; |
|
1115 |
double Angle = control.Angle; |
|
1116 |
double Opacity = control.Opac; |
|
1121 | 1117 |
|
1122 |
var Contents = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP_CONTENTS");
|
|
1118 |
var stamp = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP");
|
|
1123 | 1119 |
|
1124 |
if (Contents?.Count() > 0)
|
|
1120 |
if (stamp.Count() > 0)
|
|
1125 | 1121 |
{ |
1126 |
foreach (var content in Contents) |
|
1122 |
var xamldata = Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(stamp.First().VALUE); |
|
1123 |
|
|
1124 |
var Contents = _entity.PROPERTIES.Where(x => x.TYPE == "STAMP_CONTENTS"); |
|
1125 |
|
|
1126 |
if (Contents?.Count() > 0) |
|
1127 | 1127 |
{ |
1128 |
xamldata = xamldata.Replace(content.PROPERTY, System.Security.SecurityElement.Escape(content.VALUE)); |
|
1128 |
foreach (var content in Contents) |
|
1129 |
{ |
|
1130 |
xamldata = xamldata.Replace(content.PROPERTY, System.Security.SecurityElement.Escape(content.VALUE)); |
|
1131 |
} |
|
1129 | 1132 |
} |
1133 |
|
|
1134 |
Controls_PDF.PDFLib_DrawSet_Symbol.DrawApprovalXamlData(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, xamldata); |
|
1130 | 1135 |
} |
1131 | 1136 |
|
1132 |
Controls_PDF.PDFLib_DrawSet_Symbol.DrawApprovalXamlData(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, xamldata); |
|
1137 |
string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", ""); |
|
1138 |
|
|
1133 | 1139 |
} |
1140 |
break; |
|
1141 |
case "SymControl": |
|
1142 |
using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item)) |
|
1143 |
{ |
|
1144 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1145 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1146 |
List<Point> pointSet = GetPdfPointSystem(control.PointSet); |
|
1147 |
System.Drawing.Color FontColor = _SetColor; |
|
1148 |
double Angle = control.Angle; |
|
1149 |
double Opacity = control.Opac; |
|
1134 | 1150 |
|
1135 |
string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", ""); |
|
1136 |
|
|
1137 |
} |
|
1138 |
break; |
|
1139 |
case "SymControl": |
|
1140 |
using (S_SymControl control = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item)) |
|
1141 |
{ |
|
1142 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1143 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1144 |
List<Point> pointSet = GetPdfPointSystem(control.PointSet); |
|
1145 |
System.Drawing.Color FontColor = _SetColor; |
|
1146 |
double Angle = control.Angle; |
|
1147 |
double Opacity = control.Opac; |
|
1148 |
|
|
1149 |
string imgpath = CommonLib.Common.GetConfigString("CheckmarkImgPath", "URL", ""); |
|
1150 |
Controls_PDF.PDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath); |
|
1151 |
} |
|
1152 |
break; |
|
1153 |
#endregion |
|
1154 |
#region Image |
|
1155 |
case "ImgControl": |
|
1156 |
using (S_ImgControl control = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item)) |
|
1157 |
{ |
|
1158 |
double Angle = control.Angle; |
|
1159 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1160 |
Point TopRightPoint = GetPdfPointSystem(control.TR); |
|
1161 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1162 |
Point LeftBottomPoint = GetPdfPointSystem(control.LB); |
|
1163 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
1164 |
double Opacity = control.Opac; |
|
1165 |
string FilePath = control.ImagePath; |
|
1166 |
//Uri uri = new Uri(s.ImagePath); |
|
1167 |
|
|
1168 |
Controls_PDF.DrawSet_Image.DrawImage(StartPoint, EndPoint, PointSet, contentByte, FilePath, Angle, Opacity); |
|
1169 |
} |
|
1170 |
break; |
|
1171 |
#endregion |
|
1172 |
default: |
|
1173 |
StatusChange($"{ControlT.Name} Not Support", 0); |
|
1174 |
break; |
|
1175 |
} |
|
1151 |
string imgpath = CommonLib.Common.GetConfigString("CheckmarkImgPath", "URL", ""); |
|
1152 |
Controls_PDF.PDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath); |
|
1153 |
} |
|
1154 |
break; |
|
1155 |
#endregion |
|
1156 |
#region Image |
|
1157 |
case "ImgControl": |
|
1158 |
using (S_ImgControl control = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item)) |
|
1159 |
{ |
|
1160 |
double Angle = control.Angle; |
|
1161 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
|
1162 |
Point TopRightPoint = GetPdfPointSystem(control.TR); |
|
1163 |
Point EndPoint = GetPdfPointSystem(control.EndPoint); |
|
1164 |
Point LeftBottomPoint = GetPdfPointSystem(control.LB); |
|
1165 |
List<Point> PointSet = GetPdfPointSystem(control.PointSet); |
|
1166 |
double Opacity = control.Opac; |
|
1167 |
string FilePath = control.ImagePath; |
|
1168 |
//Uri uri = new Uri(s.ImagePath); |
|
1176 | 1169 |
|
1177 |
} |
|
1178 |
catch (Exception ex) |
|
1179 |
{ |
|
1180 |
StatusChange($"markupItem : {ControlT.Name}" + ex.ToString(), 0); |
|
1181 |
} |
|
1182 |
finally |
|
1183 |
{ |
|
1184 |
//if (ControlT?.Name != null) |
|
1185 |
//{ |
|
1186 |
// strLog.Append($"{ControlT.Name},"); |
|
1187 |
//} |
|
1170 |
Controls_PDF.DrawSet_Image.DrawImage(StartPoint, EndPoint, PointSet, contentByte, FilePath, Angle, Opacity); |
|
1171 |
} |
|
1172 |
break; |
|
1173 |
#endregion |
|
1174 |
default: |
|
1175 |
StatusChange($"{ControlT.Name} Not Support", 0); |
|
1176 |
break; |
|
1177 |
} |
|
1178 |
|
|
1179 |
} |
|
1180 |
catch (Exception ex) |
|
1181 |
{ |
|
1182 |
StatusChange($"markupItem : {ControlT.Name}" + ex.ToString(), 0); |
|
1183 |
} |
|
1184 |
finally |
|
1185 |
{ |
|
1186 |
} |
|
1188 | 1187 |
} |
1189 | 1188 |
} |
1190 | 1189 |
} |
FinalService/KCOM_FinalService/MarkupToPDF/Serialize/S_Control/Base/S_BaseControl.cs | ||
---|---|---|
47 | 47 |
|
48 | 48 |
[DataMember] |
49 | 49 |
public int ZIndex { get; set; } = 10; |
50 |
|
|
51 |
[DataMember] |
|
52 |
public int Index { get; set; } |
|
50 | 53 |
} |
51 | 54 |
} |
내보내기 Unified diff