소스 검색

Merge branch 'dev' into beta

# Conflicts:
#	PDF Office/Properties/Settings.Designer.cs
#	PDF Office/Properties/Settings.settings
ZhouJieSheng 1 년 전
부모
커밋
d7bd2e7efb
44개의 변경된 파일761개의 추가작업 그리고 292개의 파일을 삭제
  1. 1 1
      PDF Office/App.xaml.cs
  2. BIN
      PDF Office/ComDocumentAIKit.dll
  3. BIN
      PDF Office/ComPDFKit.Viewer.dll
  4. BIN
      PDF Office/ComPDFKit_Conversion.dll
  5. 2 1
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml
  6. 15 10
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs
  7. 28 17
      PDF Office/CustomControl/NumericUpDown.xaml
  8. 82 0
      PDF Office/Helper/PDFEditHelper.cs
  9. 28 2
      PDF Office/Helper/SettingHelper.cs
  10. 2 2
      PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs
  11. 14 2
      PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs
  12. 1 0
      PDF Office/PDF Master.csproj
  13. 1 1
      PDF Office/PDF Master.csproj.user
  14. 15 4
      PDF Office/Properties/Settings.Designer.cs
  15. 3 0
      PDF Office/Properties/Settings.settings
  16. BIN
      PDF Office/Resources/GuidPDF/Quick Start Guide.pdf
  17. 1 0
      PDF Office/Styles/ListViewStyle.xaml
  18. 2 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  19. 2 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  20. 2 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  21. 2 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  22. 2 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  23. 2 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  24. 89 42
      PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs
  25. 9 1
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  26. 77 66
      PDF Office/ViewModels/PropertyPanel/PDFEdit/ImageEditPropertyViewModel.cs
  27. 85 55
      PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs
  28. 87 6
      PDF Office/ViewModels/Tools/TextEditToolContentViewModel.cs
  29. 12 6
      PDF Office/ViewModels/ViewContentViewModel.cs
  30. 1 0
      PDF Office/Views/BOTA/AnnotationContent.xaml
  31. 6 1
      PDF Office/Views/BOTA/BookmarkContent.xaml
  32. 16 0
      PDF Office/Views/BOTA/BookmarkContent.xaml.cs
  33. 10 0
      PDF Office/Views/BOTA/OutLineControl.xaml.cs
  34. 42 36
      PDF Office/Views/Dialog/ServiceDialog/LoginoffDialog.xaml
  35. 2 2
      PDF Office/Views/HomePanel/HomeGuidContent.xaml
  36. 34 22
      PDF Office/Views/HomePanel/HomeGuidContent.xaml.cs
  37. 17 3
      PDF Office/Views/PageEdit/PageEditContent.xaml.cs
  38. BIN
      PDF Office/x64/CPDFConverterNative.dll
  39. BIN
      PDF Office/x64/ComDocumentAINative.dll
  40. BIN
      PDF Office/x64/DocumentAI.dll
  41. BIN
      PDF Office/x64/paddle2onnx.dll
  42. BIN
      PDF Office/x86/CPDFConverterNative.dll
  43. 68 0
      PDFSettings/DefaultEditProperty.cs
  44. 1 0
      PDFSettings/PDFSettings.csproj

+ 1 - 1
PDF Office/App.xaml.cs

@@ -840,7 +840,7 @@ namespace PDF_Master
                 
                 LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret);
                 //初始化ocr库
-                CPDFConverter.InitOcrLibrary(Path.Combine(resPath, "x64"));
+                CPDFConverter.InitOCRLibrary(Path.Combine(resPath, "x64"));
                 //初始化资源
                 CPDFConverter.SetOCRModelPath(Path.Combine(resPath, "source"));
                 if (licenseerror != LicenseError.ERR_SUCCESS)

BIN
PDF Office/ComDocumentAIKit.dll


BIN
PDF Office/ComPDFKit.Viewer.dll


BIN
PDF Office/ComPDFKit_Conversion.dll


+ 2 - 1
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml

@@ -28,6 +28,7 @@
                     <TextBlock
                         HorizontalAlignment="Center"
                         VerticalAlignment="Center"
+                        FontFamily="{Binding FontFamily}"
                         Text="{Binding Content}" />
                 </StackPanel>
             </DataTemplate>
@@ -57,7 +58,7 @@
                         VirtualizingStackPanel.VirtualizationMode="Standard">
                         <ComboBox.ItemsPanel>
                             <ItemsPanelTemplate>
-                                <VirtualizingStackPanel />
+                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" />
                             </ItemsPanelTemplate>
                         </ComboBox.ItemsPanel>
                     </ComboBox>

+ 15 - 10
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs

@@ -64,8 +64,16 @@ namespace PDF_Master.CustomControl.CompositeControl
             get { return _content; }
             private set { SetProperty(ref _content, value); }
         }
-
-        //下拉框显示的内容+单位:限数字值的单位
+
+        private FontFamily fontFamily = new FontFamily("Arial");
+
+        public FontFamily FontFamily
+        {
+            get { return fontFamily; }
+            set { SetProperty(ref fontFamily, value); }
+        }
+
+        //下拉框显示的内容+单位:限数字值的单位
         public string Unit { get; private set; }
 
         //数字类型
@@ -351,8 +359,7 @@ namespace PDF_Master.CustomControl.CompositeControl
                             index = control.Items.IndexOf(temp);
 
                         if (index >= 0)
-                        {
-
+                        {
                             //为了改变值时选项跟着改变,但是值并没有时时刻刻改变,且影响其他事件展示注释掉 2023/4/4
                             //if (control.SelectedIndex != index)
                             //{
@@ -399,22 +406,20 @@ namespace PDF_Master.CustomControl.CompositeControl
             {
                 //删掉了selectedIndex != -1,设置不选中任何选项的情况
                 //删掉了control.SelectedItems = null;避免崩溃
-                if (control.comBox.Items != null && control.comBox.Items.Count > 0 )
+                if (control.comBox.Items != null && control.comBox.Items.Count > 0)
                 {
                     control.comBox.SelectedIndex = selectedIndex;
                     if (control.comBox.SelectedItem != null)
                     {
-                        if(control.comBox.SelectedItem is ComboDataItem comboDataItem)
+                        if (control.comBox.SelectedItem is ComboDataItem comboDataItem)
                         {
                             bool isEqual = EqualityComparer<ComboDataItem>.Default.Equals(comboDataItem, control.SelectedItems);
-                            if (isEqual==false)
+                            if (isEqual == false)
                             {
                                 control.SelectedItems = (ComboDataItem)control.comBox.SelectedItem;
                             }
                         }
-                    }
-                        
-                  
+                    }
                 }
                 control.UpdateSelectedIndex();
             }

+ 28 - 17
PDF Office/CustomControl/NumericUpDown.xaml

@@ -6,20 +6,21 @@
     xmlns:local="clr-namespace:PDF_Master.CustomControl"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     d:DesignWidth="120"
-    FontSize="20"
+    FontSize="14"
     Loaded="UserControl_Loaded"
     mc:Ignorable="d">
-    <Border Background="{StaticResource color.field.bg.def}"
-                BorderBrush="{StaticResource color.field.border.norm}" BorderThickness="1,1,1,1"
-                CornerRadius="4,4,4,4">
+    <Border
+        Background="{StaticResource color.field.bg.def}"
+        BorderBrush="{StaticResource color.field.border.norm}"
+        BorderThickness="1,1,1,1"
+        CornerRadius="4,4,4,4">
         <Grid>
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="*" />
                 <ColumnDefinition Width="1" />
                 <ColumnDefinition Width="20" />
             </Grid.ColumnDefinitions>
-            <Border
-                />
+            <Border />
             <TextBox
                 Name="TextBox_Num"
                 MinWidth="68"
@@ -28,29 +29,33 @@
                 VerticalContentAlignment="Center"
                 Background="Transparent"
                 BorderThickness="0"
-                LostFocus="TextBox_Num_LostFocus"
-                PreviewKeyDown="TextBox_Num_PreviewKeyDown"
                 FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
                 FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
                 Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
                 InputMethod.IsInputMethodEnabled="False"
+                LostFocus="TextBox_Num_LostFocus"
+                PreviewKeyDown="TextBox_Num_PreviewKeyDown"
                 PreviewTextInput="CountTextBox_PreviewTextInput"
                 Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Text}"
                 TextAlignment="Left" />
-            <Rectangle Grid.Column="1" Fill="{StaticResource color.field.border.norm}" Margin="0,0.5,0,0.5"></Rectangle>
-            <Grid Grid.Column="2" Width="20"  >
+            <Rectangle
+                Grid.Column="1"
+                Margin="0,0.5,0,0.5"
+                Fill="{StaticResource color.field.border.norm}" />
+            <Grid Grid.Column="2" Width="20">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="12*" />
-                    <RowDefinition Height="3*"/>
                     <RowDefinition Height="3*" />
-                    <RowDefinition Height="12*"/>
+                    <RowDefinition Height="3*" />
+                    <RowDefinition Height="12*" />
                 </Grid.RowDefinitions>
                 <Border
                     Grid.Row="0"
+                    Grid.RowSpan="2"
                     Background="{StaticResource color.field.bg.def}"
                     BorderBrush="{StaticResource color.field.border.norm}"
                     BorderThickness="0,0,0,0.5"
-                    CornerRadius="0,4,0,0" Grid.RowSpan="2">
+                    CornerRadius="0,4,0,0">
                     <Button
                         Name="Button_Add"
                         Background="Transparent"
@@ -58,27 +63,33 @@
                         BorderThickness="0"
                         Click="Button_Add_Click">
                         <Path
-                           
+                            Width="10.06"
+                            Height="5.78"
                             Data="M10 5.93571L13.9696 9.90532L15.0303 8.84466L10.5303 4.34472C10.2374 4.05183 9.76257 4.05183 9.46967 4.34472L4.96974 8.84466L6.0304 9.90532L10 5.93571Z"
                             Fill="{StaticResource color.icon.arrow.gray.def}"
-                            Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" Height="5.78" Stretch="Fill" Width="10.06" />
+                            Stretch="Fill"
+                            Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
                     </Button>
                 </Border>
                 <Border
                     Grid.Row="2"
+                    Grid.RowSpan="2"
                     Background="{StaticResource color.field.bg.def}"
                     BorderBrush="{StaticResource color.field.border.norm}"
                     BorderThickness="0,0.5,0,0"
-                    CornerRadius="0,0,4,0" Grid.RowSpan="2" >
+                    CornerRadius="0,0,4,0">
                     <Button
                         Name="Button_Sub"
                         Background="Transparent"
                         BorderThickness="00"
                         Click="Button_Sub_Click">
                         <Path
+                            Width="10.06"
+                            Height="5.78"
                             Data="M10 9.06427L6.03039 5.09467L4.96973 6.15533L9.46967 10.6553C9.76256 10.9482 10.2374 10.9482 10.5303 10.6553L15.0303 6.15533L13.9696 5.09467L10 9.06427Z"
                             Fill="{StaticResource color.icon.arrow.gray.def}"
-                            Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" Height="5.78" Stretch="Fill" Width="10.06"/>
+                            Stretch="Fill"
+                            Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
                     </Button>
                 </Border>
             </Grid>

+ 82 - 0
PDF Office/Helper/PDFEditHelper.cs

@@ -0,0 +1,82 @@
+using ComPDFKit.PDFPage;
+using ComPDFKit.PDFPage.Edit;
+using ComPDFKitViewer;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Master.Properties;
+using PDFSettings;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Master.Helper
+{
+    public static class PDFEditHelper
+    {
+        /// <summary>
+        /// 获取本地配置,并且更新对应属性
+        /// </summary>
+        /// <returns></returns>
+        public static PDFEditEvent GetPDFEditDefaultProperty(out DefaultEditProperty defaultEdit, CPDFViewer pdf)
+        {
+            PDFEditEvent editEvent = null;
+            defaultEdit = SettingHelper.GetPDFEditDefaultProperty(CPDFEditType.EditText);
+            if (defaultEdit == null)
+            {
+                defaultEdit = SetDefaultEdit();
+            }
+            editEvent = GetPDFEditEvent(defaultEdit, pdf);
+            return editEvent;
+        }
+
+        /// <summary>
+        /// 更新CPDFViewer的属性
+        /// </summary>
+        /// <param name="defaultEdit"></param>
+        /// <param name="pdf"></param>
+        /// <returns></returns>
+        public static PDFEditEvent GetPDFEditEvent(DefaultEditProperty defaultEdit, CPDFViewer pdf)
+        {
+            PDFEditEvent dFEditEvent = new PDFEditEvent();
+            dFEditEvent.FontName = defaultEdit.FontName;
+            dFEditEvent.FontSize = defaultEdit.FontSize;
+            dFEditEvent.TextAlign = defaultEdit.TextAlign;
+            dFEditEvent.AutoBlock = defaultEdit.AutoBlock;
+            dFEditEvent.ClipImage = defaultEdit.ClipImage;
+            dFEditEvent.EditType = defaultEdit.EditType;
+            dFEditEvent.FontColor = defaultEdit.FontColor;
+            dFEditEvent.HorizontalMirror = defaultEdit.HorizontalMirror;
+            dFEditEvent.IsBold = defaultEdit.IsBold;
+            dFEditEvent.IsItalic = defaultEdit.IsItalic;
+            dFEditEvent.ReplaceImagePath = defaultEdit.ReplaceImagePath;
+            dFEditEvent.Rotate = defaultEdit.Rotate;
+            dFEditEvent.Transparency = defaultEdit.Transparency;
+            dFEditEvent.VerticalMirror = defaultEdit.VerticalMirror;
+            pdf.SetPDFEditParam(dFEditEvent);
+            return dFEditEvent;
+        }
+
+        public static DefaultEditProperty SetDefaultEdit()
+        {
+            DefaultEditProperty defaultEdit = new PDFSettings.DefaultEditProperty();
+            defaultEdit.FontName = "Arial";
+            defaultEdit.FontSize = 14;
+            defaultEdit.TextAlign = TextAlignType.AlignLeft;
+            defaultEdit.AutoBlock = true;
+            defaultEdit.ClipImage = false;
+            defaultEdit.EditType = ComPDFKit.PDFPage.CPDFEditType.EditText;
+            defaultEdit.FontColor = System.Windows.Media.Color.FromArgb(255, 0, 0, 0);
+            defaultEdit.HorizontalMirror = false;
+            defaultEdit.VerticalMirror = false;
+            defaultEdit.IsBold = false;
+            defaultEdit.IsItalic = false;
+            defaultEdit.ReplaceImagePath = null;
+            defaultEdit.Rotate = 0;
+            defaultEdit.Transparency = 255;
+            SettingHelper.SetPDFEditProperty(defaultEdit);
+            Settings.Default.Save();
+            return defaultEdit;
+        }
+    }
+}

+ 28 - 2
PDF Office/Helper/SettingHelper.cs

@@ -69,7 +69,7 @@ namespace PDF_Master.Helper
         {
             if (Settings.Default.RecentOpenFiles == null || Settings.Default.RecentOpenFiles.Count == 0)
                 return;
-               
+
             OpenFileInfo deleteItem = null;
             foreach(var item in Settings.Default.RecentOpenFiles)
             {
@@ -177,6 +177,32 @@ namespace PDF_Master.Helper
 
         #endregion 缓存注释属性
 
+        #region 缓存编辑属性
+
+        public static DefaultEditProperty GetPDFEditDefaultProperty(ComPDFKit.PDFPage.CPDFEditType editType, string saveKey = "")
+        {
+            if (Settings.Default.DefaultEditProperties != null)
+            {
+                if (saveKey == "")
+                {
+                    return Settings.Default.DefaultEditProperties.GetEditProperty(editType);
+                }
+                return Settings.Default.DefaultEditProperties.GetEditProperty(editType, saveKey);
+            }
+            return null;
+        }
+
+        public static void SetPDFEditProperty(DefaultEditProperty editType)
+        {
+            if (Settings.Default.DefaultEditProperties == null)
+            {
+                Settings.Default.DefaultEditProperties = new DefaultEditProperties();
+            }
+            Settings.Default.DefaultEditProperties.SetEditProperty(editType);
+            Settings.Default.Save();
+        }
+
+        #endregion 缓存编辑属性
 
         #region 缓存颜色列表
 
@@ -315,4 +341,4 @@ namespace PDF_Master.Helper
             //Settings.Default.Save();
         }
     }
-}
+}

+ 2 - 2
PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs

@@ -24,9 +24,9 @@ namespace PDF_Master.Model.Dialog.ConverterDialogs
 
         /// <summary>
         /// 开启ocr时是否选择包含ocr底图
-        /// 如果包含 ,PDF转HTML的时候,ocr,会重叠
+        /// 如果包含 ,PDF转HTML的时候,ocr,会重叠=>特殊文档
         /// </summary>
-        public bool IsContainOCRBgImage = false;
+        public bool IsContainOCRBgImage = true;
         public bool IsContainAnnotations = true;
         public bool IsContainImages = true;
         public ContentOptions ContentOpts = ContentOptions.AllContent;

+ 14 - 2
PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs

@@ -1,4 +1,5 @@
-using PDF_Master.CustomControl.CompositeControl;
+using ImTools;
+using PDF_Master.CustomControl.CompositeControl;
 using PDF_Master.Helper;
 using PDF_Master.Model.AnnotPanel;
 using PDF_Master.Properties;
@@ -10,6 +11,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
+using System.Windows.Controls;
 using System.Windows.Media;
 
 namespace PDF_Master.Model.PropertyPanel.AnnotPanel
@@ -361,11 +363,21 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
                 {
                     content = "Informal Roman";
                 }
-                if (itemFam.Equals("Marlett"))
+                //屏蔽 SDK暂时无效的字体
+                if (itemFam.Equals("Marlett") || itemFam.Equals("MT Extra")
+                 || itemFam.Equals("Symbol") || itemFam.Equals("HoloLens MDL2 Assets")
+                 || itemFam.Equals("Wingdings") || itemFam.Equals("Wingdings 2")
+                 || itemFam.Equals("Wingdings 3") || itemFam.Equals("Webdings")
+                 || itemFam.Equals("ZWAdobeF") || itemFam.Equals("Algerian")
+                 || itemFam.Equals("Bookshelf Symbol 7") || itemFam.Equals("Castellar")
+                 || itemFam.Equals("MS Outlook") || itemFam.Equals("MS Reference Specialty")
+                 || itemFam.Equals("Segoe Fluent Icons") || itemFam.Equals("Segoe MDL2 Assets")
+                 || itemFam.Equals("Stencil"))
                 {
                     continue;
                 }
                 item = new ComboDataItem(DeleteCharacters(itemFam), content);
+                item.FontFamily = new FontFamily(content);
                 FontFamilyItems.Add(item);
             }
             return FontFamilyItems;

+ 1 - 0
PDF Office/PDF Master.csproj

@@ -403,6 +403,7 @@
     <Compile Include="Helper\FileComparisonHelper.cs" />
     <Compile Include="Helper\GlobalCommands.cs" />
     <Compile Include="Helper\KeyEventsHelper.cs" />
+    <Compile Include="Helper\PDFEditHelper.cs" />
     <Compile Include="Helper\Win32Helper.cs" />
     <Compile Include="Helper\DpiHelpers.cs" />
     <Compile Include="Helper\EditToolsHelper.cs" />

+ 1 - 1
PDF Office/PDF Master.csproj.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectView>ShowAllFiles</ProjectView>
+    <ProjectView>ProjectFiles</ProjectView>
   </PropertyGroup>
 </Project>

+ 15 - 4
PDF Office/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace PDF_Master.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -295,6 +295,17 @@ namespace PDF_Master.Properties {
             }
         }
         
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::PDFSettings.PreinstallFontList PreinstallFontList {
+            get {
+                return ((global::PDFSettings.PreinstallFontList)(this["PreinstallFontList"]));
+            }
+            set {
+                this["PreinstallFontList"] = value;
+            }
+        }
+        
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         public global::PDFSettings.PDFEditList PDFEditList {
@@ -308,12 +319,12 @@ namespace PDF_Master.Properties {
         
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        public global::PDFSettings.PreinstallFontList PreinstallFontList {
+        public global::PDFSettings.DefaultEditProperties DefaultEditProperties {
             get {
-                return ((global::PDFSettings.PreinstallFontList)(this["PreinstallFontList"]));
+                return ((global::PDFSettings.DefaultEditProperties)(this["DefaultEditProperties"]));
             }
             set {
-                this["PreinstallFontList"] = value;
+                this["DefaultEditProperties"] = value;
             }
         }
     }

+ 3 - 0
PDF Office/Properties/Settings.settings

@@ -80,5 +80,8 @@
     <Setting Name="PDFEditList" Type="PDFSettings.PDFEditList" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
+    <Setting Name="DefaultEditProperties" Type="PDFSettings.DefaultEditProperties" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
   </Settings>
 </SettingsFile>

BIN
PDF Office/Resources/GuidPDF/Quick Start Guide.pdf


+ 1 - 0
PDF Office/Styles/ListViewStyle.xaml

@@ -404,6 +404,7 @@
     </Style>
 
     <Style x:Key="ListBoxItemGraySelectStyle" TargetType="{x:Type ListBoxItem}">
+        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
         <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
         <Setter Property="Panel.Background" Value="{StaticResource color.sys.layout.mg}" />
         <Setter Property="Border.BorderBrush" Value="{StaticResource color.sys.layout.mg}" />

+ 2 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -373,7 +373,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                 if (folderMD5)
                 {
                     string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                    CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                    CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                     CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                 }
                 else
@@ -390,7 +390,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                             if (e.Result == Prism.Services.Dialogs.ButtonResult.OK)
                             {
                                 string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                                CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                                CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                                 CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                             }
                             else

+ 2 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs

@@ -195,7 +195,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                 if (folderMD5)
                 {
                     string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                    CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                    CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                     CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                 }
                 else
@@ -212,7 +212,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                             if (e.Result == Prism.Services.Dialogs.ButtonResult.OK)
                             {
                                 string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                                CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                                CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                                 CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                             }
                             else

+ 2 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs

@@ -223,7 +223,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                 if (folderMD5)
                 {
                     string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                    CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                    CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                     CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                 }
                 else
@@ -240,7 +240,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                             if (e.Result == Prism.Services.Dialogs.ButtonResult.OK)
                             {
                                 string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                                CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                                CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                                 CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                             }
                             else

+ 2 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs

@@ -195,7 +195,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                 if (folderMD5)
                 {
                     string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                    CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                    CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                     CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                 }
                 else
@@ -212,7 +212,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                             if (e.Result == Prism.Services.Dialogs.ButtonResult.OK)
                             {
                                 string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                                CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                                CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                                 CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                             }
                             else

+ 2 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs

@@ -196,7 +196,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                 if (folderMD5)
                 {
                     string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                    CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                    CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                     CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                 }
                 else
@@ -213,7 +213,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                             if (e.Result == Prism.Services.Dialogs.ButtonResult.OK)
                             {
                                 string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                                CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                                CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                                 CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                             }
                             else

+ 2 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs

@@ -230,7 +230,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                 if (folderMD5)
                 {
                     string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                    CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                    CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                     CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                 }
                 else
@@ -247,7 +247,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                             if (e.Result == Prism.Services.Dialogs.ButtonResult.OK)
                             {
                                 string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
-                                CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
+                                CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
                                 CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
                             }
                             else

+ 89 - 42
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -33,15 +33,17 @@ using static PDF_Master.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySetti
 
 namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
 {
-    class MergeDialogViewModel : BindableBase, IDialogAware
+    internal class MergeDialogViewModel : BindableBase, IDialogAware
     {
         // Fix:存储当前程序加载的文档的路径和tag,
         //如果路径相同则用tag里的密码解锁,
         //解锁失败再另行提权
         private string CurrentFilePath = string.Empty;
+
         private string currentLoadedPassword = string.Empty;
-        private IEventAggregator eventAggregator;
-        enum PageSizeType
+        private IEventAggregator eventAggregator;
+
+        private enum PageSizeType
         {
             kDefault = 0,
             A4 = 1,
@@ -63,8 +65,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
         }
 
         public void OnDialogClosed()
-        {
-
+        {
         }
 
         public void OnDialogOpened(IDialogParameters parameters)
@@ -112,7 +113,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             }
         }
 
-        #endregion
+        #endregion 框架内容
+
         #region 定义与初始化
 
         public ObservableCollection<MergeObject> MergeObjectlist { get; set; }
@@ -143,6 +145,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
         }
 
         private Visibility processVisible = Visibility.Collapsed;
+
         /// <summary>
         /// 是否显示进度条
         /// </summary>
@@ -156,6 +159,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
         }
 
         private bool _AddOpenFileIsEn = false;
+
         /// <summary>
         /// 添加已打开文件是否置灰
         /// </summary>
@@ -167,6 +171,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                 SetProperty(ref _AddOpenFileIsEn, value);
             }
         }
+
         private string inputHeight;
 
         public string InputHeight
@@ -179,6 +184,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
         }
 
         private double maxValue;
+
         /// <summary>
         /// 最大文件数 用于显示进度条
         /// </summary>
@@ -204,15 +210,18 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                 SetProperty(ref currentvalue, value);
             }
         }
-       /// <summary>
-       /// 订阅按钮
-       /// </summary>
+
+        /// <summary>
+        /// 订阅按钮
+        /// </summary>
         private string _TextUpgrade;
+
         public string TextUpgrade
         {
             get { return _TextUpgrade; }
             set { _TextUpgrade = value; }
         }
+
         /// <summary>
         /// 是否显示限制字段
         /// </summary>
@@ -231,9 +240,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
         /// 是否取消添加文件
         /// </summary>
 
-        private bool CancelAddFiles = false;
-
-
+        private bool CancelAddFiles = false;
+
         public MergeDialogViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
         {
             IntString();
@@ -249,6 +257,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             CancelAddFileCommand = new DelegateCommand(CancelAddFileOpention);
             UnlockMouseDownCommand = new DelegateCommand(UnlockMouseDown);
         }
+
         /// <summary>
         /// 多语
         /// </summary>
@@ -257,14 +266,15 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             TextUpgrade = App.ServiceLoader.GetString("TextUpgrade");
         }
 
-        #endregion
+        #endregion 定义与初始化
 
         #region 私有方法
 
         private void UnlockMouseDown()
         {
             ConverterHelper.convertUnlock();
-        }
+        }
+
         private void CancelAddFileOpention()
         {
             CancelAddFiles = true;
@@ -284,6 +294,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             Clear();
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
         }
+
         /// <summary>
         /// 点击取消页面范围控件使失去焦点不生效
         /// </summary>
@@ -307,6 +318,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                 }
             }
         }
+
         public void ButtonAddFiles(object data)
         {
             int index = Convert.ToInt32(data);
@@ -316,11 +328,13 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                 case 0:
                     //打开文件
                     AddFiles(OpenFile());
-                    break;
+                    break;
+
                 case 1:
                     //打开文件夹
                     AddFiles(OpenFileFolder());
-                    break;
+                    break;
+
                 case 2:
                     //打开当前文件
                     List<string> list = new List<string>();
@@ -330,7 +344,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                         list.Add(App.OpenedFileList[i]);
                     }
                     AddFiles(list.ToArray());
-                    break;
+                    break;
+
                 default:
                     break;
             }
@@ -342,7 +357,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
         private void AddOpenFileIsEnChange()
         {
             AddOpenFileIsEn = false;
-            if (MergeObjectlist.Count> App.OpenedFileList.Count)
+            if (MergeObjectlist.Count > App.OpenedFileList.Count)
             {
                 AddOpenFileIsEn = true;
                 return;
@@ -365,9 +380,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                     break;
                 }
             }
-        }
-
-
+        }
+
         private string[] OpenFileFolder()
         {
             System.Windows.Forms.FolderBrowserDialog openFile = new System.Windows.Forms.FolderBrowserDialog();
@@ -395,7 +409,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             }
 
             return list.ToArray();
-        }
+        }
+
         private string[] OpenFile()
         {
             OpenFileDialog openFile = new OpenFileDialog();
@@ -410,7 +425,6 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
 
         private void Merge()
         {
-
             bool result = true;
             CPDFDocument SaveDoc = CPDFDocument.CreateDocument();
             int sum = MergeObjectlist.Count;
@@ -423,7 +437,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                 List<int> listnum = new List<int>();
                 if (MergeObjectlist[i].SetPageRange == null || MergeObjectlist[i].SetPageRange.Count == 0)
                 {
-                    if (MergeObjectlist[i].SDKPageCount == 0) {
+                    if (MergeObjectlist[i].SDKPageCount == 0)
+                    {
                         AlertsMessage alertsMessage = new AlertsMessage();
                         alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
                         return;
@@ -434,7 +449,6 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                         pageRangeList.Add(page1);
                     }
                     MergeObjectlist[i].SetPageRange = pageRangeList;
-                   
                 }
             }
 
@@ -474,8 +488,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                         catch
                         {
                             continue;
-                        }
-
+                        }
                     }
                     else
                     {
@@ -554,24 +567,29 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             switch (pageSizeType)
             {
                 case PageSizeType.kDefault:
-                    break;
+                    break;
+
                 case PageSizeType.A4:
 
                     rect.Width = CommonHelper.GetPageSizeFomrUnit(210);
                     rect.Height = CommonHelper.GetPageSizeFomrUnit(297);
-                    break;
+                    break;
+
                 case PageSizeType.A3:
                     rect.Width = CommonHelper.GetPageSizeFomrUnit(297);
                     rect.Height = CommonHelper.GetPageSizeFomrUnit(420);
-                    break;
+                    break;
+
                 case PageSizeType.Letter:
                     rect.Width = CommonHelper.GetPageSizeFomrUnit(216);
                     rect.Height = CommonHelper.GetPageSizeFomrUnit(279);
-                    break;
+                    break;
+
                 case PageSizeType.Legal:
                     rect.Width = CommonHelper.GetPageSizeFomrUnit(216);
                     rect.Height = CommonHelper.GetPageSizeFomrUnit(356);
-                    break;
+                    break;
+
                 case PageSizeType.Customized:
                     if (!string.IsNullOrEmpty(InputWidth) && !string.IsNullOrEmpty(InputHeight))
                     {
@@ -583,7 +601,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                         rect.Width = CommonHelper.GetPageSizeFomrUnit(595);
                         rect.Height = CommonHelper.GetPageSizeFomrUnit(841);
                     }
-                    break;
+                    break;
+
                 default:
                     break;
             }
@@ -619,7 +638,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             }
         }
 
-        #endregion
+        #endregion 私有方法
 
         #region 公开方法
 
@@ -660,9 +679,18 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             {
                 return;
             }
+            // 免费用户 限制只选两个文件的逻辑
+            //if (Settings.Default.UserDate.subscribestatus != 1 && MergeObjectlist.Count >= 2)
+            //{
+            //    return;
+            //}
             bool showDialog = false;
             ProcessVisible = Visibility.Visible;
             MaxValue = FilePath.Length;
+
+            // 免费用户 限制只选两个文件的逻辑
+            //int sum = SetFilesLength(FilePath);
+
             for (int i = 0; i < FilePath.Length; i++)
             {
                 //加入异步语句,防止UI卡死,显示加载进度条
@@ -763,7 +791,6 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                     }
                     else
                     {
-
                         VerifyPasswordResult condition = new VerifyPasswordResult();
                         App.Current.Dispatcher.Invoke(() =>
                         {
@@ -777,7 +804,6 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                                 mergeObject.Password = condition.Password;
                                 if (doc.UnlockWithPassword(condition.Password) && doc.CheckOwnerPassword(condition.Password))
                                 {
-
                                 }
                             }
                         }
@@ -786,8 +812,6 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                             doc.Release();
                             continue;
                         }
-
-
                     }
 
                     mergeObject.DocName = doc.FileName;
@@ -803,7 +827,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                         mergeObject.IsEvenPageIsEnabled = false;
                     }
                     mergeObject.SDKPageCount = doc.PageCount;
-                    
+
                     mergeObject.DocSize = CommonHelper.GetFileSize(mergeObject.FilePath);
 
                     //获取第一页缩略图
@@ -836,7 +860,30 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
                 {
                 }
             }
-        }
-        #endregion
+        }
+
+        /// <summary>
+        ///  未购买的用户 设置文件数量
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <returns></returns>
+        private int SetFilesLength(string[] filePath)
+        {
+            int sum = filePath.Length;
+            if (Settings.Default.UserDate.subscribestatus != 1 && sum >= 2)
+            {
+                if (MergeObjectlist.Count >= 1)
+                {
+                    sum = 1;
+                }
+                else
+                {
+                    sum = 2;
+                }
+            }
+            return sum;
+        }
+
+        #endregion 公开方法
     }
-}
+}

+ 9 - 1
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -1865,7 +1865,15 @@ namespace PDF_Master.ViewModels.PageEdit
         /// </summary>
         private void clearSelected()
         {
-            ListSelectedIndex = -1;
+            //缩略图不支持esc取消选中;
+            if (IsBOTAThumb == Visibility.Visible)
+            {
+                return;
+            }
+            else
+            {
+                ListSelectedIndex = -1;
+            }
         }
 
         /// <summary>

+ 77 - 66
PDF Office/ViewModels/PropertyPanel/PDFEdit/ImageEditPropertyViewModel.cs

@@ -28,15 +28,16 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
     {
         public TextEditToolContentViewModel TextEditToolContentViewModel;
         private IEventAggregator events;
+
         /// <summary>
         /// 用于区分事件的唯一码
         /// </summary>
         private string unicode;
+
         #region 快捷键
+
         private void ShortCut_KeyDown(object sender, KeyEventArgs e)
         {
-
-
             if (e.Key == Key.Escape)
             {
                 if (PDFViewer != null)
@@ -44,33 +45,34 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                     if (PDFViewer.ToolManager != null && IsCrop == true)
                     {
                         CancelCropImg();
-
-                    } 
-                   
+                    }
                 }
             }
-            else if(e.Key==Key.Enter)
+            else if (e.Key == Key.Enter)
             {
                 CropImg();
             }
-
-
         }
 
+        #endregion 快捷键
 
-        #endregion
         #region 属性和变量
+
         //防止自动保存属性值
         private bool isCanSave = false;
-        public event EventHandler ClearCheckedAglin;
 
+        public event EventHandler ClearCheckedAglin;
 
         #region 是否为多选内容
+
         private bool _isMultiSelectImage = false;
-        public bool IsMultiSelectImage { get { return _isMultiSelectImage; } set { SetProperty(ref _isMultiSelectImage, value); } }
-        #endregion
-       
-       private string _opacity1= "Opacity";
+        public bool IsMultiSelectImage
+        { get { return _isMultiSelectImage; } set { SetProperty(ref _isMultiSelectImage, value); } }
+
+        #endregion 是否为多选内容
+
+        private string _opacity1 = "Opacity";
+
         public string Opacity
         {
             get { return _opacity1; }
@@ -79,30 +81,34 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
 
         //不透明度
         private double _opacity;
+
         public double OpacityUI
         {
             get { return _opacity; }
             set { SetProperty(ref _opacity, value); }
         }
+
         private int _OpacitySelectedIndex = 1;
+
         public int OpacitySelectedIndex
         {
             get { return _OpacitySelectedIndex; }
             set { SetProperty(ref _OpacitySelectedIndex, value); }
         }
+
         private double _transpent;
+
         public double Transpent
         {
             get { return _transpent; }
             set
             {
                 SetProperty(ref _transpent, value);
-                if (Transpent == 100|| Transpent == 75||Transpent == 50|| (Transpent == 25))
+                if (Transpent == 100 || Transpent == 75 || Transpent == 50 || (Transpent == 25))
                 {
                     TextEditEvent.Transparency = (int)((_transpent * 255) / 100.0);
                     TextEditEvent.UpdatePDFEditByEventArgs();
                     OpacityUI = _transpent / 100.0;
-                  
                 }
                 else
                 {
@@ -110,11 +116,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 }
             }
         }
+
         //是否为图片裁剪状态
         private bool _isCrop = false;
-        public bool IsCrop { get { return _isCrop; } set { SetProperty(ref _isCrop, value); } }
-        public  TextEditToolContentViewModel _viewModel1;
 
+        public bool IsCrop
+        { get { return _isCrop; } set { SetProperty(ref _isCrop, value); } }
+        public TextEditToolContentViewModel _viewModel1;
 
         //public ImageEditPropertyViewModel(TextEditToolContentViewModel viewModel1)
         //{
@@ -122,16 +130,15 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         //    _viewModel1.PropertyChanged += OnViewModel1PropertyChanged;
         //}
 
-     
         private void OnViewModel1PropertyChanged(object sender, PropertyChangedEventArgs e)
         {
             if (e.PropertyName == "flg")
             {
                 IsCrop = _viewModel1.flg;
             }
-            if(e.PropertyName== "ReplaceImgflg")
+            if (e.PropertyName == "ReplaceImgflg")
             {
-                if(_viewModel1.ReplaceImgflg==true)
+                if (_viewModel1.ReplaceImgflg == true)
                 {
                     ReplaceImg();
                     _viewModel1.ReplaceImgflg = false;
@@ -157,18 +164,23 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
 
         //选中的图像
         private System.Windows.Media.Imaging.BitmapSource _currentImg;
-        public System.Windows.Media.Imaging.BitmapSource CurrentImg { get { return _currentImg; } set { SetProperty(ref _currentImg, value); } }
 
+        public System.Windows.Media.Imaging.BitmapSource CurrentImg
+        { get { return _currentImg; } set { SetProperty(ref _currentImg, value); } }
 
-        #endregion
+        #endregion 属性和变量
 
         #region Command
+
         //替换
         public DelegateCommand ReplaceImgCommand { get; set; }
+
         //导出
         public DelegateCommand ExportImgCommand { get; set; }
+
         //裁剪
         public DelegateCommand CropImgCommand { get; set; }
+
         //对齐
         public DelegateCommand<object> ImgAlignCheckedCommand { get; set; }
 
@@ -183,16 +195,19 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
 
         //上下翻转
         public DelegateCommand UpsidedownCommand { get; set; }
+
         //裁剪状态
         public DelegateCommand CropModeCommand { get; set; }
+
         //取消裁剪状态
         public DelegateCommand CancelCropCommand { get; set; }
 
         //还原裁剪状态
         public DelegateCommand RestoreCropCommand { get; set; }
-       
+
         //添加文本
         public DelegateCommand AddTextCommand { get; set; }
+
         //添加图片
         public DelegateCommand AddImgCommand { get; set; }
 
@@ -200,7 +215,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         public DelegateCommand TranspentslidCommand { get; set; }
 
         public DelegateCommand EditImgModeCommand { get; set; }
-        #endregion
+
+        #endregion Command
 
         public ImageEditPropertyViewModel(IEventAggregator eventAggregator)
         {
@@ -208,16 +224,16 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             events = eventAggregator;
             unicode = App.mainWindowViewModel.SelectedItem.Unicode;
         }
+
         private void InitCommand()
         {
-
             AddTextCommand = new DelegateCommand(AddText);
             AddImgCommand = new DelegateCommand(AddImg);
             ReplaceImgCommand = new DelegateCommand(ReplaceImg);
             ExportImgCommand = new DelegateCommand(ExportImg);
             CropImgCommand = new DelegateCommand(CropImg);
             ImgAlignCheckedCommand = new DelegateCommand<object>(ImgAlignChecked);
-            TranspentslidCommand = new DelegateCommand(Transpentslid);           
+            TranspentslidCommand = new DelegateCommand(Transpentslid);
             AntiClockwiseCommand = new DelegateCommand(AntiClockwise);
             ClockwiseCommand = new DelegateCommand(Clockwise);
             FlipleftrightCommand = new DelegateCommand(Flipleftright);
@@ -225,14 +241,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             CropModeCommand = new DelegateCommand(CropMode);
             CancelCropCommand = new DelegateCommand(CancelCropImg);
             RestoreCropCommand = new DelegateCommand(RestoreCropImg);
-            EditImgModeCommand = new DelegateCommand(EditImgMode);      
+            EditImgModeCommand = new DelegateCommand(EditImgMode);
         }
 
         #region Command实现
-     
 
         //不透明度滑动左键松开
-       private void Transpentslid()
+        private void Transpentslid()
         {
             if (TextEditEvent != null && isCanSave)
             {
@@ -247,19 +262,17 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 }
                 else
                 {
-                    TextEditEvent.Transparency = (int)((_transpent * 255)/100.0);
+                    TextEditEvent.Transparency = (int)((_transpent * 255) / 100.0);
                     TextEditEvent.UpdatePDFEditByEventArgs();
                     OpacityUI = _transpent / 100.0;
                     TextEditEvent.SaveClip();
                 }
- 
             }
         }
 
         //点击编辑按钮,暂时保留
         private void EditImgMode()
         {
-
         }
 
         //添加文本模式
@@ -284,6 +297,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 }
             }
         }
+
         /// <summary>
         /// 压缩
         /// </summary>
@@ -339,7 +353,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             }
         }
 
-
         /// <summary>
         ///  根据图片数据判断图片类型
         /// </summary>
@@ -363,7 +376,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 }
                 catch
                 {
-
                     extension = FileExtension.VALIDFILE;
                 }
                 return extension;
@@ -382,7 +394,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             }
         }
 
-
         //进入裁剪模式
         private void CropMode()
         {
@@ -471,20 +482,18 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                     TextEditEvent.ReplaceImagePath = openFileDialog.FileName;
                     TextEditEvent.UpdatePDFEditByEventArgs();
                     ReplaceimgTask();
-                    Transpent =100;
+                    Transpent = 100;
                 }
-            }       
+            }
         }
 
         //此处只有异步 ReplaceimgTask()才有作用
         private async void ReplaceimgTask()
         {
-            await Task.Delay(100);
+            await Task.Delay(10);
             GetImagePreView();
-
         }
 
-
         //顺时针旋转
         private void Clockwise()
         {
@@ -509,9 +518,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         private void Upsidedown()
         {
             TextEditEvent.VerticalMirror = true;
-           
+
             TextEditEvent.UpdatePDFEditByEventArgs();
-              GetImagePreView();
+            GetImagePreView();
         }
 
         //旋转逻辑
@@ -533,9 +542,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             }
         }
 
-        #endregion
+        #endregion Command实现
 
         #region 布局处理
+
         private void ImgAlignChecked(object obj)
         {
             if (obj != null)
@@ -545,36 +555,44 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                     case "AlignLeft":
                         PDFViewer.SetPDFEditAligment(AlignModes.AlignLeft);
                         break;
+
                     case "AlignHorizonCenter":
                         PDFViewer.SetPDFEditAligment(AlignModes.AlignHorizonCenter);
                         break;
+
                     case "AlignRight":
                         PDFViewer.SetPDFEditAligment(AlignModes.AlignRight);
                         break;
+
                     case "DistributeHorizontal":
                         PDFViewer.SetPDFEditAligment(AlignModes.DistributeHorizontal);
                         break;
+
                     case "AlignTop":
                         PDFViewer.SetPDFEditAligment(AlignModes.AlignTop);
                         break;
+
                     case "AlignVerticalCenter":
                         PDFViewer.SetPDFEditAligment(AlignModes.AlignVerticalCenter);
                         break;
+
                     case "AlignBottom":
                         PDFViewer.SetPDFEditAligment(AlignModes.AlignBottom);
                         break;
+
                     case "DistributeVertical":
                         PDFViewer.SetPDFEditAligment(AlignModes.DistributeVertical);
                         break;
                 }
-
             }
         }
-        #endregion
+
+        #endregion 布局处理
+
         protected List<PDFEditEvent> TextEditEventList;
+
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             navigationContext.Parameters.TryGetValue<List<PDFEditEvent>>(ParameterNames.AnnotEvent, out TextEditEventList);
             navigationContext.Parameters.TryGetValue<TextEditToolContentViewModel>(ParameterNames.TextEditToolContentViewModel, out TextEditToolContentViewModel);
@@ -598,14 +616,12 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
 
         private void PDFViewer_LostFocus(object sender, RoutedEventArgs e)
         {
-
             TextEditEvent.ClipImage = false;
             TextEditEvent.CancelClip();
             TextEditEvent.UpdatePDFEditByEventArgs();
             IsCrop = false;
         }
 
-
         //获取图片参数
         private void LoadedPDFEdit()
         {
@@ -643,9 +659,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             }
         }
 
-
-
         #region 右键菜单
+
         //点击空白处时
         private ContextMenu EmptyStateMenu(object sender)
         {
@@ -660,6 +675,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
 
             return popMenu;
         }
+
         //选中图像时
         private ContextMenu SelectImgPDFEdit(object sender)
         {
@@ -697,6 +713,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             customMenu.SetMenuBinding(2, RestoreCropCommand);
             return popMenu;
         }
+
         //多选图片右键
         private ContextMenu SelectMoreImage(object sender)
         {
@@ -713,17 +730,16 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             //导出
             customMenu.SetMenuBinding(4, ExportImgCommand);
 
-
             return popMenu;
-        } 
-        #endregion
+        }
 
+        #endregion 右键菜单
 
         //左键点击逻辑
         private void PDFViewer_PDFEditActiveHandler(object sender, List<PDFEditEvent> e)
         {
             //退出编辑模式
-               IsCrop = false;
+            IsCrop = false;
             TextEditEvent.ClipImage = false;
             TextEditEvent.UpdatePDFEditByEventArgs();
         }
@@ -731,7 +747,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         //右键逻辑
         private void PDFViewer_PDFEditCommandHandler(object sender, PDFEditCommand e)
         {
-            
             if (e == null)
                 return;
 
@@ -748,21 +763,19 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                     //    {
                     //        e.PopupMenu = SelectImgPDFEdit(sender);
                     //    }
-                        
+
                     //}
-                    //else 
+                    //else
                     if (e.EditType == ComPDFKit.PDFPage.CPDFEditType.None)
                     {
                         e.PopupMenu = EmptyStateMenu(sender);
-
                     }
-           
+
                     break;
 
                 default:
                     e.DoCommand();
                     break;
-
             }
             if (e.PopupMenu != null)
             {
@@ -796,17 +809,15 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                         CurrentImg = bitmapSource;
                         events.GetEvent<PageEditNotifyEvent>().Publish(new PageEditNotifyEventArgs(unicode));
                     }
-
                 }
             }
             catch
             {
-
             }
-         
         }
-        public bool IsNavigationTarget(NavigationContext navigationContext) { return true; }
 
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        { return true; }
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
@@ -820,4 +831,4 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             PDFViewer.LostFocus -= PDFViewer_LostFocus;
         }
     }
-}
+}

+ 85 - 55
PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs

@@ -1,4 +1,5 @@
-using ComPDFKitViewer;
+using ComPDFKit.PDFPage;
+using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using Microsoft.Win32;
@@ -7,6 +8,7 @@ using PDF_Master.Helper;
 using PDF_Master.Model;
 using PDF_Master.Model.AnnotPanel;
 using PDF_Master.Model.PropertyPanel.AnnotPanel;
+using PDF_Master.Properties;
 using PDF_Master.ViewModels.Tools.AnnotManager;
 using PDFSettings;
 using Prism.Commands;
@@ -26,27 +28,31 @@ using static Dropbox.Api.Files.WriteMode;
 
 namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
 {
-
     public class TextEditPropertyViewModel : PDFEditVM, INavigationAware
     {
-
         #region 属性
+
         public event EventHandler ClearCheckedAglin;
+
         public TextEditPropertyViewModel()
         {
             InitVariable();
             InitCommand();
         }
+
         private void InitVariable()
         {
             InitBaseVariable();
         }
+
         private bool isSelectedEmpty;
+
         public bool IsSelectedEmpty
         {
             get { return isSelectedEmpty; }
             set { SetProperty(ref isSelectedEmpty, value); }
         }
+
         private string title;
 
         public string Title
@@ -57,6 +63,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 SetProperty(ref title, value);
             }
         }
+
         private FontBoardVm _fontVm = new FontBoardVm(true);
 
         public FontBoardVm FontVm
@@ -65,17 +72,18 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             set { SetProperty(ref _fontVm, value); }
         }
 
-
         private ComPDFKit.PDFPage.Edit.TextAlignType _textAlign;
+
         public ComPDFKit.PDFPage.Edit.TextAlignType TextAlign
         {
             get { return _textAlign; }
             set { _textAlign = value; }
         }
-        #endregion
+
+        #endregion 属性
+
         #region Command
 
-     
         public DelegateCommand AddTextCommand { get; set; }
         public DelegateCommand AddImgCommand { get; set; }
 
@@ -85,8 +93,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         public DelegateCommand<object> FontSizeChangedCommand { get; set; }
 
         public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
+
         //进入属性面板编辑
         public DelegateCommand EditTextModeCommand { get; set; }
+
         public DelegateCommand FontFamilyChangedCommand { get; set; }
         public DelegateCommand CustomFontStyleCommand { get; set; }
         public DelegateCommand FontStyleWeightChangedCommand { get; set; }
@@ -94,14 +104,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
 
         //重定义
         public DelegateCommand ReDefineFontStyleCommand { get; set; }
+
         public DelegateCommand RestoreDefaultStyleCommand { get; set; }
         public DelegateCommand<object> LayoutAlignCheckedCommand { get; set; }
-        
 
-        #endregion
+        #endregion Command
 
         #region 初始化
-      
 
         private void InitCommand()
         {
@@ -135,7 +144,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             LayoutAlignCheckedCommand = new DelegateCommand<object>(LayoutAlignChecked);
         }
 
-        #endregion
+        #endregion 初始化
 
         #region 文本处理逻辑
 
@@ -152,8 +161,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
 
         private void EditTextMode()
         {
-
         }
+
         /// <summary>
         /// 从预设样式设置文本
         /// </summary>
@@ -189,7 +198,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         /// </summary>
         private void CustomFontStyle()
         {
-
             if (CurrentPresetFont != null)
             {
                 ContextMenu menu;
@@ -205,7 +213,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                     var currentItem = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
                     if (currentItem.mTag != "Custom")
                     {
-                        
                         if (FontWeightItem != defaulItem.mFontWeight ||
                             FontStyleItem != defaulItem.mFontStyle ||
                             CurrentFontSize.Value != defaulItem.mFontSize ||
@@ -221,8 +228,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                     menu.IsOpen = true;
                 }
             }
-
-
         }
 
         //设置字体样式
@@ -344,7 +349,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         /// </summary>
         private void ReDefineFontStyle()
         {
-
             var item = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
             if (item == null) return;
 
@@ -377,7 +381,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             //SelectedPresetFont();
             //更改后 保存到本地缓存
             TextFont.SavePresetFontList(PresetFontList);
-
         }
 
         //重置定义
@@ -386,7 +389,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             var defaultlists = TextFont.GetPresetFontStyle();
             if (CurrentPresetFont.ValueStr != "Custom")
             {
-                var defaulItem = defaultlists.FirstOrDefault(temp => temp.mTag ==CurrentPresetFont.ValueStr);
+                var defaulItem = defaultlists.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
                 if (defaulItem != null)
                 {
                     var currentItem = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
@@ -398,7 +401,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                         currentItem.mFontFamily = defaulItem.mFontFamily;
                         currentItem.mFontSize = defaulItem.mFontSize;
                         GetCurrentFontFamily(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
-                       GetCurrentFontSize(currentItem.mFontSize);
+                        GetCurrentFontSize(currentItem.mFontSize);
                         GetFontWeights_Style(currentItem.mFontStyle, currentItem.mFontWeight);
                         CurrentPresetFont = new ComboDataItem(defaulItem.mTag, defaulItem.mTagContent);
                         SelectedPresetFont();
@@ -406,7 +409,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                     }
                 }
             }
-
         }
 
         //设置多选对齐方式
@@ -421,34 +423,39 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                         case "AlignLeft":
                             PDFViewer.SetPDFEditAligment(AlignModes.AlignLeft);
                             break;
+
                         case "AlignHorizonCenter":
                             PDFViewer.SetPDFEditAligment(AlignModes.AlignHorizonCenter);
                             break;
+
                         case "AlignRight":
                             PDFViewer.SetPDFEditAligment(AlignModes.AlignRight);
                             break;
+
                         case "DistributeHorizontal":
                             PDFViewer.SetPDFEditAligment(AlignModes.DistributeHorizontal);
                             break;
+
                         case "AlignTop":
                             PDFViewer.SetPDFEditAligment(AlignModes.AlignTop);
                             break;
+
                         case "AlignVerticalCenter":
                             PDFViewer.SetPDFEditAligment(AlignModes.AlignVerticalCenter);
                             break;
+
                         case "AlignBottom":
                             PDFViewer.SetPDFEditAligment(AlignModes.AlignBottom);
                             break;
+
                         case "DistributeVertical":
                             PDFViewer.SetPDFEditAligment(AlignModes.DistributeVertical);
                             break;
                     }
-
                 }
             }
         }
 
-
         //设置文本框内对齐方式
         private void TextAlignChecked(object obj)
         {
@@ -517,7 +524,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 if (colorValue != null)
                 {
                     SelectColor = new SolidColorBrush(colorValue);
-
                 }
             }
         }
@@ -528,11 +534,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             if (obj != null && (PresetFontItem)obj != null)
             {
                 var item = (PresetFontItem)obj;
-
             }
         }
 
-
         //设置字体大小
         private void FontSizeChanged(object obj)
         {
@@ -579,8 +583,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             }
         }
 
-
-        #endregion
+        #endregion 文本处理逻辑
 
         #region 右键菜单
 
@@ -599,9 +602,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             return popMenu;
         }
 
-
-        #endregion
-
+        #endregion 右键菜单
 
         #region 编辑PDF内容触发的事件
 
@@ -610,7 +611,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         /// </summary>
         private void PDFViewer_PDFEditCommandHandler(object sender, PDFEditCommand e)
         {
-
             //if (e == null)
             //    return;
 
@@ -653,7 +653,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 menuItem.IsEnabled = false;
                 if (currentItem.mTag != "Custom")
                 {
-
                     if (FontWeightItem != currentItem.mFontWeight ||
                         FontStyleItem != currentItem.mFontStyle ||
                         CurrentFontSize.Value != currentItem.mFontSize ||
@@ -663,7 +662,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                         menuItem.Command = ReDefineFontStyleCommand;
                     }
                 }
-              
+
                 //恢复默认预设样式
                 menuItem = popMenu.Items[1] as MenuItem;
                 menuItem.IsEnabled = isEnable;
@@ -671,17 +670,17 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             }
             return popMenu;
         }
-        #endregion
+
+        #endregion 编辑PDF内容触发的事件
 
         protected List<PDFEditEvent> TextEditEventList;
+
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             navigationContext.Parameters.TryGetValue<List<PDFEditEvent>>(ParameterNames.AnnotEvent, out TextEditEventList);
             if (PDFViewer != null)
             {
-
                 if (TextEditEventList != null && TextEditEventList.Count > 0)
                 {
                     TextEditEvent = TextEditEventList[0];
@@ -739,11 +738,27 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             }
         }
 
-        //文本内容改变触发
+        private DefaultEditProperty GetEditDefault(ComPDFKit.PDFPage.CPDFEditType editType)
+        {
+            var edit = SettingHelper.GetPDFEditDefaultProperty(editType);
+            if (edit == null)
+            {
+                edit = new DefaultEditProperty();
+                edit.EditType = editType;
+            }
+            return edit;
+        }
+
+        /// <summary>
+        /// 文本内容改变触发
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void FontMode_ChangedValue(object sender, FontSetModeType e)
         {
             if (sender != null && TextEditEvent != null)
             {
+                PDFEditEvent pdfEditEvent = PDFEditHelper.GetPDFEditDefaultProperty(out DefaultEditProperty defaultEdit, PDFViewer);
                 switch (e)
                 {
                     case FontSetModeType.PresetFontStyes:
@@ -771,30 +786,44 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                                         itemlist.UpdatePDFEditByEventArgs();
                                     }
                                 }
-
+                                defaultEdit.FontName = TextEditEvent.FontName;
+                                defaultEdit.FontSize = TextEditEvent.FontSize;
+                                defaultEdit.IsBold = TextEditEvent.IsBold;
+                                defaultEdit.IsItalic = TextEditEvent.IsItalic;
                             }
                         }
                         break;
+
                     case FontSetModeType.FontFamilys:
                         if (sender is string == true)
                         {
                             TextEditEvent.FontName = (string)sender;
                             TextEditEvent.UpdatePDFEditByEventArgs();
+
+                            defaultEdit.FontName = TextEditEvent.FontName;
                         }
                         break;
+
                     case FontSetModeType.FontSizes:
-                        if (sender is double == true && (double)sender > 0 && TextEditEvent.FontSize > 0)
+                        if (sender is double == true && (double)sender > 0 && TextEditEvent.FontSize >= 0)
                         {
                             TextEditEvent.FontSize = (double)sender;
                             TextEditEvent.UpdatePDFEditByEventArgs();
+
+                            defaultEdit.FontSize = TextEditEvent.FontSize;
                         }
                         break;
+
                     case FontSetModeType.FontWeight_Style:
                         UpdateFontWeight_Style();
                         TextEditEvent.IsBold = FontWeightItem == FontWeights.Bold;
                         TextEditEvent.IsItalic = FontStyleItem == FontStyles.Italic;
                         TextEditEvent.UpdatePDFEditByEventArgs();
+
+                        defaultEdit.IsBold = TextEditEvent.IsBold;
+                        defaultEdit.IsItalic = TextEditEvent.IsItalic;
                         break;
+
                     case FontSetModeType.FontColor:
                         if (sender is Color == true)
                         {
@@ -810,15 +839,16 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                                 TextEditEvent.UpdatePDFEditByEventArgs();
                             }
                         }
-
+                        defaultEdit.FontColor = TextEditEvent.FontColor;
                         break;
 
                     case FontSetModeType.TextAlignment:
                         break;
-
                 }
+                PDFEditHelper.GetPDFEditEvent(defaultEdit, PDFViewer);
+                SettingHelper.SetPDFEditProperty(defaultEdit);
+                Settings.Default.Save();
             }
-        
         }
 
         //获取文本参数
@@ -826,26 +856,29 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         {
             if (!App.IsGetTextFamily)
             {
-
-                EditHelper.FontFamily = TextEditEvent.SystemFontNameList;
+                if (TextEditEvent.SystemFontNameList.Count > 0)
+                {
+                    EditHelper.FontFamily = TextEditEvent.SystemFontNameList;
+                    App.IsGetTextFamily = true;
+                }
                 InitBase_FontFamilys();
-                App.IsGetTextFamily = true;
             }
+
             SelectColor = new SolidColorBrush(TextEditEvent.FontColor);
-            CurrentFontSize =new ComboDataItem(TextEditEvent.FontSize);
+            CurrentFontSize = new ComboDataItem(TextEditEvent.FontSize);
             CurrentFontFamily = new ComboDataItem(TextEditEvent.FontName, TextEditEvent.FontName);
             FontStyleItem = TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal;
             FontWeightItem = TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal;
             //GetCurrentFontFamily(TextEditEvent.FontName, TextEditEvent.FontName);
             GetFontWeights_Style(FontStyleItem, FontWeightItem);
-          
+
             //判断样式列表中是否存在对应样式
             bool isExist = false;
             foreach (var item in PresetFontList)
             {
                 string itemmFontFamily = item.mFontFamily.Source;
 
-                if (item.mFontFamily.Source == "TimesRoman" )
+                if (item.mFontFamily.Source == "TimesRoman")
                 {
                     itemmFontFamily = "Times-Roman";
                 }
@@ -869,7 +902,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 CurrentPresetFont = new ComboDataItem("Custom", "Custom");
                 GetCurrentFontSize((int)TextEditEvent.FontSize);
 
-                if (TextEditEvent.FontName == ""|| TextEditEvent.FontName == null)
+                if (TextEditEvent.FontName == "" || TextEditEvent.FontName == null)
                 {
                     GetCurrentFontFamily("Arial", "Arial");
                 }
@@ -897,7 +930,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                             }
                             GetFontWeights_Style(TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal, TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal);
                         }
-                      
                     }
                 }
             }
@@ -922,11 +954,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             }
             TextAlign = TextEditEvent.TextAlign;
             TextEditEvent.UpdatePDFEditByEventArgs();
-        
-    }
-
-        public bool IsNavigationTarget(NavigationContext navigationContext) { return true; }
+        }
 
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        { return true; }
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
@@ -937,6 +968,5 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
             PDFViewer.PDFEditCommandHandler -= PDFViewer_PDFEditCommandHandler;
             ChangedValue -= FontMode_ChangedValue;
         }
-
     }
 }

+ 87 - 6
PDF Office/ViewModels/Tools/TextEditToolContentViewModel.cs

@@ -29,6 +29,9 @@ using PDFReader_WPF.Helper;
 using PDF_Master.Properties;
 using PDF_Master.Model.AnnotPanel;
 using System.Diagnostics;
+using ComPDFKit.PDFPage.Edit;
+using ComPDFKit.PDFPage;
+using PDFSettings;
 
 namespace PDF_Master.ViewModels.Tools
 {
@@ -36,6 +39,11 @@ namespace PDF_Master.ViewModels.Tools
     {
         #region 属性与变量
 
+        /// <summary>
+        /// 本地配置中的编辑属性
+        /// </summary>
+        private PDFEditEvent pdfDefaultEditEvent;
+
         public ViewContentViewModel viewContentViewModel;
         private CPDFViewer PDFViewer;
         private IEventAggregator events;
@@ -422,11 +430,19 @@ namespace PDF_Master.ViewModels.Tools
                     PDFViewer.SetMouseMode(MouseModes.PDFEdit);
                     PDFViewer.ReloadDocument();
                     PDFViewer.SetPDFEditCreateType(ComPDFKit.PDFPage.CPDFEditType.EditText);
+
+                    pdfDefaultEditEvent = PDFEditHelper.GetPDFEditDefaultProperty(out DefaultEditProperty defaultEdit, PDFViewer);
+
                     //单击添加文本
                     PDFViewer.ToolManager.EnableClickCreate = true;
                     PDFViewer.ToolManager.ClickCreateWidth = 60;
                     PDFViewer.ToolManager.ClickCreateHeight = 30;
-                    AddToPropertyPanel("Text", null);
+                    List<PDFEditEvent> pdfEditEvents = new List<PDFEditEvent>();
+                    if (pdfDefaultEditEvent != null)
+                    {
+                        pdfEditEvents.Add(pdfDefaultEditEvent);
+                    }
+                    AddToPropertyPanel("Text", pdfEditEvents);
                     ShowPropertyPanel(true);
                 }
                 else
@@ -456,6 +472,11 @@ namespace PDF_Master.ViewModels.Tools
             {
                 IsImgEdit = false;
                 IsTextEdit = false;
+
+                //添加按钮取消选中 清除空文本和选中文本框的状态
+                PDFViewer.ClearSelectPDFEdit();
+                PDFViewer.RemovePDFEditEmptyText();
+
                 PDFViewer.SetPDFEditCreateType(ComPDFKit.PDFPage.CPDFEditType.None);
 
                 //文本和图像都框选
@@ -601,9 +622,9 @@ namespace PDF_Master.ViewModels.Tools
                 parameters.Add(ParameterNames.AnnotEvent, e);
                 parameters.Add(ParameterNames.TextEditToolContentViewModel, this);
                 System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
-                {
-                    regions.RequestNavigate(RegionNames.PropertyRegionName, btnToProperty[type], parameters);
-                }));
+                                                        {
+                                                            regions.RequestNavigate(RegionNames.PropertyRegionName, btnToProperty[type], parameters);
+                                                        }));
 
                 if (e != null)
                 {
@@ -671,13 +692,33 @@ namespace PDF_Master.ViewModels.Tools
 
                 KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
                 KeyEventsHelper.KeyDown += ShortCut_KeyDown;
+
+                pdfDefaultEditEvent = PDFEditHelper.GetPDFEditDefaultProperty(out DefaultEditProperty defaultEdit, PDFViewer);
             }
         }
 
         private void PDFViewer_PDFEditHandler(object sender, List<PDFEditSelectionData> e)
         {
-            PDFViewer.ClearSelectPDFEdit();
-            PDFViewer.SelectPDFEdit(e, true);
+            if (e != null && e.Count > 0)
+            {
+                foreach (var item in e)
+                {
+                    if (item is PDFEditSelectionData editSelectionData)
+                    {
+                        switch (editSelectionData.Action)
+                        {
+                            case ActionType.Add:
+                                PDFViewer.ClearSelectPDFEdit();
+                                PDFViewer.SelectPDFEdit(e, true);
+                                break;
+
+                            case ActionType.Modify:
+
+                                break;
+                        }
+                    }
+                }
+            }
         }
 
         protected PDFEditEvent TextEditEvent;
@@ -696,6 +737,8 @@ namespace PDF_Master.ViewModels.Tools
                 App.mainWindowViewModel.OpenLogin();
                 return;
             }
+            //从配置文件拿样式
+            pdfDefaultEditEvent = PDFEditHelper.GetPDFEditDefaultProperty(out DefaultEditProperty defaultEdit, PDFViewer);
             if (e != null && e.Count > 0)
             {
                 TextEditEvent = e[0];
@@ -716,6 +759,10 @@ namespace PDF_Master.ViewModels.Tools
 
                 if (isText == true && isImg == false)
                 {
+                    if (e.Count == 1 && string.IsNullOrEmpty(e[0].FontName))
+                    {
+                        e = SynchronizeToPropertyPanel(e, defaultEdit);
+                    }
                     AddToPropertyPanel("Text", e);
                 }
                 if (isText == false && isImg == true)
@@ -745,6 +792,40 @@ namespace PDF_Master.ViewModels.Tools
             events.GetEvent<PageEditNotifyEvent>().Publish(new PageEditNotifyEventArgs(unicode));
         }
 
+        /// <summary>
+        /// 拿配置文件的属性,刷新属性面板
+        /// </summary>
+        /// <param name="e"></param>
+        /// <param name="defaultEdit"></param>
+        /// <returns></returns>
+        private List<PDFEditEvent> SynchronizeToPropertyPanel(List<PDFEditEvent> e, DefaultEditProperty defaultEdit)
+        {
+            List<PDFEditEvent> editEvents = new List<PDFEditEvent>();
+            PDFEditEvent editEvent = e[0];
+
+            if (defaultEdit != null)
+            {
+                editEvent.FontName = defaultEdit.FontName;
+                editEvent.FontSize = defaultEdit.FontSize;
+                editEvent.TextAlign = defaultEdit.TextAlign;
+                editEvent.AutoBlock = false;
+                //editEvent.ClipImage = defaultEdit.ClipImage;
+                //editEvent.EditType = defaultEdit.EditType;
+                editEvent.FontColor = defaultEdit.FontColor;
+                //editEvent.HorizontalMirror = defaultEdit.HorizontalMirror;
+                //editEvent.VerticalMirror = defaultEdit.VerticalMirror;
+                editEvent.IsBold = defaultEdit.IsBold;
+                editEvent.IsItalic = defaultEdit.IsItalic;
+                //editEvent.ReplaceImagePath = defaultEdit.ReplaceImagePath;
+                //editEvent.Rotate = defaultEdit.Rotate;
+                //editEvent.Transparency = defaultEdit.Transparency;
+                //PDFViewer.SetPDFEditParam(editEvent);
+                e[0] = editEvent;
+                editEvents = e;
+            }
+            return editEvents;
+        }
+
         //右键点击逻辑
         private void PDFViewer_PDFEditCommandHandler(object sender, PDFEditCommand e)
         {

+ 12 - 6
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -742,6 +742,12 @@ namespace PDF_Master.ViewModels
         /// </summary>
         private double[] zoomLevel = { 1.00f, 10, 25, 50, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000, 2000, 4000, 10000 };
 
+        /// <summary>
+        /// 鼠标滚轮缩放的缩放值
+        /// 为了提高滚轮缩放 丝滑度
+        /// </summary>
+        private double[] zoomLevel2 = { 1.00f, 10, 15, 20, 25, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 135, 145, 150, 160, 170, 180, 190, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 2000, 3000, 4000, 6000, 10000 };
+
         /// <summary>
         /// 注释-链接,提示语
         /// </summary>
@@ -2215,7 +2221,7 @@ namespace PDF_Master.ViewModels
 
         public void SearchTextFocus(SearchContent searchContent)
         {
-            if (searchContent!=null&&searchContent.SearchText!=null&& string.IsNullOrEmpty(searchContent.SearchText.Text) == false)
+            if (searchContent != null && searchContent.SearchText != null && string.IsNullOrEmpty(searchContent.SearchText.Text) == false)
             {
                 searchContent.SearchText.Dispatcher.BeginInvoke(new Action(() =>
                 {
@@ -2533,16 +2539,16 @@ namespace PDF_Master.ViewModels
             }
 
             zoom *= 100;
-            for (int i = 0; i < zoomLevel.Length - 1; i++)
+            for (int i = 0; i < zoomLevel2.Length - 1; i++)
             {
-                if (zoom > zoomLevel[i] && zoom <= zoomLevel[i + 1] && IsGrowth)
+                if (zoom > zoomLevel2[i] && zoom <= zoomLevel2[i + 1] && IsGrowth)
                 {
-                    standardZoom = zoomLevel[i + 1];
+                    standardZoom = zoomLevel2[i + 1];
                     break;
                 }
-                if (zoom >= zoomLevel[i] && zoom < zoomLevel[i + 1] && !IsGrowth)
+                if (zoom >= zoomLevel2[i] && zoom < zoomLevel2[i + 1] && !IsGrowth)
                 {
-                    standardZoom = zoomLevel[i];
+                    standardZoom = zoomLevel2[i];
                     break;
                 }
             }

+ 1 - 0
PDF Office/Views/BOTA/AnnotationContent.xaml

@@ -59,6 +59,7 @@
                 HorizontalContentAlignment="Stretch"
                 Background="{StaticResource color.sys.layout.mg}"
                 BorderThickness="0"
+                FocusVisualStyle="{x:Null}"
                 ItemTemplate="{StaticResource AnnotationListItemTemplate}"
                 ItemsSource="{Binding AnnotationListItems}"
                 MouseDown="ListBox_MouseDown"

+ 6 - 1
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -17,6 +17,7 @@
     d:DesignHeight="450"
     d:DesignWidth="300"
     prism:ViewModelLocator.AutoWireViewModel="True"
+    KeyDown="UserControl_KeyDown"
     mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
@@ -138,6 +139,7 @@
                 HorizontalContentAlignment="Stretch"
                 Background="{StaticResource color.sys.layout.mg}"
                 BorderThickness="0"
+                FocusVisualStyle="{x:Null}"
                 ItemTemplate="{StaticResource myDataTemplate}"
                 ItemsSource="{Binding Bookmarklist}"
                 PreviewMouseDown="BookMarkListView_PreviewMouseDown"
@@ -145,7 +147,10 @@
                 SelectionChanged="BookMarkListView_SelectionChanged"
                 SelectionMode="Extended">
                 <ListBox.ContextMenu>
-                    <ContextMenu x:Name="ContextMenuBook" FontSize="14" Visibility="Collapsed">
+                    <ContextMenu
+                        x:Name="ContextMenuBook"
+                        FontSize="14"
+                        Visibility="Collapsed">
                         <MenuItem Click="MenuItemRename_Click" Header="{x:Static mainPageLoader:MainPage.Bookmark_Rename}" />
                         <MenuItem Click="MenuChangeItem_Click" Header="{x:Static mainPageLoader:MainPage.Bookmark_Change}" />
                         <MenuItem Click="MenuItemDeleteCommand_Click" Header="{x:Static mainPageLoader:MainPage.Bookmark_Delete}" />

+ 16 - 0
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -470,5 +470,21 @@ namespace PDF_Master.Views.BOTA
                 }
             }
         }
+
+        private void UserControl_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Delete)
+            {
+                if (BookMarkListView.SelectedItems.Count != 0)
+                {
+                    MenuItemDeleteCommand_Click(sender, e);
+
+                    TxtTitle.Dispatcher.BeginInvoke(new Action(() =>
+                    {
+                        TxtTitle.Focus();
+                    }));
+                }
+            }
+        }
     }
 }

+ 10 - 0
PDF Office/Views/BOTA/OutLineControl.xaml.cs

@@ -542,6 +542,16 @@ namespace PDF_Master.Views.BOTA
                 //    e.Handled = true;
                 //}
             }
+            if (e.Key == Key.Delete)
+            {
+                if (OutlineView.SelectedItem != null)
+                {
+                    if (OutlineView.SelectedItem is OutlineNode outlineNode)
+                    {
+                        (DataContext as OutLineControlViewModel).RemoveOutline(outlineNode);
+                    }
+                }
+            }
         }
 
         private void OutlineView_PreviewMouseDown(object sender, MouseButtonEventArgs e)

+ 42 - 36
PDF Office/Views/Dialog/ServiceDialog/LoginoffDialog.xaml

@@ -36,49 +36,55 @@
                 <TextBlock
                     Width="360"
                     Margin="0,16,0,0"
-                    VerticalAlignment="Center"
                     HorizontalAlignment="Center"
+                    VerticalAlignment="Center"
                     FontFamily="Segoe UI"
                     FontSize="14"
                     TextWrapping="Wrap">
                     <Run Text="{Binding TextYouraccount}" />
-                    <Hyperlink  Command="{Binding GoCodeCommand}">
-                          <Hyperlink.Style>
-                        <Style BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="Hyperlink">
-                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
-                            <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
-                            <Style.Triggers>
-                                <Trigger Property="IsMouseOver" Value="True">
-                                    <Setter Property="TextBlock.TextDecorations" Value="None" />
-                                </Trigger>
-                            </Style.Triggers>
-                        </Style>
-                    </Hyperlink.Style>
-                        <TextBlock Margin="0,16,0,0" Text="{Binding TextChange}" />
-                    </Hyperlink>
                 </TextBlock>
-                <StackPanel Margin="200,32,0,0" Orientation="Horizontal" >
-                    <Button
-                        HorizontalAlignment="Right"
-                        Width="80"
-                        Height="32"
-                        IsDefault="True"
-                        Margin="0,0,20,0"
-                        Command="{Binding GoLoginCommand}"
-                        Content="{Binding TextLogin}"
-                        Style="{StaticResource Btn.cta}" />
-
-                    <Button
-                        HorizontalAlignment="Right"
-                        Width="80"
-                        Height="32"
-                        Margin="0,0,20,0"
-                        Content="{Binding TextCancel}"
-                        IsCancel="True"
-                        Style="{StaticResource btn.sec}" />
-                </StackPanel>
+                <DockPanel Margin="0,50">
+                    <TextBlock Margin="20,0" DockPanel.Dock="Left">
+                        <Hyperlink Command="{Binding GoCodeCommand}">
+                            <Hyperlink.Style>
+                                <Style BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="Hyperlink">
+                                    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+                                    <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
+                                    <Style.Triggers>
+                                        <Trigger Property="IsMouseOver" Value="True">
+                                            <Setter Property="TextBlock.TextDecorations" Value="None" />
+                                        </Trigger>
+                                    </Style.Triggers>
+                                </Style>
+                            </Hyperlink.Style>
+                            <TextBlock Margin="0,8,0,0" Text="{Binding TextChange}" />
+                        </Hyperlink>
+                    </TextBlock>
+                    <StackPanel
+                        Margin="150,0,0,0"
+                        DockPanel.Dock="Right"
+                        Orientation="Horizontal">
+                        <Button
+                            Width="80"
+                            Height="32"
+                            Margin="0,0,20,0"
+                            HorizontalAlignment="Right"
+                            Command="{Binding GoLoginCommand}"
+                            Content="{Binding TextLogin}"
+                            IsDefault="True"
+                            Style="{StaticResource Btn.cta}" />
 
+                        <Button
+                            Width="80"
+                            Height="32"
+                            Margin="0,0,20,0"
+                            HorizontalAlignment="Right"
+                            Content="{Binding TextCancel}"
+                            IsCancel="True"
+                            Style="{StaticResource btn.sec}" />
+                    </StackPanel>
+                </DockPanel>
             </StackPanel>
         </Grid>
     </Grid>
-</UserControl>
+</UserControl>

+ 2 - 2
PDF Office/Views/HomePanel/HomeGuidContent.xaml

@@ -12,6 +12,7 @@
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
     Background="{StaticResource color.sys.layout.anti}"
+    PreviewMouseDown="UserControl_MouseDown"
     mc:Ignorable="d">
     <Grid>
         <ScrollViewer
@@ -31,8 +32,7 @@
                 <recentFiles:RecentFilesContent
                     x:Name="Recentlist"
                     Grid.Row="1"
-                    Margin="24,0"
-                    MouseDown="Recentlist_MouseDown" />
+                    Margin="24,0" />
             </Grid>
         </ScrollViewer>
     </Grid>

+ 34 - 22
PDF Office/Views/HomePanel/HomeGuidContent.xaml.cs

@@ -1,4 +1,5 @@
-using PDF_Master.Views.HomePanel.RecentFiles;
+using PDF_Master.Helper;
+using PDF_Master.Views.HomePanel.RecentFiles;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
@@ -51,33 +52,44 @@ namespace PDF_Master.Views.HomePanel
         private void Recentlist_MouseDown(object sender, MouseButtonEventArgs e)
         {
             //Windows:最近文件列表补充点击空白处取消选中;移除Esc取消选中逻辑
-            if (sender is RecentFilesContent recentFilesContent)
+            // 文件列表,需要点击其他空白区域取消文件选中
+            if (e.ClickCount == 1 && e.LeftButton == MouseButtonState.Pressed && Recentlist.GridRecentFilesList.Visibility == Visibility.Visible && Recentlist.GridRecentFilesList.SelectedItems.Count > 0)
             {
-                if (recentFilesContent.GridRecentFilesList.Visibility == Visibility.Visible)
+                HitTestResult hitTestResult = VisualTreeHelper.HitTest(Recentlist.GridRecentFilesList, e.GetPosition(Recentlist.GridRecentFilesList));
+                if (hitTestResult == null)
                 {
-                    var point = e.GetPosition(recentFilesContent.GridRecentFilesList);
-                    var result = VisualTreeHelper.HitTest(recentFilesContent.GridRecentFilesList, point);
-                    if (result != null)
-                    {
-                        if (recentFilesContent.GridRecentFilesList.SelectedIndex != -1)
-                        {
-                            recentFilesContent.GridRecentFilesList.SelectedIndex = -1;
-                        }
-                    }
+                    Recentlist.GridRecentFilesList.SelectedItems.Clear();
                 }
-                else if (recentFilesContent.RecentFilesList.Visibility == Visibility.Visible)
+                else if (hitTestResult.VisualHit == Recentlist.GridRecentFilesList)
                 {
-                    var point = e.GetPosition(recentFilesContent.RecentFilesList);
-                    var result = VisualTreeHelper.HitTest(recentFilesContent.RecentFilesList, point);
-                    if (result != null)
-                    {
-                        if (recentFilesContent.RecentFilesList.SelectedIndex != -1)
-                        {
-                            recentFilesContent.RecentFilesList.SelectedIndex = -1;
-                        }
-                    }
+                    Recentlist.GridRecentFilesList.SelectedItems.Clear();
+                }
+                else if (hitTestResult.VisualHit is ScrollViewer scrollViewer)
+                {
+                    Recentlist.GridRecentFilesList.SelectedItems.Clear();
                 }
             }
+            else if (e.ClickCount == 1 && e.LeftButton == MouseButtonState.Pressed && Recentlist.RecentFilesList.Visibility == Visibility.Visible && Recentlist.RecentFilesList.SelectedItems.Count > 0)
+            {
+                HitTestResult hitTestResult = VisualTreeHelper.HitTest(Recentlist.RecentFilesList, e.GetPosition(Recentlist.RecentFilesList));
+                if (hitTestResult == null)
+                {
+                    Recentlist.RecentFilesList.SelectedItems.Clear();
+                }
+                else if (hitTestResult.VisualHit == Recentlist.RecentFilesList)
+                {
+                    Recentlist.RecentFilesList.SelectedItems.Clear();
+                }
+                else if (hitTestResult.VisualHit is ScrollViewer scrollViewer)
+                {
+                    Recentlist.RecentFilesList.SelectedItems.Clear();
+                }
+            }
+        }
+
+        private void UserControl_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            Recentlist_MouseDown(sender, e);
         }
     }
 }

+ 17 - 3
PDF Office/Views/PageEdit/PageEditContent.xaml.cs

@@ -668,11 +668,17 @@ namespace PDF_Master.Views.PageEdit
                 startChoose = true;
                 if (ListPageEdit.SelectedItems.Count > 0)
                 {
-                    ListPageEdit.SelectedItems.Clear();
+                    // 缩略图 点击空白取消选中
+                    if (GridBOTAHeader.Visibility != Visibility.Visible)
+                    {
+                        ListPageEdit.SelectedItems.Clear();
+                    }
                 }
                 starPosition = e.GetPosition(ListPageEdit);
                 starPosition = new Point(starPosition.X, starPosition.Y + GetWrapPanel(ListPageEdit).VerticalOffset);
                 Mouse.Capture(ListPageEdit);
+                //点击空白处时 获取焦点;方便跨文件复制粘贴
+                ListPageEdit.Focus();
                 return;
             }
             //选中了item 时,不能框选
@@ -745,6 +751,9 @@ namespace PDF_Master.Views.PageEdit
             RectChoose.Height = rec.Height;
             RectChoose.Visibility = Visibility.Visible;
 
+            Trace.WriteLine(rec.Width);
+            Trace.WriteLine(rec.Height);
+
             //检测遍历所有项,筛选在矩形框中的Item
             for (int i = 0; i < ListPageEdit.Items.Count; i++)
             {
@@ -752,8 +761,9 @@ namespace PDF_Master.Views.PageEdit
                 //通过这一步来避免重复误选中
                 var parent = CommonHelper.FindVisualParent<VirtualizingWrapPanel>(_item);
                 if (parent == null)
+                {
                     continue;
-
+                }
                 var v = VisualTreeHelper.GetOffset(_item);
                 if (rec.IntersectsWith(new Rect(v.X, v.Y, _item.ActualWidth, _item.ActualHeight)))
                 {
@@ -761,7 +771,11 @@ namespace PDF_Master.Views.PageEdit
                 }
                 else
                 {
-                    ListPageEdit.SelectedItems.Remove(ListPageEdit.Items[i]);
+                    // 缩略图 点击空白取消选中
+                    if (GridBOTAHeader.Visibility != Visibility.Visible)
+                    {
+                        ListPageEdit.SelectedItems.Remove(ListPageEdit.Items[i]);
+                    }
                 }
             }
             return;

BIN
PDF Office/x64/CPDFConverterNative.dll


BIN
PDF Office/x64/ComDocumentAINative.dll


BIN
PDF Office/x64/DocumentAI.dll


BIN
PDF Office/x64/paddle2onnx.dll


BIN
PDF Office/x86/CPDFConverterNative.dll


+ 68 - 0
PDFSettings/DefaultEditProperty.cs

@@ -0,0 +1,68 @@
+using ComPDFKit.PDFPage.Edit;
+using ComPDFKit.PDFPage;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media;
+using ComPDFKitViewer.AnnotEvent;
+
+namespace PDFSettings
+{
+    public class DefaultEditProperty
+    {
+        public bool IsItalic { get; set; } 
+        public bool ClipImage { get; set; }
+        public bool HorizontalMirror { get; set; } 
+        public bool VerticalMirror { get; set; } 
+        public List<string> SystemFontNameList { get; }
+        public int Transparency { get; set; } 
+        public bool IsBold { get; set; } 
+        public string ReplaceImagePath { get; set; } 
+        public string FontName { get; set; } 
+        public TextAlignType TextAlign { get; set; }
+        public Color FontColor { get; set; } 
+        public bool AutoBlock { get; set; } 
+        public double FontSize { get; set; } 
+        public CPDFEditType EditType { get; set; } 
+        public int Rotate { get; set; } = 0;
+        public string SaveKey;
+
+        public DefaultEditProperty()
+        {
+            EditType = CPDFEditType.None;
+        }
+    }
+
+    public class DefaultEditProperties : List<DefaultEditProperty>
+    {
+        public DefaultEditProperty GetEditProperty(CPDFEditType editType)
+        {
+            return this.AsEnumerable().Where(x => x.EditType == editType).FirstOrDefault();
+        }
+
+        public DefaultEditProperty GetEditProperty(CPDFEditType editType, string saveKey)
+        {
+            return this.AsEnumerable().Where(x => x.EditType == editType && x.SaveKey == saveKey).FirstOrDefault();
+        }
+
+        public void SetEditProperty(DefaultEditProperty editType)
+        {
+            DefaultEditProperty[] deleteArray = new DefaultEditProperty[0];
+            if (editType.SaveKey != null && editType.SaveKey != string.Empty)
+            {
+                deleteArray = this.AsEnumerable().Where(x => x.EditType == editType.EditType && x.SaveKey == editType.SaveKey).ToArray();
+            }
+            else
+            {
+                deleteArray = this.AsEnumerable().Where(x => x.EditType == editType.EditType).ToArray();
+            }
+            foreach (DefaultEditProperty deleteProperty in deleteArray)
+            {
+                this.Remove(deleteProperty);
+            }
+            this.Add(editType);
+        }
+    }
+}

+ 1 - 0
PDFSettings/PDFSettings.csproj

@@ -94,6 +94,7 @@
     <Compile Include="ColorSelectorList.cs" />
     <Compile Include="CustomStampList.cs" />
     <Compile Include="DefaultAnnotProperty.cs" />
+    <Compile Include="DefaultEditProperty.cs" />
     <Compile Include="DialogCounter.cs" />
     <Compile Include="DpiHelpers.cs" />
     <Compile Include="BackgroundTemplateList.cs" />