liyijie 2 年之前
父节点
当前提交
6613068b3e

二进制
PDF Office/ComPDFKit.Viewer.dll


+ 19 - 16
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -50,21 +50,16 @@ namespace PDF_Office.ViewModels.FillAndSign
         private bool isRightMenuAddAnnot = false;
         private IEventAggregator events;
         public List<List<Point>> ShapePoints = new List<List<Point>>();
-        private string Shape = "HookShape";
-        private PopMenu HightAnnotPopMenu;
+        private string Shape = "HookShape";
         private PopMenu FreeHandAnnotPopMenu;
-        private PopMenu FreeTextAnnotPopMenu;
-        private PopMenu StrickNoteAnnotPopMenu;
-        private PopMenu ShapeAnnotPopMenu;
-        private PopMenu LinkAnnotPopMenu;
-        private PopMenu StampAnnotPopMenu;
         private PopMenu MultiAnnotPopMenu;
         private IRegionManager regions { get; set; }
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         public static bool IsEdit = false;
         public Brush SelectColor = new SolidColorBrush(Colors.GreenYellow);
         public double FillOpacity = 1;
-        public double LineWidth = 1;
+        public double LineWidth = 1;
+        public double LineWidthMultiple = 1;
         #endregion
 
         #region Command
@@ -143,7 +138,8 @@ namespace PDF_Office.ViewModels.FillAndSign
         }
         //注释工具
         private void FindAnnotTypeKey(string tag, ref AnnotHandlerEventArgs annotArgs, bool isRightMenuAdd = false)
-        {
+        {
+            LineWidthMultiple = 1;
             switch (tag)
             {
 
@@ -165,6 +161,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                     break;
                 case "RbtnFork"://叉
                     Shape = "ForkShape";
+                   
                     ShapePoints = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
                     annotArgs = GetStamp();
                     break;
@@ -180,7 +177,8 @@ namespace PDF_Office.ViewModels.FillAndSign
                     break;
                 case "RbtnPoint":
                     Shape = "DotShape";
-                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(1, 1) ,new Point(1, 1) } };
+                    ShapePoints = new List<List<Point>> { new List<Point> { new Point(12.19995, 10), new Point(12.19995, 10) } };
+                    LineWidthMultiple = 4;
                     annotArgs = GetStamp();
                     break;
                 default://图章
@@ -205,7 +203,8 @@ namespace PDF_Office.ViewModels.FillAndSign
         private AnnotHandlerEventArgs GetStamp(List<AnnotHandlerEventArgs> selectedArgs = null)
         {
             StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
-            stampAnnotArgs.SetInkData(ShapePoints, LineWidth, (SelectColor as SolidColorBrush).Color);
+
+            stampAnnotArgs.SetInkData(ShapePoints, LineWidth* LineWidthMultiple, (SelectColor as SolidColorBrush).Color);
             //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
             //PDFViewer.SetToolParam(stampArgs);
             //StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
@@ -242,7 +241,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         public void SetStamp()
         {
             StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
-            stampAnnotArgs.SetInkData(ShapePoints, LineWidth, (SelectColor as SolidColorBrush).Color);
+            stampAnnotArgs.SetInkData(ShapePoints, LineWidth* LineWidthMultiple, (SelectColor as SolidColorBrush).Color);
             //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
             //PDFViewer.SetToolParam(stampArgs);
             //StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
@@ -344,7 +343,11 @@ namespace PDF_Office.ViewModels.FillAndSign
                         }
                     }
 
-                }
+                }
+                freehandArgs.RawPointList = ShapePoints;
+                freehandArgs.InkColor = (SelectColor as SolidColorBrush).Color;
+                freehandArgs.Transparency = 1;
+                freehandArgs.LineWidth = LineWidth;
                 annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
                 annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
                 annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
@@ -795,15 +798,15 @@ namespace PDF_Office.ViewModels.FillAndSign
                 bOTAContent.TabItemSearch.IsSelected = true;
             }
         }
-        public IRegionManager region;
+
         private bool IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, string tabItemText)
         {
             bool isTabItem = false;
             bOTAContentViewModel = null;
             bOTAContent = null;
-            if (region.Regions.ContainsRegionWithName(viewContentViewModel.BOTARegionName))
+            if (regions.Regions.ContainsRegionWithName(viewContentViewModel.BOTARegionName))
             {
-                var views = region.Regions[viewContentViewModel.BOTARegionName].Views;
+                var views = regions.Regions[viewContentViewModel.BOTARegionName].Views;
                 var model = views.FirstOrDefault(q => q is BOTAContent);
                 if (model is BOTAContent bOTAContent1)
                 {

+ 7 - 3
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs

@@ -95,7 +95,7 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                 fillAndSignContentViewModel.LineWidth = value;
                 if (FillAndSignContentViewModel.IsEdit)
                 {
-                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, value);
+                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth*fillAndSignContentViewModel.LineWidthMultiple);
                 }
                 else { fillAndSignContentViewModel.SetStamp(); }
 
@@ -133,7 +133,8 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 
         private void SharpsType(string tag, object obj, bool isFromToolsBtn = false)
         {
-            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+            fillAndSignContentViewModel.LineWidthMultiple = 1;
             switch (tag)
             {
                 case "HookShape":
@@ -203,7 +204,10 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                         DataPath = circlePath;
                         if (FillAndSignContentViewModel.IsEdit)
                         {
-                            PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, new List<List<Point>> { new List<Point> { new Point(1, 1) , new Point(1, 1) } });
+                            fillAndSignContentViewModel.LineWidthMultiple = 4;
+                            PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth* fillAndSignContentViewModel.LineWidthMultiple);
+                            PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, new List<List<Point>> { new List<Point> { new Point(12.19995, 10), new Point(12.19995, 10) } });
+                            
                         }
                         //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(0.19995, 1.19995), new Point(0.19995, -1.19995) }, new List<Point> { new Point(-0.25995, 0.89995), new Point(0.25995, -0.89995) }, new List<Point> { new Point(-1.19995, 0.19995), new Point(0.19995, 1.19995) } };
                         //fillAndSignContentViewModel.SetStamp();

+ 1 - 1
PDF Office/Views/FillAndSign/PropertyPanel/ShapFillProperty.xaml

@@ -78,7 +78,7 @@
                 </Grid.RowDefinitions>
                 <TextBlock Text="Color" VerticalAlignment="Center"/>
                 <CompositeControl:SlidContent x:Name="layerThick"  HorizontalAlignment="Right" 
-                                              Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                                              
                                               >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">