개정판 862ebf33
Fix: (FinalService) 페이지가 회전되었을때 TextControl 표시 오류 수정
Change-Id: I02b0ccde9e9074d5861091e20cb5ceb9651437d5
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/DrawSet_DrawString.cs | ||
---|---|---|
128 | 128 |
iTextSharp.text.Rectangle TextBox = null; |
129 | 129 |
#region TextBox에 크기에 맞게 폰트를 생성한다. |
130 | 130 |
iTextSharp.text.Font itextFont = null; |
131 |
Angle = Angle < 0 ? Angle + 360.0 : Angle; |
|
131 | 132 |
if(Convert.ToInt32(Angle) == 90) |
132 | 133 |
{ |
133 | 134 |
float llx = calRect.Left; |
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
1426 | 1426 |
|
1427 | 1427 |
} |
1428 | 1428 |
|
1429 |
private void DrawTextBox(S_TextControl control,PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2,System.Drawing.Color setColor) |
|
1429 |
/// <summary> |
|
1430 |
/// 텍스트와 보더를 그립니다. |
|
1431 |
/// </summary> |
|
1432 |
/// <param name="control"></param> |
|
1433 |
/// <param name="contentByte"></param> |
|
1434 |
/// <param name="delimiterChars"></param> |
|
1435 |
/// <param name="delimiterChars2"></param> |
|
1436 |
/// <param name="setColor"></param> |
|
1437 |
private void DrawTextBox(S_TextControl control, PdfContentByte contentByte, string[] delimiterChars, string[] delimiterChars2, System.Drawing.Color setColor) |
|
1430 | 1438 |
{ |
1431 | 1439 |
string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
1432 | 1440 |
string Text = control.Text; |
... | ... | |
1438 | 1446 |
Point StartPoint = GetPdfPointSystem(control.StartPoint); |
1439 | 1447 |
Point EndPoint = GetPdfPointSystem(new Point(control.StartPoint.X + control.BoxW, control.StartPoint.Y + control.BoxH)); |
1440 | 1448 |
|
1449 |
var rect = control.GetBorderRectangle(StartPoint, scaleWidth, scaleHeight); |
|
1450 |
|
|
1441 | 1451 |
List<Point> pointSet = new List<Point>(); |
1442 | 1452 |
pointSet.Add(StartPoint); |
1443 | 1453 |
pointSet.Add(EndPoint); |
1444 |
|
|
1454 |
|
|
1445 | 1455 |
PaintSet paint = PaintSet.None; |
1446 | 1456 |
switch (control.paintMethod) |
1447 | 1457 |
{ |
... | ... | |
1479 | 1489 |
var TextWeight = Common.StringToFont.ConFontWeight(control.fontConfig[2]); |
1480 | 1490 |
//강인구 수정(2018.04.17) |
1481 | 1491 |
if (FontWeights.Bold == TextWeight) |
1482 |
//if (FontWeights.ExtraBold == TextWeight) |
|
1483 | 1492 |
{ |
1484 | 1493 |
fontWeight = FontWeights.Bold; |
1485 | 1494 |
} |
1486 | 1495 |
|
1487 | 1496 |
TextDecorationCollection decoration = TextDecorations.Baseline; |
1488 |
if (control.fontConfig.Count() == 4)
|
|
1497 |
if (control.fontConfig.Count == 4) |
|
1489 | 1498 |
{ |
1490 | 1499 |
decoration = TextDecorations.Underline; |
1491 | 1500 |
} |
1492 | 1501 |
|
1493 |
Controls_PDF.DrawSet_Text.DrawString(StartPoint, EndPoint, LineSize, contentByte, setColor, paint, TextSize, fontfamilly, fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
|
|
1502 |
Controls_PDF.DrawSet_Text.DrawString(rect.TopLeft, rect.BottomRight, LineSize, contentByte, setColor, paint, TextSize, fontfamilly, fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
|
|
1494 | 1503 |
} |
1495 |
|
|
1504 |
|
|
1496 | 1505 |
|
1497 | 1506 |
~MarkupToPDF() |
1498 | 1507 |
{ |
FinalService/KCOM_FinalService/MarkupToPDF/Serialize/S_Control/Detail/S_TextControl.cs | ||
---|---|---|
40 | 40 |
GC.Collect(); |
41 | 41 |
GC.SuppressFinalize(this); |
42 | 42 |
} |
43 |
|
|
44 |
/// <summary> |
|
45 |
/// Border 사각형을 리턴한다. |
|
46 |
/// </summary> |
|
47 |
/// <param name="Origin"></param> |
|
48 |
/// <param name="ScaleWidth"></param> |
|
49 |
/// <param name="ScaleHeight"></param> |
|
50 |
/// <returns></returns> |
|
51 |
public System.Windows.Rect GetBorderRectangle(Point Origin, float ScaleWidth, float ScaleHeight) |
|
52 |
{ |
|
53 |
double _Angle = -1 * this.Angle; |
|
54 |
_Angle = _Angle < 0 ? _Angle + 360.0 : _Angle; |
|
55 |
if (Convert.ToInt32(_Angle) == 90) |
|
56 |
{ |
|
57 |
double _BoxWidth = this.BoxH / ScaleHeight; |
|
58 |
double _BoxHeight = this.BoxW / ScaleWidth; |
|
59 |
Origin = new Point(Origin.X, Origin.Y + _BoxHeight); |
|
60 |
|
|
61 |
return new System.Windows.Rect(Origin, new Point(Origin.X + _BoxWidth, Origin.Y - _BoxHeight)); |
|
62 |
} |
|
63 |
else if (Convert.ToInt32(_Angle) == 270) |
|
64 |
{ |
|
65 |
double _BoxWidth = this.BoxH / ScaleHeight; |
|
66 |
double _BoxHeight = this.BoxW / ScaleWidth; |
|
67 |
Origin = new Point(Origin.X - _BoxWidth, Origin.Y); |
|
68 |
|
|
69 |
return new System.Windows.Rect(Origin, new Point(Origin.X + _BoxWidth, Origin.Y - _BoxHeight)); |
|
70 |
} |
|
71 |
else if (Convert.ToInt32(_Angle) == 180) |
|
72 |
{ |
|
73 |
double _BoxWidth = this.BoxW / ScaleWidth; |
|
74 |
double _BoxHeight = this.BoxH / ScaleHeight; |
|
75 |
|
|
76 |
return new System.Windows.Rect(new Point(Origin.X - _BoxWidth, Origin.Y), new Point(Origin.X, Origin.Y + _BoxHeight)); |
|
77 |
} |
|
78 |
else |
|
79 |
{ |
|
80 |
double _BoxWidth = this.BoxW / ScaleWidth; |
|
81 |
double _BoxHeight = this.BoxH / ScaleHeight; |
|
82 |
|
|
83 |
return new System.Windows.Rect(Origin, new Point(Origin.X + _BoxWidth, Origin.Y - _BoxHeight)); |
|
84 |
} |
|
85 |
} |
|
43 | 86 |
} |
44 | 87 |
|
45 | 88 |
[DataContract] |
... | ... | |
87 | 130 |
/// <returns></returns> |
88 | 131 |
public System.Windows.Rect GetBorderRectangle(Point Origin, float ScaleWidth, float ScaleHeight) |
89 | 132 |
{ |
90 |
if (Convert.ToInt32(this.Angle) == 90) |
|
133 |
double _Angle = this.Angle < 0 ? this.Angle + 360.0 : this.Angle; |
|
134 |
if (Convert.ToInt32(_Angle) == 90) |
|
91 | 135 |
{ |
92 | 136 |
double _BoxWidth = this.BoxHeight / ScaleHeight; |
93 | 137 |
double _BoxHeight = this.BoxWidth / ScaleWidth; |
... | ... | |
95 | 139 |
|
96 | 140 |
return new System.Windows.Rect(Origin, new Point(Origin.X + _BoxWidth, Origin.Y - _BoxHeight)); |
97 | 141 |
} |
98 |
else if (Convert.ToInt32(this.Angle) == 270)
|
|
142 |
else if (Convert.ToInt32(_Angle) == 270)
|
|
99 | 143 |
{ |
100 | 144 |
double _BoxWidth = this.BoxHeight / ScaleHeight; |
101 | 145 |
double _BoxHeight = this.BoxWidth / ScaleWidth; |
내보내기 Unified diff