|
@@ -28,6 +28,7 @@ using System.Windows.Input;
|
|
|
using System.Windows.Media;
|
|
|
using System.Windows.Media.Animation;
|
|
|
using System.Windows.Media.Media3D;
|
|
|
+using System.Windows.Shapes;
|
|
|
using static ComPDFKit.PDFAnnotation.CTextAttribute.CFontNameHelper;
|
|
|
using static ComPDFKit.Tool.Help.ImportWin32;
|
|
|
|
|
@@ -1463,7 +1464,7 @@ namespace ComPDFKit.Tool.DrawTool
|
|
|
|
|
|
TextBox textui = new TextBox();
|
|
|
|
|
|
- Border textBorder = new Border();
|
|
|
+ DashedBorder textBorder = new DashedBorder();
|
|
|
textBorder.Child = textui;
|
|
|
textui.Width = 200;
|
|
|
CTextAttribute textAttribute = annotFreeText.FreeTextDa;
|
|
@@ -1498,7 +1499,20 @@ namespace ComPDFKit.Tool.DrawTool
|
|
|
|
|
|
textBorder.Padding = new Thickness(0);
|
|
|
textBorder.BorderBrush = new SolidColorBrush(borderColor);
|
|
|
- textBorder.BorderThickness = new Thickness(DpiHelper.PDFNumToStandardNum(annotFreeText.GetBorderWidth() * zoomFactor));
|
|
|
+ double rawWidth = annotFreeText.GetBorderWidth();
|
|
|
+ double drawWidth = DpiHelper.PDFNumToStandardNum(rawWidth * zoomFactor);
|
|
|
+ textBorder.BorderThickness = new Thickness(drawWidth);
|
|
|
+ if (annotFreeText.BorderStyle != C_BORDER_STYLE.BS_SOLID && annotFreeText.Dash != null && annotFreeText.Dash.Length > 0)
|
|
|
+ {
|
|
|
+ //补充保存虚线样式
|
|
|
+ DoubleCollection dashCollection = new DoubleCollection();
|
|
|
+ foreach (float num in annotFreeText.Dash)
|
|
|
+ {
|
|
|
+ dashCollection.Add(num);
|
|
|
+ }
|
|
|
+ textBorder?.DrawDashBorder(true, drawWidth,rawWidth, dashCollection);
|
|
|
+ }
|
|
|
+
|
|
|
textui.BorderThickness = new Thickness(0);
|
|
|
textui.Text = annotFreeText.Content;
|
|
|
|
|
@@ -1724,10 +1738,23 @@ namespace ComPDFKit.Tool.DrawTool
|
|
|
lastTextui.Background = new SolidColorBrush(backgroundColor);
|
|
|
lastTextBorder.Padding = new Thickness(0);
|
|
|
lastTextBorder.BorderBrush = new SolidColorBrush(borderColor);
|
|
|
- lastTextBorder.BorderThickness = new Thickness(DpiHelper.PDFNumToStandardNum(annotFreeText.GetBorderWidth() * zoomFactor));
|
|
|
+ double rawWidth = annotFreeText.GetBorderWidth();
|
|
|
+ double drawWidth = DpiHelper.PDFNumToStandardNum(rawWidth * zoomFactor);
|
|
|
+ lastTextBorder.BorderThickness = new Thickness(drawWidth);
|
|
|
lastTextui.BorderThickness = new Thickness(0);
|
|
|
lastTextui.Text = annotFreeText.Content;
|
|
|
lastTextui.Opacity = annotFreeText.Transparency;
|
|
|
+ if (annotFreeText.BorderStyle != C_BORDER_STYLE.BS_SOLID && annotFreeText.Dash != null && annotFreeText.Dash.Length > 0)
|
|
|
+ {
|
|
|
+ //补充保存虚线样式
|
|
|
+ DashedBorder dashBorder = (DashedBorder)lastTextBorder;
|
|
|
+ DoubleCollection dashCollection = new DoubleCollection();
|
|
|
+ foreach (float num in annotFreeText.Dash)
|
|
|
+ {
|
|
|
+ dashCollection.Add(num);
|
|
|
+ }
|
|
|
+ dashBorder.DrawDashBorder(true, drawWidth,rawWidth, dashCollection);
|
|
|
+ }
|
|
|
|
|
|
string fontName = string.Empty;
|
|
|
string fontFamily = string.Empty;
|