Sfoglia il codice sorgente

Merge branch 'practice' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into practice

# Conflicts:
#	PDF Office/App.xaml.cs
#	PDF Office/PDF Office.csproj
#	PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContent.xaml
#	PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterPaperSettingsDialog.xaml
liuaoran 2 anni fa
parent
commit
df41c99099
100 ha cambiato i file con 4054 aggiunte e 195 eliminazioni
  1. 12 6
      PDF Office/App.config
  2. 305 0
      PDF Office/App.xaml
  3. 53 21
      PDF Office/App.xaml.cs
  4. BIN
      PDF Office/ComPDFKit.Desk.dll
  5. BIN
      PDF Office/ComPDFKit.Viewer.dll
  6. BIN
      PDF Office/ComPDFKit.Viewero.dll
  7. 66 39
      PDF Office/CustomControl/CompositeControl/ColorContent.xaml
  8. 25 0
      PDF Office/CustomControl/CompositeControl/ColorSubContent.xaml
  9. 58 0
      PDF Office/CustomControl/CompositeControl/ColorSubContent.xaml.cs
  10. 69 0
      PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml
  11. 92 0
      PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml.cs
  12. 26 15
      PDF Office/CustomControl/CompositeControl/SlidContent.xaml
  13. 62 0
      PDF Office/CustomControl/CustomImageControl.cs
  14. 16 0
      PDF Office/CustomControl/Form/FormFieldCombox.xaml
  15. 83 0
      PDF Office/CustomControl/Form/FormFieldCombox.xaml.cs
  16. 71 0
      PDF Office/CustomControl/MenuItemWithPath.cs
  17. 370 0
      PDF Office/CustomControl/PathButton.cs
  18. 90 0
      PDF Office/CustomControl/TextBoxEx.cs
  19. 2 3
      PDF Office/CustomControl/ToastControl.xaml
  20. 2 1
      PDF Office/CustomControl/ToastControl.xaml.cs
  21. 31 0
      PDF Office/DataConvert/AnnotateFontSizeConverter.cs
  22. 38 0
      PDF Office/DataConvert/BoolToTextWrapConvert.cs
  23. 38 0
      PDF Office/DataConvert/CreateTimeToDate.cs
  24. 14 1
      PDF Office/DataConvert/FileToImageSourceConvert.cs
  25. 48 0
      PDF Office/DataConvert/GroupHeaderConverter.cs
  26. 37 0
      PDF Office/DataConvert/IntAndTagToBoolMultiBinding.cs
  27. 27 0
      PDF Office/DataConvert/IntToBooleanConvert.cs
  28. 57 0
      PDF Office/DataConvert/StringToDateConvert.cs
  29. 98 0
      PDF Office/DataConvert/WidthConvert.cs
  30. 37 0
      PDF Office/EventAggregators/EditToolsEvent.cs
  31. 123 0
      PDF Office/Helper/CacheFilePath.cs
  32. 42 1
      PDF Office/Helper/CommonHelper.cs
  33. 140 0
      PDF Office/Helper/DpiHelpers.cs
  34. 104 0
      PDF Office/Helper/DragDropHelper.cs
  35. 1 1
      PDF Office/Helper/EditToolsHelper.cs
  36. 333 56
      PDF Office/Helper/PDFToolsHelper.cs
  37. 228 0
      PDF Office/Helper/RichTextBoxHelper.cs
  38. 157 0
      PDF Office/Model/AnnotPanel/Stamp.cs
  39. 29 0
      PDF Office/Model/BOTA/AnnotationHandlerEventArgs.cs
  40. 200 0
      PDF Office/Model/BOTA/OutlineNode.cs
  41. 0 1
      PDF Office/Model/CloudDrive/CloudDriveItem.cs
  42. 51 12
      PDF Office/Model/CloudDrive/CloudFiles.cs
  43. 24 1
      PDF Office/Model/DialogNames.cs
  44. 88 0
      PDF Office/Model/EditTools/Bates/BatesCreateModel.cs
  45. 82 0
      PDF Office/Model/EditTools/HeaderFooter/HeaderFooterCreateModel.cs
  46. 31 0
      PDF Office/Model/From/FormFieldType.cs
  47. 28 15
      PDF Office/Model/PDFTool/ToolItem.cs
  48. 79 0
      PDF Office/Model/PageEdit/PageEditHistory.cs
  49. 1 0
      PDF Office/Model/PageEdit/PageEditItem.cs
  50. 18 0
      PDF Office/Model/PageEdit/PageItemUnits.cs
  51. 12 2
      PDF Office/Model/ParameterNames.cs
  52. 65 0
      PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs
  53. 31 0
      PDF Office/Model/RegionNames.cs
  54. 273 18
      PDF Office/PDF Office.csproj
  55. 72 2
      PDF Office/Properties/Settings.Designer.cs
  56. 15 0
      PDF Office/Properties/Settings.settings
  57. BIN
      PDF Office/Resources/BOTA/Annotation/Arrow.png
  58. BIN
      PDF Office/Resources/BOTA/Annotation/Bookmark.png
  59. BIN
      PDF Office/Resources/BOTA/Annotation/Circle.png
  60. BIN
      PDF Office/Resources/BOTA/Annotation/Freehande.png
  61. BIN
      PDF Office/Resources/BOTA/Annotation/Freehande2.png
  62. BIN
      PDF Office/Resources/BOTA/Annotation/Hand.png
  63. BIN
      PDF Office/Resources/BOTA/Annotation/Highlight.png
  64. BIN
      PDF Office/Resources/BOTA/Annotation/Hyperlink.png
  65. BIN
      PDF Office/Resources/BOTA/Annotation/Image.png
  66. BIN
      PDF Office/Resources/BOTA/Annotation/Line.png
  67. BIN
      PDF Office/Resources/BOTA/Annotation/Note.png
  68. BIN
      PDF Office/Resources/BOTA/Annotation/Point.png
  69. BIN
      PDF Office/Resources/BOTA/Annotation/Rectangle.png
  70. BIN
      PDF Office/Resources/BOTA/Annotation/Selecttool.png
  71. BIN
      PDF Office/Resources/BOTA/Annotation/Stamp.png
  72. BIN
      PDF Office/Resources/BOTA/Annotation/Textbox.png
  73. BIN
      PDF Office/Resources/BOTA/Annotation/wavyline2.png
  74. BIN
      PDF Office/Resources/BOTA/empty_annotation.png
  75. 0 0
      PDF Office/Resources/PageEdit/GridLine.jpg
  76. 0 0
      PDF Office/Resources/PageEdit/HorizontalLine.jpg
  77. 0 0
      PDF Office/Resources/PageEdit/Staff.jpg
  78. BIN
      PDF Office/Resources/StampIcons/Accepted.png
  79. BIN
      PDF Office/Resources/StampIcons/Approved.png
  80. BIN
      PDF Office/Resources/StampIcons/Completed.png
  81. BIN
      PDF Office/Resources/StampIcons/Confidential.png
  82. BIN
      PDF Office/Resources/StampIcons/Draft.png
  83. BIN
      PDF Office/Resources/StampIcons/Empty_stamp.png
  84. BIN
      PDF Office/Resources/StampIcons/Final.png
  85. BIN
      PDF Office/Resources/StampIcons/ForComment.png
  86. BIN
      PDF Office/Resources/StampIcons/ForPublicRelease.png
  87. BIN
      PDF Office/Resources/StampIcons/InformationOnly.png
  88. BIN
      PDF Office/Resources/StampIcons/InitialHere.png
  89. BIN
      PDF Office/Resources/StampIcons/NotApproved.png
  90. BIN
      PDF Office/Resources/StampIcons/NotForPublicRelease.png
  91. BIN
      PDF Office/Resources/StampIcons/PreliminaryResults.png
  92. BIN
      PDF Office/Resources/StampIcons/PrivateMark1.png
  93. BIN
      PDF Office/Resources/StampIcons/PrivateMark2.png
  94. BIN
      PDF Office/Resources/StampIcons/PrivateMark3.png
  95. BIN
      PDF Office/Resources/StampIcons/Rejected.png
  96. BIN
      PDF Office/Resources/StampIcons/SignHere.png
  97. BIN
      PDF Office/Resources/StampIcons/Void.png
  98. BIN
      PDF Office/Resources/StampIcons/Witness.png
  99. BIN
      PDF Office/Resources/StampIcons/revised.png
  100. 0 0
      PDF Office/SDKLisence.xml

+ 12 - 6
PDF Office/App.config

@@ -18,12 +18,18 @@
   </runtime>
   <userSettings>
     <PDF_Office.Properties.Settings>
-        <setting name="BackgroundIndex" serializeAs="String">
-            <value>0</value>
-        </setting>
-        <setting name="WatermarkIndex" serializeAs="String">
-            <value>0</value>
-        </setting>
+      <setting name="BackgroundIndex" serializeAs="String">
+        <value>0</value>
+      </setting>
+      <setting name="WatermarkIndex" serializeAs="String">
+        <value>0</value>
+      </setting>
+      <setting name="BatesIndex" serializeAs="String">
+        <value>0</value>
+      </setting>
+      <setting name="HeaderFooterIndex" serializeAs="String">
+        <value>0</value>
+      </setting>
     </PDF_Office.Properties.Settings>
   </userSettings>
 </configuration>

File diff suppressed because it is too large
+ 305 - 0
PDF Office/App.xaml


+ 53 - 21
PDF Office/App.xaml.cs

@@ -38,15 +38,16 @@ using PDF_Office.Views.FillAndSign.PropertyPanel;
 using PDF_Office.Views.PropertyPanel.ViewModular;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using PDF_Office.Views.Dialog.ConverterDialogs;
+
 using PDF_Office.Helper;
+
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
-using PDF_Office.Views.EditTools.Watermark; 
+using PDF_Office.Views.EditTools.Watermark;
 using PDF_Office.Views.EditTools.Background;
 using PDF_Office.Views.EditTools.Bates;
 using PDF_Office.Views.EditTools.HeaderFooter;
 using PDF_Office.Views.EditTools.Redaction;
-
-
+using PDF_Office.Views.Form;
 
 namespace PDF_Office
 {
@@ -61,6 +62,8 @@ namespace PDF_Office
 
         public static List<string> OpenedFileList = new List<string>();
 
+        public static CacheFilePath CachePath;
+
         public static bool IsFirstOpen = true;
         public static bool IsBookMode = false;
 
@@ -73,15 +76,41 @@ namespace PDF_Office
         var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
         AppCenter.SetCountryCode(countryCode);
 #endif
+        }
+
+        private void InitSettings()
+        {
+            if (Settings.Default.RecentOpenFiles == null)
+                Settings.Default.RecentOpenFiles = new RecentOpenFiles();
+
+            if (Settings.Default.AppProperties == null)
+                Settings.Default.AppProperties = new PDFSettings.APPSettingProperties();
+
+            if (Settings.Default.AllPDFToolsList == null)
+                Settings.Default.AllPDFToolsList = new PDFSettings.AllPDFToolsList();
+
+            if (Settings.Default.QuickPDFToolsList == null)
+                Settings.Default.QuickPDFToolsList = new PDFSettings.QuickPDFToolsList();
+        }
+
+        protected override void OnStartup(StartupEventArgs e)
+        {
             LicenseVerify();
 
             InitSettings();
 
+            CachePath = CacheFilePath.Instance;
+            //清除临时文件
+            CacheFilePath.Instance.ClearDeleteFiles();
+
             try
             {
                 DirectoryInfo info = new DirectoryInfo(CurrentPath);
+                //避免因存在同名文件,导致无法创建文件夹
                 if (File.Exists(CurrentPath))
+                {
                     File.Delete(CurrentPath);
+                }
                 if (!info.Exists)
                 {
                     info.Create();
@@ -90,22 +119,8 @@ namespace PDF_Office
             catch (Exception ex)
             {
             }
-        }
-
-        private void InitSettings()
-        {
-            if (Settings.Default.RecentOpenFiles == null)
-                Settings.Default.RecentOpenFiles = new RecentOpenFiles();
-
-            if (Settings.Default.AppProperties == null)
-                Settings.Default.AppProperties = new PDFSettings.APPSettingProperties();
-
-            if (Settings.Default.AllPDFToolsList == null)
-                Settings.Default.AllPDFToolsList = new PDFSettings.AllPDFToolsList();
-
-            if (Settings.Default.QuickPDFToolsList == null)
-                Settings.Default.QuickPDFToolsList = new PDFSettings.QuickPDFToolsList();
 
+            base.OnStartup(e);
         }
 
         /// <summary>
@@ -132,12 +147,18 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<PageEditContent>();
             containerRegistry.RegisterForNavigation<BottomToolContent>();
             containerRegistry.RegisterForNavigation<ToolsBarContent>();
+            containerRegistry.RegisterForNavigation<TextEditToolContent>();
             containerRegistry.RegisterForNavigation<AnnotToolContent>();
             containerRegistry.RegisterForNavigation<BookmarkContent>();
+            containerRegistry.RegisterForNavigation<SearchContent>();
+            containerRegistry.RegisterForNavigation<OutLineControl>();
             containerRegistry.RegisterForNavigation<ViewModularContent>();
             containerRegistry.RegisterForNavigation<SplitScreenContent>();
             containerRegistry.RegisterForNavigation<ThemesContent>();
             containerRegistry.RegisterForNavigation<ReadModeContent>();
+            containerRegistry.RegisterForNavigation<AnnotationContent>();
+            containerRegistry.RegisterForNavigation<ReadViewContent>();
+
 
             containerRegistry.RegisterForNavigation<HomePagePrinterDocumentContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
@@ -175,6 +196,7 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<LinkAnnotProperty>();
             containerRegistry.RegisterForNavigation<SharpsAnnotProperty>();
             containerRegistry.RegisterForNavigation<StampAnnotProperty>();
+            containerRegistry.RegisterForNavigation<SignatureAnnotProperty>();
             containerRegistry.RegisterForNavigation<TextAnnotProperty>();
             containerRegistry.RegisterForNavigation<TextEditProperty>();
             containerRegistry.RegisterForNavigation<BatesContent>();
@@ -192,6 +214,14 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<DateFillProperty>();
             containerRegistry.RegisterForNavigation<ShapFillProperty>();
             containerRegistry.RegisterForNavigation<TextFillProperty>();
+            //Form表单
+            containerRegistry.RegisterForNavigation<FormsToolContent>();
+            containerRegistry.RegisterForNavigation<TextFieldProperty>();
+            containerRegistry.RegisterForNavigation<ButtonProperty>();
+            containerRegistry.RegisterForNavigation<CheckBoxProperty>();
+            containerRegistry.RegisterForNavigation<ListBoxProperty>();
+            containerRegistry.RegisterForNavigation<RadioButtonProperty>();
+            containerRegistry.RegisterForNavigation<SignProperty>();
 
             #endregion 注册内容组件
 
@@ -214,6 +244,8 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<HomePagePrinterPaperSettingsDialog>(DialogNames.HomePagePrinterPaperSettingsDialog);
             containerRegistry.RegisterDialog<HomePagePictureToPDFDialog>(DialogNames.HomePagePictureToPDFDialog);
             containerRegistry.RegisterDialog<HomePageBatchProcessingDialog>(DialogNames.HomePageBatchProcessingDialog);
+            containerRegistry.RegisterDialog<DynamicPropertyDialog>(DialogNames.DynamicPropertyDialog);
+            containerRegistry.RegisterDialog<CustomCreateDialog>(DialogNames.CustomCreateDialog);
             containerRegistry.RegisterDialog<ConverterCSVDialog>(DialogNames.ConverterCSVDialog);
             containerRegistry.RegisterDialog<ConverterPPTDialog>(DialogNames.ConverterPPTDialog);
             containerRegistry.RegisterDialog<ConverterTextDialog>(DialogNames.ConverterTextDialog);
@@ -223,7 +255,7 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<ConverterRTFDialog>(DialogNames.ConverterRTFDialog);
             containerRegistry.RegisterDialog<ConverterExcelDialog>(DialogNames.ConverterExcelDialog);
             containerRegistry.RegisterDialog<ConverterProgressBarDialog>(DialogNames.ConverterProgressBarDialog);
-
+            containerRegistry.RegisterDialog<ScreenAnnotationDialog>(DialogNames.ScreenAnnotationDialog);
 
             #endregion 注册弹窗
         }
@@ -267,8 +299,8 @@ namespace PDF_Office
 
             try
             {
-                CPDFSDKVerifier.LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret);
-                if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS)
+                LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret);
+                if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
                     return false;
             }
             catch { }

BIN
PDF Office/ComPDFKit.Desk.dll


BIN
PDF Office/ComPDFKit.Viewer.dll


BIN
PDF Office/ComPDFKit.Viewero.dll


+ 66 - 39
PDF Office/CustomControl/CompositeControl/ColorContent.xaml

@@ -1,67 +1,94 @@
-<UserControl x:Class="PDF_Office.CustomControl.CompositeControl.ColorContent"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
-             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
+<UserControl
+    x:Class="PDF_Office.CustomControl.CompositeControl.ColorContent"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml"/>
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
             <DataTemplate x:Key="listboxData">
-                <Ellipse Height="20" Width="20" Fill="{Binding Color}"/>
+                <Ellipse
+                    Width="20"
+                    Height="20"
+                    Fill="{Binding Color}" />
             </DataTemplate>
-            
+
             <ContextMenu x:Key="FlyoutMenu" FontSize="14">
                 <ContextMenu.ItemContainerStyle>
                     <Style TargetType="MenuItem">
-                        <Setter Property="Padding" Value="0,7,0,7"/>
-                        <Setter Property="VerticalContentAlignment" Value="Center"/>
+                        <Setter Property="Padding" Value="0,7,0,7" />
+                        <Setter Property="VerticalContentAlignment" Value="Center" />
                     </Style>
                 </ContextMenu.ItemContainerStyle>
-                <MenuItem Name="ChangeColorMenuItem" Click="ChangeColorMenuItem_Click" Header="更改颜色" IsEnabled="True">
-                </MenuItem>
-                <MenuItem Name="BackColorMenuItem" Click="BackColorMenuItem_Click"  Header="恢复默认颜色"  IsEnabled="True">
-                </MenuItem>
+                <MenuItem
+                    Name="ChangeColorMenuItem"
+                    Click="ChangeColorMenuItem_Click"
+                    Header="更改颜色"
+                    IsEnabled="True" />
+                <MenuItem
+                    Name="BackColorMenuItem"
+                    Click="BackColorMenuItem_Click"
+                    Header="恢复默认颜色"
+                    IsEnabled="True" />
             </ContextMenu>
 
             <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
-                <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}"/>
-                <Setter Property="HorizontalContentAlignment" Value="Center"/>
-                <Setter Property="Height" Value="32"/>
-                <Setter Property="Margin" Value="2,0,2,0"/>
-                <EventSetter Event="PreviewMouseRightButtonDown"
-                             Handler="listboxItem_PreviewMouseRightButtonDown"/>
+                <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
+                <Setter Property="HorizontalContentAlignment" Value="Center" />
+                <Setter Property="Height" Value="32" />
+                <Setter Property="Margin" Value="2,0,2,0" />
+                <EventSetter Event="PreviewMouseRightButtonDown" Handler="listboxItem_PreviewMouseRightButtonDown" />
             </Style>
         </ResourceDictionary>
     </UserControl.Resources>
-    <Grid >
+    <Grid>
         <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="*"></ColumnDefinition>
-            <ColumnDefinition Width="auto"></ColumnDefinition>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="auto" />
         </Grid.ColumnDefinitions>
-        <Border Width="56" Height="32" Grid.Column="1" Margin="0,0,5,0" BorderThickness="1" CornerRadius="4" BorderBrush="#E2E3E6"  HorizontalAlignment="Right" >
+        <Border
+            Grid.Column="1"
+            Width="56"
+            Height="32"
+            Margin="0,0,5,0"
+            HorizontalAlignment="Right"
+            BorderBrush="#E2E3E6"
+            BorderThickness="1"
+            CornerRadius="4">
             <StackPanel Orientation="Horizontal">
 
-                <Ellipse x:Name="ElcustomColor" Fill="Transparent" Width="20" Height="20" PreviewMouseLeftButtonDown="ElcustomColor_PreviewMouseLeftButtonDown"></Ellipse>
-                <cus:ColorDropBox x:Name="ColorDropPicker" SelectedColorChanged="ColorDropPicker_SelectedColorChanged">
-                </cus:ColorDropBox>
+                <Ellipse
+                    x:Name="ElcustomColor"
+                    Width="20"
+                    Height="20"
+                    Fill="Transparent"
+                    PreviewMouseLeftButtonDown="ElcustomColor_PreviewMouseLeftButtonDown" />
+                <cus:ColorDropBox x:Name="ColorDropPicker" SelectedColorChanged="ColorDropPicker_SelectedColorChanged" />
             </StackPanel>
         </Border>
-        <cus:ColorDropBox x:Name="PnlColor" SelectedColorChanged="PnlColor_SelectedColorChanged" Opacity="0">
-        </cus:ColorDropBox>
-        
-        <ListBox x:Name="ListColor"  BorderThickness="0" Background="Transparent" 
-                 SelectionChanged="ListColor_SelectionChanged"
-                 ItemContainerStyle="{StaticResource listboxItemStyle}" ItemTemplate="{StaticResource listboxData}"
-                 >
+        <cus:ColorDropBox
+            x:Name="PnlColor"
+            Opacity="0"
+            SelectedColorChanged="PnlColor_SelectedColorChanged" />
+
+        <ListBox
+            x:Name="ListColor"
+            Background="Transparent"
+            BorderThickness="0"
+            ItemContainerStyle="{StaticResource listboxItemStyle}"
+            ItemTemplate="{StaticResource listboxData}"
+            SelectionChanged="ListColor_SelectionChanged">
             <ListBox.ItemsPanel>
                 <ItemsPanelTemplate>
-                    <WrapPanel Orientation="Horizontal"/>
+                    <WrapPanel Orientation="Horizontal" />
                 </ItemsPanelTemplate>
             </ListBox.ItemsPanel>
         </ListBox>

+ 25 - 0
PDF Office/CustomControl/CompositeControl/ColorSubContent.xaml

@@ -0,0 +1,25 @@
+<UserControl x:Class="PDF_Office.CustomControl.CompositeControl.ColorSubContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+             xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+        <Border Width="56" Height="32" Grid.Column="1" Margin="0,0,5,0" BorderThickness="1" CornerRadius="4" BorderBrush="#E2E3E6"  HorizontalAlignment="Right" >
+            <StackPanel Orientation="Horizontal">
+
+                <Ellipse x:Name="ElcustomColor" Fill="Transparent" Width="20" Height="20" StrokeThickness="1"
+                         PreviewMouseLeftButtonDown="ElcustomColor_PreviewMouseLeftButtonDown">
+                    <Ellipse.Stroke>
+                        <SolidColorBrush Color="#000000" Opacity="0.1"/>
+                    </Ellipse.Stroke>
+                </Ellipse>
+                <cus:ColorDropBox x:Name="ColorDropPicker" SelectedColorChanged="ColorDropPicker_SelectedColorChanged">
+                </cus:ColorDropBox>
+            </StackPanel>
+        </Border>
+    </Grid>
+</UserControl>

+ 58 - 0
PDF Office/CustomControl/CompositeControl/ColorSubContent.xaml.cs

@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl.CompositeControl
+{
+    /// <summary>
+    /// ColorSubContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class ColorSubContent : UserControl
+    {
+        /// <summary>
+        /// 改变颜色后,触发事件
+        /// </summary>
+        public event EventHandler<Color> SelectedColorHandler;
+        public ColorSubContent()
+        {
+            InitializeComponent();
+        }
+
+        private void ElcustomColor_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            CurrentColor = (ElcustomColor.Fill as SolidColorBrush).Color;
+            SelectedColorHandler?.Invoke(this, (ElcustomColor.Fill as SolidColorBrush).Color);
+        }
+
+        private void ColorDropPicker_SelectedColorChanged(object sender, Color? e)
+        {
+           
+            SelectedColorHandler?.Invoke(this, e.Value);
+            ElcustomColor.Fill = new SolidColorBrush(e.Value);
+            CurrentColor = e.Value;
+        }
+
+        /// <summary>
+        /// 当前选择的颜色,默认为透明色
+        /// </summary>
+        public Color CurrentColor
+        {
+            get { return (Color)GetValue(CurrentColorProperty); }
+            set { SetValue(CurrentColorProperty, value); }
+        }
+        public static readonly DependencyProperty CurrentColorProperty =
+           DependencyProperty.Register("CurrentColor", typeof(Color), typeof(ColorSubContent), new PropertyMetadata(Colors.Transparent));
+
+    }
+}

+ 69 - 0
PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml

@@ -0,0 +1,69 @@
+<UserControl x:Class="PDF_Office.CustomControl.CompositeControl.SlidComboControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+             mc:Ignorable="d" 
+             x:Name="usercontrol"
+             d:DesignHeight="450" d:DesignWidth="800"
+             Loaded="UserControl_Loaded"
+             >
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Styles/SliderStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition />
+        </Grid.RowDefinitions>
+        <TextBlock x:Name="thicknessText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
+
+        <Grid Grid.Row="1">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+
+            <Slider Name="ThicknessSlider" VerticalAlignment="Center" Margin="12,0,0,0" Width="148"  Minimum="0" Maximum="24" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True" 
+                    Style="{StaticResource RoundThumbSlider}"  TickFrequency="1" IsSnapToTickEnabled="True" Value="{Binding ElementName=usercontrol,Path=Value}" >
+                <Slider.Resources>
+                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
+                    <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
+                </Slider.Resources>
+            </Slider>
+
+            <Border Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="0,0,11,0"  BorderThickness="0">
+                <Grid>
+                    <ComboBox Name="ThicknessBox" BorderThickness="1" Padding="10" Background="Transparent" BorderBrush="#FFE2E3E6" 
+                                  MaxDropDownHeight="200">
+                        <ComboBox.ItemContainerStyle>
+                            <Style TargetType="{x:Type ComboBoxItem}">
+                                <Setter Property="Padding" Value="10 0 0 0"/>
+                            </Style>
+                        </ComboBox.ItemContainerStyle>
+                        <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        <ComboBoxItem Content="15" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        <ComboBoxItem Content="18" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        <ComboBoxItem Content="21" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        <ComboBoxItem Content="24" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                    </ComboBox>
+                    <TextBox Name="ThicknessText" Background="White" FontFamily="Segoe UI" FontSize="14"  Height="20" Margin="10,0,35,0" IsReadOnly="True"
+                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" >
+                    </TextBox>
+                </Grid>
+            </Border>
+        </Grid>
+    </Grid>
+   
+</UserControl>

+ 92 - 0
PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml.cs

@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl.CompositeControl
+{
+    /// <summary>
+    /// SlidComboControl.xaml 的交互逻辑
+    /// </summary>
+    public partial class SlidComboControl : UserControl
+    {
+        public event EventHandler<double> ValueChanged;
+        public SlidComboControl()
+        {
+            InitializeComponent();
+        }
+
+        private void UserControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            ThicknessBox.SelectionChanged -= ThicknessBox_SelectionChanged;
+            ThicknessBox.SelectionChanged += ThicknessBox_SelectionChanged;
+            ThicknessSlider.ValueChanged += ThicknessSlider_ValueChanged;
+            ThicknessBox.SelectedIndex = 0;
+        }
+
+        private void ThicknessSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+        {
+            foreach(var item in ThicknessBox.Items)
+            {
+                var itemData = item as ComboBoxItem;
+                if(itemData != null)
+                {
+                   var doubleItem = double.Parse(itemData.Content.ToString());
+                    if(doubleItem == Value)
+                    {
+                        ThicknessBox.SelectedItem = itemData;
+                        break;
+                    }
+                }
+            }
+            ThicknessText.Text = Value.ToString();
+        }
+
+        private void ThicknessBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var listItem = ThicknessBox.ItemContainerGenerator.ContainerFromItem(ThicknessBox.SelectedItem) as ComboBoxItem;
+            if (listItem != null)
+            {
+                Value = double.Parse(listItem.Content.ToString());
+                ThicknessText.Text = listItem.Content.ToString();
+            }
+            else
+            {
+                ThicknessText.Text = "1";
+                Value = 1.0;
+            }
+                
+
+            
+
+        }
+
+        public double Value
+        {
+            get { return (double)GetValue(ValueProperty); }
+            set { SetValue(ValueProperty, value); }
+        }
+        public static readonly DependencyProperty ValueProperty =
+           DependencyProperty.Register("Value", typeof(double), typeof(SlidComboControl), new PropertyMetadata(1.0, SelectedValuePropertyChanged));
+
+        private static void SelectedValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as SlidComboControl;
+            var value = (double)e.NewValue;
+            if (control != null)
+            {
+                control.ValueChanged?.Invoke(control, value);
+            }
+        }
+    }
+}

File diff suppressed because it is too large
+ 26 - 15
PDF Office/CustomControl/CompositeControl/SlidContent.xaml


+ 62 - 0
PDF Office/CustomControl/CustomImageControl.cs

@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl
+{
+    internal class CustomImageControl : FrameworkElement
+    {
+        private DrawingVisual PresentChild { get; set; }
+        private DrawingContext DrawDC { get; set; }
+        public CustomImageControl()
+        {
+            PresentChild = new DrawingVisual();
+            AddVisualChild(PresentChild);
+            AddLogicalChild(PresentChild);
+        }
+        protected override Visual GetVisualChild(int index)
+        {
+            if (PresentChild == null)
+            {
+                throw new ArgumentOutOfRangeException();
+            }
+            return PresentChild;
+        }
+        protected override int VisualChildrenCount
+        {
+            get
+            {
+                if (PresentChild != null)
+                {
+                    return 1;
+                }
+                return 0;
+            }
+        }
+
+        public DrawingContext OpenDraw()
+        {
+            if (DrawDC == null)
+            {
+                DrawDC = PresentChild?.RenderOpen();
+            }
+            return DrawDC;
+        }
+        public void CloseDraw()
+        {
+            DrawDC?.Close();
+            DrawDC = null;
+        }
+    }
+}

+ 16 - 0
PDF Office/CustomControl/Form/FormFieldCombox.xaml

@@ -0,0 +1,16 @@
+<UserControl
+    x:Class="PDF_Office.CustomControl.Form.FormFieldCombox"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl.Form"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+    <ComboBox
+        Name="Combox"
+        VerticalContentAlignment="Center"
+        SelectedIndex="0"
+        SelectionChanged="Combox_SelectionChanged" />
+</UserControl>

+ 83 - 0
PDF Office/CustomControl/Form/FormFieldCombox.xaml.cs

@@ -0,0 +1,83 @@
+using PDF_Office.Model.From;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl.Form
+{
+    /// <summary>
+    /// FormFieldCombox.xaml 的交互逻辑
+    /// 用于表单显示字段的下拉控件
+    /// </summary>
+    public partial class FormFieldCombox : UserControl
+    {
+        public FormFieldCombox()
+        {
+            InitializeComponent();
+            InitCombox();
+        }
+
+
+
+        public FormFieldType Type
+        {
+            get { return (FormFieldType)GetValue(TypeProperty); }
+            set { SetValue(TypeProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty TypeProperty =
+            DependencyProperty.Register("MyProperty", typeof(FormFieldType), typeof(FormFieldCombox), new PropertyMetadata(FormFieldType.visible));
+
+
+
+        public FormFieldType SetType
+        {
+            get { return (FormFieldType)GetValue(SetTypeProperty); }
+            set { SetValue(SetTypeProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for SetType.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty SetTypeProperty =
+            DependencyProperty.Register("SetType", typeof(FormFieldType), typeof(FormFieldCombox), new PropertyMetadata(FormFieldType.visible,(d,e)=> {
+                (d as FormFieldCombox).SetIndexBySetType((FormFieldType)e.NewValue);
+            }));
+
+
+        /// <summary>
+        /// 根据settype 设置combox索引
+        /// </summary>
+        private void SetIndexBySetType(FormFieldType type)
+        {
+            Combox.SelectedIndex=(int)type;
+        }
+
+
+
+        private void InitCombox()
+        {
+            List<string> list = new List<string>();
+            list.Add("可见");
+            list.Add("隐藏");
+            list.Add("可见但不可打印");
+            list.Add("隐藏但可打印");
+            Combox.ItemsSource = list;
+        }
+
+        private void Combox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            Type = (FormFieldType)Combox.SelectedIndex;
+        }
+    }
+}

+ 71 - 0
PDF Office/CustomControl/MenuItemWithPath.cs

@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// 带Path图案的Menuitem 图案颜色跟随文字颜色变化
+    /// </summary>
+    public class MenuItemWithPath:MenuItem
+    {
+        static MenuItemWithPath()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuItemWithPath), new FrameworkPropertyMetadata(typeof(MenuItemWithPath)));
+        }
+
+        public override void OnApplyTemplate()
+        {
+            base.OnApplyTemplate();
+        }
+
+
+
+        public Geometry Path
+        {
+            get { return (Geometry)GetValue(PathProperty); }
+            set { SetValue(PathProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for Path.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PathProperty =
+            DependencyProperty.Register("Path", typeof(Geometry), typeof(MenuItemWithPath), null);
+
+
+
+        public double PathWidth
+        {
+            get { return (double)GetValue(PathWidthProperty); }
+            set { SetValue(PathWidthProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for PathWidth.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PathWidthProperty =
+            DependencyProperty.Register("PathWidth", typeof(double), typeof(MenuItemWithPath), new PropertyMetadata(16.0));
+
+
+
+        public double PathHeight
+        {
+            get { return (double)GetValue(PathHeightProperty); }
+            set { SetValue(PathHeightProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for PathHeight.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PathHeightProperty =
+            DependencyProperty.Register("PathHeight", typeof(double), typeof(MenuItemWithPath), new PropertyMetadata(16.0));
+
+
+
+
+
+
+
+
+    }
+}

+ 370 - 0
PDF Office/CustomControl/PathButton.cs

@@ -0,0 +1,370 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl
+{
+    public class PathButton : Button
+    {
+        static PathButton()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(PathButton), new FrameworkPropertyMetadata(typeof(PathButton)));
+        }
+
+        public override void OnApplyTemplate()
+        {
+            base.OnApplyTemplate();
+            if (this.MouseOverBackground == null)
+            {
+                this.MouseOverBackground = Background;
+            }
+            if (this.MouseDownBackground == null)
+            {
+                if (this.MouseOverBackground == null)
+                {
+                    this.MouseDownBackground = Background;
+                }
+                else
+                {
+                    this.MouseDownBackground = MouseOverBackground;
+                }
+            }
+            if (this.MouseOverBorderBrush == null)
+            {
+                this.MouseOverBorderBrush = BorderBrush;
+            }
+            if (this.MouseDownBorderBrush == null)
+            {
+                if (this.MouseOverBorderBrush == null)
+                {
+                    this.MouseDownBorderBrush = BorderBrush;
+                }
+                else
+                {
+                    this.MouseDownBorderBrush = MouseOverBorderBrush;
+                }
+            }
+            if (this.MouseOverForeground == null)
+            {
+                this.MouseOverForeground = Foreground;
+            }
+            if (this.MouseDownForeground == null)
+            {
+                if (this.MouseOverForeground == null)
+                {
+                    this.MouseDownForeground = Foreground;
+                }
+                else
+                {
+                    this.MouseDownForeground = this.MouseOverForeground;
+                }
+            }
+            if (this.IconChecked == null)
+            {
+                if (this.IconPress == null)
+                {
+                    this.IconChecked = Icon;
+                }
+                else
+                {
+                    this.IconChecked = this.IconPress;
+                }
+            }
+
+            if (this.IconCheckedFill == null)
+            {
+                if (this.IconPressFill == null)
+                {
+                    this.IconCheckedFill = IconFill;
+                }
+                else
+                {
+                    this.IconCheckedFill = this.IconPressFill;
+                }
+            }
+        }
+
+        #region 依赖项属性  
+
+        /// <summary>  
+        /// 鼠标移上去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBackgroundProperty
+            = DependencyProperty.Register("MouseOverBackground", typeof(Brush), typeof(PathButton));
+
+        /// <summary>  
+        /// 鼠标按下去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBackgroundProperty
+            = DependencyProperty.Register("MouseDownBackground", typeof(Brush), typeof(PathButton));
+
+        /// <summary>  
+        /// 鼠标移上去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverForegroundProperty
+            = DependencyProperty.Register("MouseOverForeground", typeof(Brush), typeof(PathButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownForegroundProperty
+            = DependencyProperty.Register("MouseDownForeground", typeof(Brush), typeof(PathButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标移上去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBorderBrushProperty
+            = DependencyProperty.Register("MouseOverBorderBrush", typeof(Brush), typeof(PathButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBorderBrushProperty
+            = DependencyProperty.Register("MouseDownBorderBrush", typeof(Brush), typeof(PathButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 圆角  
+        /// </summary>  
+        public static readonly DependencyProperty CornerRadiusProperty
+            = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(PathButton), null);
+
+        //图标  
+        public static readonly DependencyProperty IconProperty
+            = DependencyProperty.Register("Icon", typeof(Geometry), typeof(PathButton), null);
+
+        //图标填充色  
+        public static readonly DependencyProperty IconFillProperty
+            = DependencyProperty.Register("IconFill", typeof(Brush), typeof(PathButton), null);
+
+        //图标透明度 
+        public static readonly DependencyProperty IconOpacityProperty
+            = DependencyProperty.Register("IconOpacity", typeof(double), typeof(PathButton), null);
+
+        //按钮是否被选中
+        public static readonly DependencyProperty IsCheckedProperty
+            = DependencyProperty.Register("IsChecked", typeof(bool), typeof(PathButton), null);
+
+        //选中的图标  
+        public static readonly DependencyProperty IconCheckedProperty
+            = DependencyProperty.Register("IconChecked", typeof(Geometry), typeof(PathButton), null);
+
+        //鼠标移上去的图标填充色   
+        public static readonly DependencyProperty IconCheckedFillProperty
+            = DependencyProperty.Register("IconCheckedFill", typeof(Brush), typeof(PathButton), null);
+
+        //鼠标移上去的透明度 
+        public static readonly DependencyProperty IconCheckedOpacityProperty
+            = DependencyProperty.Register("IconCheckedOpacity", typeof(double), typeof(PathButton), null);
+
+        //鼠标移上去的图标  
+        public static readonly DependencyProperty IconMouseOverProperty
+            = DependencyProperty.Register("IconMouseOver", typeof(Geometry), typeof(PathButton), null);
+
+        //鼠标移上去的图标填充色   
+        public static readonly DependencyProperty IconMouseOverFillProperty
+            = DependencyProperty.Register("IconMouseOverFill", typeof(Brush), typeof(PathButton), null);
+
+        //鼠标移上去的透明度 
+        public static readonly DependencyProperty IconMouseOverOpacityProperty
+            = DependencyProperty.Register("IconMouseOverOpacity", typeof(double), typeof(PathButton), null);
+
+        //鼠标按下去的图标
+        public static readonly DependencyProperty IconPressProperty
+            = DependencyProperty.Register("IconPress", typeof(Geometry), typeof(PathButton), null);
+
+        //鼠标按下去的图标填充色   
+        public static readonly DependencyProperty IconPressFillProperty
+            = DependencyProperty.Register("IconPressFill", typeof(Brush), typeof(PathButton), null);
+
+        //鼠标按下去的透明度 
+        public static readonly DependencyProperty IconPressOpacityProperty
+            = DependencyProperty.Register("IconPressOpacity", typeof(double), typeof(PathButton), null);
+
+        //图标高度  
+        public static readonly DependencyProperty IconHeightProperty
+            = DependencyProperty.Register("IconHeight", typeof(double), typeof(PathButton), new PropertyMetadata(24.0, null));
+
+        //图标宽度  
+        public static readonly DependencyProperty IconWidthProperty
+            = DependencyProperty.Register("IconWidth", typeof(double), typeof(PathButton), new PropertyMetadata(24.0, null));
+
+        //图标和内容的对齐方式  
+        public static readonly DependencyProperty IconContentOrientationProperty
+            = DependencyProperty.Register("IconContentOrientation", typeof(Orientation), typeof(PathButton), new PropertyMetadata(Orientation.Horizontal, null));
+
+        //图标和内容的距离  
+        public static readonly DependencyProperty IconContentMarginProperty
+            = DependencyProperty.Register("IconContentMargin", typeof(Thickness), typeof(PathButton), new PropertyMetadata(new Thickness(0, 0, 0, 0), null));
+
+        #endregion
+
+        #region 属性包装 
+
+        public Brush MouseOverBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverBackgroundProperty);
+            }
+            set { SetValue(MouseOverBackgroundProperty, value); }
+        }
+
+        public Brush MouseDownBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownBackgroundProperty);
+            }
+            set { SetValue(MouseDownBackgroundProperty, value); }
+        }
+
+        public Brush MouseOverForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverForegroundProperty);
+            }
+            set { SetValue(MouseOverForegroundProperty, value); }
+        }
+
+        public Brush MouseDownForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownForegroundProperty);
+            }
+            set { SetValue(MouseDownForegroundProperty, value); }
+        }
+
+        public Brush MouseOverBorderBrush
+        {
+            get { return (Brush)GetValue(MouseOverBorderBrushProperty); }
+            set { SetValue(MouseOverBorderBrushProperty, value); }
+        }
+
+        public Brush MouseDownBorderBrush
+        {
+            get { return (Brush)GetValue(MouseDownBorderBrushProperty); }
+            set { SetValue(MouseDownBorderBrushProperty, value); }
+        }
+
+        public CornerRadius CornerRadius
+        {
+            get { return (CornerRadius)GetValue(CornerRadiusProperty); }
+            set { SetValue(CornerRadiusProperty, value); }
+        }
+
+        public Geometry Icon
+        {
+            get { return (Geometry)GetValue(IconProperty); }
+            set { SetValue(IconProperty, value); }
+        }
+
+        public Brush IconFill
+        {
+            get { return (Brush)GetValue(IconFillProperty); }
+            set { SetValue(IconFillProperty, value); }
+        }
+
+        public double IconOpacity
+        {
+            get { return (double)GetValue(IconOpacityProperty); }
+            set { SetValue(IconOpacityProperty, value); }
+        }
+        public bool IsChecked
+        {
+            get { return (bool)GetValue(IsCheckedProperty); }
+            set { SetValue(IsCheckedProperty, value); }
+        }
+
+        public Geometry IconChecked
+        {
+            get { return (Geometry)GetValue(IconCheckedProperty); }
+            set { SetValue(IconCheckedProperty, value); }
+        }
+
+        public Brush IconCheckedFill
+        {
+            get { return (Brush)GetValue(IconCheckedFillProperty); }
+            set { SetValue(IconCheckedFillProperty, value); }
+        }
+
+        public double IconCheckedOpacity
+        {
+            get { return (double)GetValue(IconCheckedOpacityProperty); }
+            set { SetValue(IconCheckedOpacityProperty, value); }
+        }
+        public Geometry IconMouseOver
+        {
+            get { return (Geometry)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public Brush IconMouseOverFill
+        {
+            get { return (Brush)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public double IconMouseOverOpacity
+        {
+            get { return (double)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public Geometry IconPress
+        {
+            get { return (Geometry)GetValue(IconPressProperty); }
+            set { SetValue(IconPressProperty, value); }
+        }
+
+        public Brush IconPressFill
+        {
+            get { return (Brush)GetValue(IconPressFillProperty); }
+            set { SetValue(IconPressFillProperty, value); }
+        }
+
+        public double IconPressOpacity
+        {
+            get { return (double)GetValue(IconPressOpacityProperty); }
+            set { SetValue(IconPressOpacityProperty, value); }
+        }
+
+        public double IconHeight
+        {
+            get { return (double)GetValue(IconHeightProperty); }
+            set { SetValue(IconHeightProperty, value); }
+        }
+
+        public double IconWidth
+        {
+            get { return (double)GetValue(IconWidthProperty); }
+            set { SetValue(IconWidthProperty, value); }
+        }
+
+        public Orientation IconContentOrientation
+        {
+            get { return (Orientation)GetValue(IconContentOrientationProperty); }
+            set { SetValue(IconContentOrientationProperty, value); }
+        }
+
+        public Thickness IconContentMargin
+        {
+            get { return (Thickness)GetValue(IconContentMarginProperty); }
+            set { SetValue(IconContentMarginProperty, value); }
+        }
+
+        #endregion
+    }
+}

+ 90 - 0
PDF Office/CustomControl/TextBoxEx.cs

@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// 带预文本和圆角的textbox
+    /// </summary>
+    public class TextBoxEx : TextBox
+    {
+        static TextBoxEx()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(TextBoxEx), new FrameworkPropertyMetadata(typeof(TextBoxEx)));
+        }
+
+        ~TextBoxEx()
+        {
+            var btn = base.GetTemplateChild("PART_BtnClear") as Button;
+            if (btn != null)
+            {
+                //一定要取消事件挂载,否则可能无法被GC回收
+                btn.Click -= Btn_Click;
+            }
+        }
+
+        public override void OnApplyTemplate()
+        {
+            //需要配合特定的Style才可用
+            var btn = base.GetTemplateChild("PART_BtnClear") as Button;
+            if(btn!=null)
+            {
+                btn.Click += Btn_Click;
+            }
+
+            base.OnApplyTemplate();
+        }
+
+        private void Btn_Click(object sender, RoutedEventArgs e)
+        {
+            this.Text = "";
+            this.Focus();
+        }
+
+        public string PlaceholderText
+        {
+            get { return (string)GetValue(PlaceholderTextProperty); }
+            set { SetValue(PlaceholderTextProperty, value); }
+        }
+
+        public static readonly DependencyProperty PlaceholderTextProperty
+        = DependencyProperty.Register("PlaceholderText", typeof(string), typeof(TextBoxEx), null);
+
+        public CornerRadius CornerRadius
+        {
+            get { return (CornerRadius)GetValue(CornerRadiusProperty); }
+            set { SetValue(CornerRadiusProperty, value); }
+        }
+
+        public static readonly DependencyProperty CornerRadiusProperty =
+            DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(TextBoxEx), new PropertyMetadata(new CornerRadius(4)));
+
+        public Brush PlaceholderForeground
+        {
+            get { return (Brush)GetValue(PlaceholderForegroundProperty); }
+            set { SetValue(PlaceholderForegroundProperty, value); }
+        }
+
+        public static readonly DependencyProperty PlaceholderForegroundProperty =
+          DependencyProperty.Register("PlaceholderForeground", typeof(Brush), typeof(TextBoxEx), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#94989C"))));
+
+        public Brush MouseOverForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverForegroundProperty);
+            }
+            set { SetValue(MouseOverForegroundProperty, value); }
+        }
+
+        public static readonly DependencyProperty MouseOverForegroundProperty =
+     DependencyProperty.Register("MouseOverForeground", typeof(Brush), typeof(TextBoxEx), new PropertyMetadata(new SolidColorBrush(Colors.Transparent)));
+
+    }
+}

+ 2 - 3
PDF Office/CustomControl/ToastControl.xaml

@@ -12,14 +12,13 @@
     d:DesignWidth="800"
     Background="Transparent"
     IsVisibleChanged="Toast_IsVisibleChanged"
-    Visibility="Collapsed"
+    Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Visibility}"
     mc:Ignorable="d">
     <Border
         Name="tipBorder"
         HorizontalAlignment="Center"
         Background="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Background}"
-        CornerRadius="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=CornerRadius}"
-        Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Visibility}">
+        CornerRadius="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=CornerRadius}">
         <TextBlock
             Name="txtTip"
             Padding="6,2,6,2"

+ 2 - 1
PDF Office/CustomControl/ToastControl.xaml.cs

@@ -83,6 +83,7 @@ namespace PDF_Office.CustomControl
         private void DoubleAnimation_Completed(object sender, EventArgs e)
         {
             this.Visibility = Visibility.Collapsed;
+            this.Opacity = 1;
         }
 
         private void Toast_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
@@ -95,7 +96,7 @@ namespace PDF_Office.CustomControl
                 doubleAnimation.To = 0;
                 doubleAnimation.BeginTime = BeginTime;
                 doubleAnimation.Duration = Duration;
-                this.BeginAnimation(UserControl.OpacityProperty,doubleAnimation);
+                this.BeginAnimation(UserControl.OpacityProperty, doubleAnimation);
             }
         }
     }

+ 31 - 0
PDF Office/DataConvert/AnnotateFontSizeConverter.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class AnnotateFontSizeConverter : IValueConverter
+    {
+        //用于注释列表的字体   作者和日期的日期比正文日期小两个规格
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if ((double)value <= 0)
+            {
+                return null;
+            }
+            else
+            {
+                return (double)value - 2;
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 38 - 0
PDF Office/DataConvert/BoolToTextWrapConvert.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows;
+
+namespace PDF_Office.DataConvert
+{
+    public class BoolToTextWrapConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return TextWrapping.NoWrap;
+            }
+            else
+            {
+                if ((bool)value)
+                {
+                    return TextWrapping.Wrap;
+                }
+                else
+                {
+                    return TextWrapping.NoWrap;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 38 - 0
PDF Office/DataConvert/CreateTimeToDate.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class CreateTimeToDate : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (string.IsNullOrEmpty(value.ToString()))
+            {
+                //没有时间得返回系统当前时间
+                return System.DateTime.Now.ToString("yyyyMMdd");
+            }
+            else
+            {
+                //部分日期不正常 需要进一步处理
+                string dateStr = Regex.Match(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])").Value;
+                if (string.IsNullOrEmpty(dateStr))//日期不合格时 显示当前系统日期
+                {
+                    dateStr = System.DateTime.Now.ToString("yyyyMMdd");
+                }
+                return dateStr.Substring(0, 8);
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 14 - 1
PDF Office/DataConvert/FileToImageSourceConvert.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Globalization;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -18,7 +19,19 @@ namespace PDF_Office.DataConvert
         {
             if(!string.IsNullOrEmpty((string)value)&&System.IO.File.Exists((string)value))
             {
-                return new BitmapImage(new Uri((string)value, UriKind.Relative));
+                //采用数组的形式读取,避免因bitmap占用,导致图片无法引用的问题
+                // Read byte[] from png file
+                BinaryReader binReader = new BinaryReader(File.Open((string)value, FileMode.Open));
+                FileInfo fileInfo = new FileInfo((string)value);
+                byte[] bytes = binReader.ReadBytes((int)fileInfo.Length);
+                binReader.Close();
+
+                // Init bitmap
+                BitmapImage bitmap = new BitmapImage();
+                bitmap.BeginInit();
+                bitmap.StreamSource = new MemoryStream(bytes);
+                bitmap.EndInit();
+                return bitmap;
             }
             return null;
         }

+ 48 - 0
PDF Office/DataConvert/GroupHeaderConverter.cs

@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class GroupHeaderConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null || string.IsNullOrEmpty(value.ToString())) return null;
+            if (value.ToString().Length == 8)//日期
+            {
+                string dateStr = value.ToString();
+                string text = dateStr.Substring(0, 4) + "-" + dateStr.Substring(4, 2) + "-" + dateStr.Substring(6, 2);
+                return text;
+            }
+            else//页码
+            {
+                try
+                {
+                    string page = "Page ";
+                    if ((int)value == -1)
+                    {
+                        return null;
+                    }
+                    else
+                    {
+                        return page + ((int)value + 1).ToString();
+                    }
+                }
+                catch (Exception ex)
+                {
+                    return null;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 37 - 0
PDF Office/DataConvert/IntAndTagToBoolMultiBinding.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    class IntAndTagToBoolMultiBinding : IMultiValueConverter
+    {
+        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (values[0] == null|| values[1]==null)
+            {
+                return false;
+            }
+            else
+            {
+                if (values[0].ToString()== values[1].ToString())
+                {
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+        }
+
+        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 27 - 0
PDF Office/DataConvert/IntToBooleanConvert.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class IntToBooleanConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value is int && ((int)value) > 0)
+            {
+                return true;
+            }
+            return false;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 57 - 0
PDF Office/DataConvert/StringToDateConvert.cs

@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    /// <summary>
+    /// 用于注释 书签等的时间转换
+    /// </summary>
+    public class StringToDateConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            string date = "";
+            if (string.IsNullOrEmpty((string)value) || !Regex.IsMatch(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])"))
+            {
+                date = System.DateTime.Now.ToString("HH:mm");
+            }
+            else if (Regex.IsMatch(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])"))
+            {
+                string dateStr = Regex.Match(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])").Value;
+
+                #region to do
+
+                if (string.Equals(dateStr.Substring(4, 4), DateTime.Now.ToString("MMdd")))
+                {//同天
+                    date = dateStr.Substring(8, 2) + ":" + dateStr.Substring(10, 2);
+                }
+                else if (string.Equals(dateStr.Substring(0, 4), DateTime.Now.ToString("yyyy")))
+                {//同年
+                    date = dateStr.Substring(4, 2) + "/" + dateStr.Substring(6, 2) + " " + dateStr.Substring(8, 2) + ":" +
+                   dateStr.Substring(10, 2);
+                }
+                else
+                {
+                    date = dateStr.Substring(0, 4) + "/" + dateStr.Substring(4, 2) + "/" + dateStr.Substring(6, 2) + " " + dateStr.Substring(8, 2) + ":" +
+                    dateStr.Substring(10, 2);
+                }
+
+                #endregion to do
+
+                //date = dateStr.Substring(4, 2) + "-" + dateStr.Substring(6, 2) + "   " + dateStr.Substring(8, 2) + ":" + dateStr.Substring(10, 2);
+            }
+            return date;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return null;
+        }
+    }
+}

+ 98 - 0
PDF Office/DataConvert/WidthConvert.cs

@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class WidthConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return 0;
+            }
+            else
+            {
+                if (value is double)
+                {
+                    double width = (double)value;
+                    width = width - SystemParameters.VerticalScrollBarWidth-8;
+                    return Math.Max(0, width);
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+    public class SearchWidthConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return 0;
+            }
+            else
+            {
+                if (value is double)
+                {
+                    double width = (double)value;
+                    width = width - SystemParameters.VerticalScrollBarWidth-20;
+                    return Math.Max(0, width);
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+    public class WidthMultiConvert : IMultiValueConverter
+    {
+        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (values == null || values.Length==0)
+            {
+                return 0;
+            }
+            else
+            {
+                if (values[0] is double)
+                {
+                    double width = (double)values[0];
+                    width = width - SystemParameters.VerticalScrollBarWidth - 8;
+                    return Math.Max(0, width);
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+        }
+
+        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 37 - 0
PDF Office/EventAggregators/EditToolsEvent.cs

@@ -1,6 +1,8 @@
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.Model.EditTools.Background;
 using PDF_Office.Model.EditTools.Watermark;
+using PDF_Office.Model.EditTools.Bates;
+using PDF_Office.Model.EditTools.HeaderFooter;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Events;
@@ -103,6 +105,18 @@ namespace PDF_Office.EventAggregators
         public WatermarkInfo Status;
     }
 
+    public class BatesInfoUnicode
+    {
+        public string Unicode;
+        public BatesInfo Status;
+    }
+
+    public class HeaderFooterInfoUnicode
+    {
+        public string Unicode;
+        public HeaderFooterInfo Status;
+    }
+
     public class BackgroundItemUnicode
     {
         public string Unicode;
@@ -122,6 +136,7 @@ namespace PDF_Office.EventAggregators
         public BatesHeaderFooterItem Status;
     }
 
+
     public class CPDFViewerUnicode
     {
         public string Unicode;
@@ -148,6 +163,12 @@ namespace PDF_Office.EventAggregators
     public class ConfirmEditToolsWatermarkEvent : PubSubEvent
     {
     }
+    public class ConfirmEditToolsBatesEvent : PubSubEvent<string>
+    {
+    }
+    public class ConfirmEditToolsHeaderFooterEvent : PubSubEvent<string>
+    {
+    }
 
     public class SetCurrentCreateModEvent : PubSubEvent<stringUnicode>
     {
@@ -165,6 +186,14 @@ namespace PDF_Office.EventAggregators
     {
     }
 
+    public class SetBatesEvent : PubSubEvent<BatesInfoUnicode>
+    {
+    }
+
+    public class SetHeaderFooterEvent : PubSubEvent<HeaderFooterInfoUnicode>
+    {
+    }
+
     public class SaveBackgroundTemplateEvent : PubSubEvent<EnumColorOrFileUnicode>
     {
     }
@@ -181,6 +210,14 @@ namespace PDF_Office.EventAggregators
     {
     }
 
+    public class DeleteBatesEvent : PubSubEvent<EnumDeleteUnicode>
+    {
+    }
+
+    public class DeleteHeaderFooterEvent : PubSubEvent<EnumDeleteUnicode>
+    {
+    }
+
     public class CurrentWatermarkPDFViewerEvent : PubSubEvent<CPDFViewerUnicode>
     {
     }

+ 123 - 0
PDF Office/Helper/CacheFilePath.cs

@@ -0,0 +1,123 @@
+using PDF_Office.Properties;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Helper
+{
+    /// <summary>
+    /// 用于创建、获取、删除缓存文件的辅助类
+    /// 功能模块需要创建缓存文件夹时,统一在此类里处理
+    /// 临时文件在app启动时进行删除
+    /// </summary>
+    public class CacheFilePath
+    {
+        private static readonly CacheFilePath instance = new CacheFilePath();
+
+        /// <summary>
+        /// 图章缓存文件夹路径
+        /// </summary>
+        List<string> CustomStamp = new List<string> { "CustomStamp" };
+        public static CacheFilePath Instance => instance;
+
+        private CacheFilePath()
+        {
+
+        }
+
+        /// <summary>
+        /// 自定图章缓存文件夹
+        /// </summary>
+        public string CustomStampPath
+        {
+            get
+            {
+               return CreateCacheDirectory(CustomStamp);
+            }
+        }
+        /// <summary>
+        ///  在“文档”路径下创建缓存文件夹,传C:\Users\kdan\Documents\PDF Office 以后的文件夹名
+        /// </summary>
+        /// <param name="directoryName">文件路径列表,首位为第一个文件夹名,以此类推</param>
+        /// <returns></returns>
+        private string CreateCacheDirectory(List<string> directoryName)
+        {
+            try
+            {
+                string Path = App.CurrentPath;
+                for (int i = 0; i < directoryName.Count; i++)
+                {
+                    Path = System.IO.Path.Combine(Path, directoryName[i]);
+                }
+           
+                System.IO.DirectoryInfo directoryInfo = System.IO.Directory.CreateDirectory(Path);
+                if (directoryInfo.Exists
+                   && (directoryInfo.Attributes & System.IO.FileAttributes.ReadOnly) != System.IO.FileAttributes.ReadOnly
+                   && (directoryInfo.Attributes & System.IO.FileAttributes.Hidden) != System.IO.FileAttributes.Hidden
+                    )
+                {
+                    return Path;
+                }
+                else
+                {
+                    return "";
+                }
+            }
+            catch (Exception)
+            {
+                return "";
+            }
+        }
+
+        /// <summary>
+        /// 将临时文件添加到待删除列表,app下次启动时删除
+        /// </summary>
+        /// <param name="file"></param>
+        public void AddToDeleteFiles(string file)
+        {
+            //添加时不做是否存在判断,考虑可能每个人调用的顺序不一样,在删除时再做判断
+            try
+            {
+                if (!Settings.Default.AppProperties.NeedToDeletePath.Contains(file))
+                {
+                    Settings.Default.AppProperties.NeedToDeletePath.Add(file);
+                }
+                Settings.Default.Save();
+                //Save后,需要调用reload 防止互相占用文件,引起崩溃,具体效果待验证
+                Settings.Default.Reload();
+            }
+            catch { }
+        }
+
+        public void AddToDeleteFiles(List<string> files)
+        {
+            foreach(string file in files)
+            {
+                AddToDeleteFiles(file);
+            }
+        }
+
+        /// <summary>
+        /// 启动时删除临时文件
+        /// </summary>
+        public void ClearDeleteFiles()
+        {
+            try
+            {
+                foreach (string file in Settings.Default.AppProperties.NeedToDeletePath)
+                {
+                    if (File.Exists(file))
+                    {
+                        File.Delete(file);
+                    }
+                }
+                Settings.Default.AppProperties.NeedToDeletePath.Clear();
+            }
+            catch { }
+        }
+
+    }
+}

+ 42 - 1
PDF Office/Helper/CommonHelper.cs

@@ -1,8 +1,10 @@
-using System;
+using PDF_Office.Model.PageEdit;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Reflection;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
@@ -18,6 +20,8 @@ namespace PDF_Office.Helper
     /// 5.ShowFileBrowser 显示系统文件浏览器,可以根据传入的路径参数,自动选中对应的文件
     /// 6.CreateFilePath 检查对应路径是否有重名,有重名的情况追加尾号
     /// 7.CreateFolder 检查对应文件夹是否有重名,有重名的情况追加尾号
+    /// 8.GetUnitsFromPageSize 将PDF页面宽高转换成对应的单位
+    /// 9.GetDpi() 返回当前设备DPI
     /// </summary>
     public static class CommonHelper
     {
@@ -277,5 +281,42 @@ namespace PDF_Office.Helper
             info.Create();
             return folder;
         }
+
+        /// <summary>
+        /// 将Document 返回的PageSize 转换成对应单位
+        /// </summary>
+        /// <param name="size"></param>
+        /// <param name="unit"></param>
+        /// <returns></returns>
+        public static double GetUnitsFromPageSize(double size,PageItemUnits unit = PageItemUnits.MM)
+        {
+            double sizeWithUnit = 0;
+            switch (unit)
+            {
+                case PageItemUnits.MM:
+                    sizeWithUnit = (size * 96 / 72.0) / GetDpi() * 25.4;
+                    break;
+                case PageItemUnits.CM:
+                    sizeWithUnit = (size * 96 / 72.0) / GetDpi() * 25.4/10.0;
+                    break;
+                case PageItemUnits.IN:
+                    sizeWithUnit = (size * 96 / 72.0) / GetDpi();
+                    break;
+                default:
+                    break;
+            }
+            return sizeWithUnit;
+        }
+
+        /// <summary>
+        /// 返回设备DPI
+        /// </summary>
+        /// <returns></returns>
+        public static double GetDpi()
+        {
+            BindingFlags bindingAttr = BindingFlags.Static | BindingFlags.NonPublic;
+            PropertyInfo property = typeof(SystemParameters).GetProperty("Dpi", bindingAttr);
+            return (int)property.GetValue(null, null);
+        }
     }
 }

+ 140 - 0
PDF Office/Helper/DpiHelpers.cs

@@ -0,0 +1,140 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace PDF_Office.Helper
+{
+    internal class DpiHelpers
+    {
+        /// <summary>
+        /// 当前系统DPI
+        /// </summary>
+        public static int Dpi { get; private set; }
+        /// <summary>
+        /// 当前DPI相对系统标准DPI(96)缩小比例
+        /// </summary>
+        public static float ScaleDpi { get { return (96F / Dpi); } }
+        /// <summary>
+        /// 系统DPI相对PDF文档DPI放大倍数
+        /// </summary>
+        public static double ScaleFactor { get { return (Dpi / 72D); } }
+        /// <summary>
+        /// PDF文档DPI相对系统标准DPI(96)缩小倍数
+        /// </summary>
+        public static double InvertScaleFactor { get { return (72D / Dpi); } }
+        static DpiHelpers()
+        {
+            try
+            {
+                var flags = BindingFlags.NonPublic | BindingFlags.Static;
+                var dpiProperty = typeof(SystemParameters).GetProperty("Dpi", flags);
+                Dpi = (int)dpiProperty.GetValue(null, null);
+
+            }
+            catch { }
+        }
+
+        /// <summary>
+        /// 从WPF获取的数值转换成标准DPI时的大小
+        /// 缩小
+        /// </summary>
+        /// <param name="oldValue">当前数值</param>
+        /// <returns></returns>
+        public static int GetDpiUnrelatedNum(int oldValue)
+        {
+            return (int)(oldValue * ScaleDpi);
+        }
+        /// <summary>
+        /// 从WPF获取的数值转换成标准DPI时的大小
+        /// 缩小
+        /// </summary>
+        /// <param name="oldValue">当前数值</param>
+        /// <returns></returns>
+        public static double GetDpiUnrelatedNum(double oldValue)
+        {
+            return (double)(oldValue * ScaleDpi);
+        }
+        /// <summary>
+        /// 标准DPI时的大小转换成当前DPI对应大小
+        /// 放大
+        /// </summary>
+        /// <param name="oldValue">当前数值</param>
+        /// <returns></returns>
+        public static double GetDpiRelatedNum(double oldValue)
+        {
+            return (oldValue / ScaleDpi);
+        }
+        /// <summary>
+        /// 当前矩形换成标准DPI时的大小
+        /// </summary>
+        /// <param name="oldValue"></param>
+        /// <returns></returns>
+        public static Rect GetDpiUnrelatedRect(Rect oldValue)
+        {
+            return new Rect(GetDpiUnrelatedNum(oldValue.Left), GetDpiUnrelatedNum(oldValue.Top),
+                GetDpiUnrelatedNum(oldValue.Width), GetDpiUnrelatedNum(oldValue.Height));
+        }
+        /// <summary>
+        /// 转换到PDF矩形
+        /// </summary>
+        /// <param name="oldValue"></param>
+        /// <returns></returns>
+        public static Rect GetRawRect(Rect oldValue)
+        {
+            Rect standRect = new Rect(GetDpiUnrelatedNum(oldValue.Left), GetDpiUnrelatedNum(oldValue.Top),
+                GetDpiUnrelatedNum(oldValue.Width), GetDpiUnrelatedNum(oldValue.Height));
+            return new Rect(standRect.Left * 72D / 96D, standRect.Top * 72D / 96D, standRect.Width * 72D / 96D, standRect.Height * 72D / 96D);
+        }
+
+        /// <summary>
+        /// 当前矩形换成当前DPI时的矩形大小
+        /// </summary>
+        /// <param name="oldValue"></param>
+        /// <returns></returns>
+        public static Rect GetDpiRelatedRect(Rect oldValue)
+        {
+            return new Rect(GetDpiRelatedNum(oldValue.Left), GetDpiRelatedNum(oldValue.Top),
+                GetDpiRelatedNum(oldValue.Width), GetDpiRelatedNum(oldValue.Height));
+        }
+        /// <summary>
+        /// 当前点转换成标准DPI时的大小
+        /// </summary>
+        /// <param name="oldValue"></param>
+        /// <returns></returns>
+        public static Point GetDpiUnrelatedPoint(Point oldValue)
+        {
+            return new Point(GetDpiUnrelatedNum(oldValue.X), GetDpiUnrelatedNum(oldValue.Y));
+        }
+        /// <summary>
+        /// 点换成当前DPI时的大小
+        /// </summary>
+        /// <param name="oldValue"></param>
+        /// <returns></returns>
+        public static Point GetDpiRelatedPoint(Point oldValue)
+        {
+            return new Point(GetDpiRelatedNum(oldValue.X), GetDpiRelatedNum(oldValue.Y));
+        }
+        /// <summary>
+        /// 当前Size转换成标准DPI时的大小
+        /// </summary>
+        /// <param name="oldValue"></param>
+        /// <returns></returns>
+        public static Size GetDpiUnrelatedSize(Size oldValue)
+        {
+            return new Size(GetDpiUnrelatedNum(oldValue.Width), GetDpiUnrelatedNum(oldValue.Height));
+        }
+        /// <summary>
+        /// Size换成当前DPI时的大小
+        /// </summary>
+        /// <param name="oldValue"></param>
+        /// <returns></returns>
+        public static Size GetDpiRelatedSize(Size oldValue)
+        {
+            return new Size(GetDpiRelatedNum(oldValue.Width), GetDpiRelatedNum(oldValue.Height));
+        }
+    }
+}

+ 104 - 0
PDF Office/Helper/DragDropHelper.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Interop;
+
+namespace PDF_Office.Helper
+{
+    /// <summary>
+    /// 显示拖拽时图片的辅助类
+    /// </summary>
+    public static class DragDropHelper
+    {
+        private static IDropTargetHelper helper;
+
+        /// <summary>
+        /// 拖拽相关操作的实例
+        /// </summary>
+        public static IDropTargetHelper Helper
+        {
+            get
+            {
+                if (helper == null)
+                {
+                    helper = Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("4657278A-411B-11D2-839A-00C04FD918D0"))) as IDropTargetHelper;
+                }
+                return helper;
+            }
+            set { helper = value; }
+        }
+
+
+        public static void DragEnter(FrameworkElement element, DragEventArgs e)
+        {
+            try
+            {
+                Point iconPoint = e.GetPosition(element);
+                Helper?.DragEnter(new WindowInteropHelper(Window.GetWindow(element)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch { }
+        }
+
+        public static void DragOver(FrameworkElement element, DragEventArgs e)
+        {
+            try
+            {
+                Point iconPoint = e.GetPosition(element);
+                Helper?.DragOver(ref iconPoint, e.Effects);
+            }
+            catch { }
+        }
+
+        public static void DragLeave()
+        {
+            try
+            {
+                Helper?.DragLeave();
+            }
+            catch { }
+        }
+
+        public static void Drop(FrameworkElement element, DragEventArgs e)
+        {
+            try
+            {
+                Point iconPoint = e.GetPosition(element);
+                Helper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch { }
+        }
+    }
+
+    /// <summary>
+    /// 系统设置拖拽时图片的接口
+    /// </summary>
+    [ComImport]
+    [GuidAttribute("4657278B-411B-11d2-839A-00C04FD918D0")]
+    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+    public interface IDropTargetHelper
+    {
+        // Notifies the drag-image manager that the drop target's IDropTarget::DragEnter method has been called  
+        [PreserveSig]
+        Int32 DragEnter(IntPtr hwndTarget, System.Runtime.InteropServices.ComTypes.IDataObject pDataObject, ref Point ppt, DragDropEffects dwEffect);
+
+        // Notifies the drag-image manager that the drop target's IDropTarget::DragLeave method has been called  
+        [PreserveSig]
+        Int32 DragLeave();
+
+        // Notifies the drag-image manager that the drop target's IDropTarget::DragOver method has been called  
+        [PreserveSig]
+        Int32 DragOver(ref Point ppt, DragDropEffects dwEffect);
+
+        // Notifies the drag-image manager that the drop target's IDropTarget::Drop method has been called  
+        [PreserveSig]
+        Int32 Drop(System.Runtime.InteropServices.ComTypes.IDataObject pDataObject, ref Point ppt, DragDropEffects dwEffect);
+
+        // Notifies the drag-image manager to show or hide the drag image  
+        [PreserveSig]
+        Int32 Show(bool fShow);
+    }
+}

+ 1 - 1
PDF Office/Helper/EditToolsHelper.cs

@@ -36,10 +36,10 @@ namespace PDF_Office.Helper
         public static Color ConvertColor(byte[] rgb_array)
         {
             Color color = new Color();
+            color.A = 0xFF;
             color.R = rgb_array[0];
             color.G = rgb_array[1];
             color.B = rgb_array[2];
-
             return color;
         }
 

+ 333 - 56
PDF Office/Helper/PDFToolsHelper.cs

@@ -9,7 +9,34 @@ using System.Threading.Tasks;
 
 namespace PDF_Office.Helper
 {
+    /// <summary>
+    /// 预设需求:远程控制对PDF工具进行排序
+    /// </summary>
     public enum PDFToolType
+    {
+        /// <summary>
+        /// 普通工具
+        /// </summary>
+        Normal,
+        /// <summary>
+        /// 常用工具
+        /// </summary>
+        Common,
+        /// <summary>
+        ///付费工具
+        /// </summary>
+        Payment,
+        /// <summary>
+        /// 优势工具
+        /// </summary>
+        Advantage,
+        /// <summary>
+        /// 无需打开文档
+        /// </summary>
+        NoNeedToOpenDoc
+
+    }
+    public enum PDFFnType
     {
         Split,
         Extract,
@@ -31,12 +58,62 @@ namespace PDF_Office.Helper
         Background,
         CompareDoc
 
+    }
+
+    /// <summary>
+    /// PDF工具初始化类型
+    /// </summary>
+    internal class PDFToolsInit
+    {
+        public ToolItem toolItem { get; private set; }
+        public PDFToolsInit()
+        {
+            toolItem = new ToolItem();
+        }
+
+        /// <summary>
+        /// 图标
+        /// </summary>
+        public void SetImagePath(string path)
+        {
+            toolItem.FnImg = path;
+        }
+
+        /// <summary>
+        /// 初始化UI显示内容
+        /// </summary>
+        public void SetContent(string fnName,string fnInfo)
+        {
+            toolItem.FnName = fnName;
+            toolItem.FnInfo = fnInfo;
+        }
+
+        /// <summary>
+        /// 初始化功能
+        /// </summary>
+        public void SetFnType(PDFFnType fnType)
+        {
+            toolItem.FnType = fnType;
+        }
+
+
     }
     public class PDFToolsHelper
     {
         public List<ToolItem> AllTools = null;
         public List<ToolItem> QuickTools = null;
-        public PDFToolsHelper()
+        public List<ToolItem> MoreTools = null;
+        private static PDFToolsHelper pDFToolsHelper;
+
+        public const int QuickToolCount = 8;//快捷工具显示的个数
+        public static PDFToolsHelper GetInstance()
+        {
+            if (pDFToolsHelper == null)
+                pDFToolsHelper = new PDFToolsHelper();
+
+            return pDFToolsHelper;
+        }
+        private PDFToolsHelper()
         {
             InitPDFTools();
         }
@@ -44,99 +121,299 @@ namespace PDF_Office.Helper
         private void InitPDFTools()
         {
             AllTools = new List<ToolItem>();
+            QuickTools = new List<ToolItem>();
+            MoreTools = new List<ToolItem>();
+            //测试代码
+            //Settings.Default.AllPDFToolsList.Clear();
+            //Settings.Default.QuickPDFToolsList.Clear();
+            //Settings.Default.Save();
             InitAllTools();
             InitQuickTools();
+            InitMoreTools();
+
+            //  ContianNewTools();
         }
 
         private void InitAllTools()
-        {
-            string path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/split.png";
-            AddToolItem(PDFToolType.Split, path, "拆分", "Batch convert, compress, secure, watermark PDFs.");
+        { 
+
+            var split = new PDFToolsInit();
+            split.SetFnType(PDFFnType.Split);
+            split.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/split.png");
+            split.SetContent("拆分", "Batch convert, compress, secure, watermark PDFs.");
+
+            var extract = new PDFToolsInit();
+            extract.SetFnType(PDFFnType.Extract);
+            extract.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/extract.png");
+            extract.SetContent("提取", "Batch convert, compress, secure, watermark PDFs.");
+
+            var insert = new PDFToolsInit();
+            insert.SetFnType(PDFFnType.Insert);
+            insert.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/insert.png");
+            insert.SetContent("插入", "Batch convert, compress, secure, watermark PDFs.");
+
+            var compress = new PDFToolsInit();
+            compress.SetFnType(PDFFnType.Compress);
+            compress.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/compress.png");
+            compress.SetContent("压缩", "Batch convert, compress, secure, watermark PDFs.");
+
+            var merge = new PDFToolsInit();
+            merge.SetFnType(PDFFnType.Merge);
+            merge.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/merge.png");
+            merge.SetContent("合并", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/extract.png";
-            AddToolItem(PDFToolType.Extract, path, "提取", "Batch convert, compress, secure, watermark PDFs.");
+            var print = new PDFToolsInit();
+            print.SetFnType(PDFFnType.Print);
+            print.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/print.png");
+            print.SetContent("打印", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/insert.png";
-            AddToolItem(PDFToolType.Insert, path, "插入", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/compress.png";
-            AddToolItem(PDFToolType.Compress, path, "压缩", "Batch convert, compress, secure, watermark PDFs.");
+            var security = new PDFToolsInit();
+            security.SetFnType(PDFFnType.Security);
+            security.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/security.png");
+            security.SetContent("安全", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/merge.png";
-            AddToolItem(PDFToolType.Merge, path, "合并", "Batch convert, compress, secure, watermark PDFs.");
+            var convertPDF = new PDFToolsInit();
+            convertPDF.SetFnType(PDFFnType.ConvertPDF);
+            convertPDF.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/convert.png");
+            convertPDF.SetContent("转档PDF", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/print.png";
-            AddToolItem(PDFToolType.Print, path, "打印", "Batch convert, compress, secure, watermark PDFs.");
+            var pDFToWord = new PDFToolsInit();
+            pDFToWord.SetFnType(PDFFnType.PDFToWord);
+            pDFToWord.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/pdf-to-word.png");
+            pDFToWord.SetContent("PDF转Word", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/security.png";
-            AddToolItem(PDFToolType.Security, path, "安全", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/convert.png";
-            AddToolItem(PDFToolType.ConvertPDF, path, "转档PDF", "Batch convert, compress, secure, watermark PDFs.");
+            var pDFToExcel = new PDFToolsInit();
+            pDFToExcel.SetFnType(PDFFnType.PDFToExcel);
+            pDFToExcel.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/pdf-to-excel.png");
+            pDFToExcel.SetContent("PDF转Excel", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/pdf-to-word.png";
-            AddToolItem(PDFToolType.PDFToWord, path, "PDF转Word", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/pdf-to-excel.png";
-            AddToolItem(PDFToolType.PDFToExcel, path, "PDF转Excel", "Batch convert, compress, secure, watermark PDFs.");
+            var pDFToPPT = new PDFToolsInit();
+            pDFToPPT.SetFnType(PDFFnType.PDFToPPT);
+            pDFToPPT.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/pdf-to-ppt.png");
+            pDFToPPT.SetContent("PDF转PPT", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/pdf-to-ppt.png";
-            AddToolItem(PDFToolType.PDFToPPT, path, "PDF转PPT", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/image.png";
-            AddToolItem(PDFToolType.ImageToPDF, path, "图片转PDF", "Batch convert, compress, secure, watermark PDFs.");
+            var imageToPDF = new PDFToolsInit();
+            imageToPDF.SetFnType(PDFFnType.ImageToPDF);
+            imageToPDF.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/image.png");
+            imageToPDF.SetContent("图片转PDF", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/ocr.png";
-            AddToolItem(PDFToolType.OCR, path, "OCR", "Batch convert, compress, secure, watermark PDFs.");
+            var oCR = new PDFToolsInit();
+            oCR.SetFnType(PDFFnType.OCR);
+            oCR.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/ocr.png");
+            oCR.SetContent("OCR", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/watermark.png";
-            AddToolItem(PDFToolType.WaterMark, path, "水印", "Batch convert, compress, secure, watermark PDFs.");
+            var waterMark = new PDFToolsInit();
+            waterMark.SetFnType(PDFFnType.WaterMark);
+            waterMark.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/watermark.png");
+            waterMark.SetContent("水印", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/header&footer.png";
-            AddToolItem(PDFToolType.HeaderFooter, path, "页眉页脚", "Batch convert, compress, secure, watermark PDFs.");
+            var headerFooter = new PDFToolsInit();
+            headerFooter.SetFnType(PDFFnType.HeaderFooter);
+            headerFooter.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/header&footer.png");
+            headerFooter.SetContent("页眉页脚", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/batesnumbers.png";
-            AddToolItem(PDFToolType.BatesNumbers, path, "贝茨Bates码", "Batch convert, compress, secure, watermark PDFs.");
+            var batesNumbers = new PDFToolsInit();
+            batesNumbers.SetFnType(PDFFnType.BatesNumbers);
+            batesNumbers.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/batesnumbers.png");
+            batesNumbers.SetContent("贝茨Bates码", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/batch.png";
-            AddToolItem(PDFToolType.Batch, path, "批量处理", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/background.png";
-            AddToolItem(PDFToolType.Background, path, "背景", "Batch convert, compress, secure, watermark PDFs.");
+            var batch = new PDFToolsInit();
+            batch.SetFnType(PDFFnType.Batch);
+            batch.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/batch.png");
+            batch.SetContent("批量处理", "Batch convert, compress, secure, watermark PDFs.");
 
-            path = @"pack://application:,,,/Resources/HomeIcon/PDFTools/compress.png";
-            AddToolItem(PDFToolType.CompareDoc, path, "文件对比", "Batch convert, compress, secure, watermark PDFs.");
 
-           
+            var background = new PDFToolsInit();
+            background.SetFnType(PDFFnType.Background);
+            background.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/background.png");
+            background.SetContent("背景", "Batch convert, compress, secure, watermark PDFs.");
+
+
+            var compareDoc = new PDFToolsInit();
+            compareDoc.SetFnType(PDFFnType.CompareDoc);
+            compareDoc.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/compress.png");
+            compareDoc.SetContent("文件对比", "Batch convert, compress, secure, watermark PDFs.");
+
+            AllTools.Add(split.toolItem);
+            AllTools.Add(extract.toolItem);
+            AllTools.Add(insert.toolItem);
+            AllTools.Add(compress.toolItem);
+            AllTools.Add(merge.toolItem);
+            AllTools.Add(print.toolItem);
+            AllTools.Add(security.toolItem);
+            AllTools.Add(convertPDF.toolItem);
+            AllTools.Add(pDFToWord.toolItem);
+            AllTools.Add(pDFToExcel.toolItem);
+            AllTools.Add(pDFToPPT.toolItem);
+            AllTools.Add(imageToPDF.toolItem);
+            AllTools.Add(oCR.toolItem);
+            AllTools.Add(waterMark.toolItem);
+            AllTools.Add(headerFooter.toolItem);
+            AllTools.Add(batesNumbers.toolItem);
+            AllTools.Add(batch.toolItem);
+            AllTools.Add(background.toolItem);
+            AllTools.Add(compareDoc.toolItem);
         }
 
+        /// <summary>
+        /// 检查是否为新增工具
+        /// </summary>
         private void ContianNewTools()
         {
-            if (Settings.Default.AllPDFToolsList != null)
+            var cacheList = Settings.Default.AllPDFToolsList;
+            foreach (var item in AllTools)
+            {
+                ToolItem toolItem = null;
+                foreach (var cacheItem in cacheList)
+                {
+                    var strFnTye = Enum.GetName(typeof(PDFFnType), item.FnType);
+                    if (cacheItem.FnTypeStr != strFnTye && cacheItem.IsNewTool == true)
+                    {
+                        toolItem = item;
+                        break;
+                    }
+                }
+
+                if(toolItem != null && toolItem.IsNewTool == true)
+                {
+                    CacheToolItem cacheTool = new CacheToolItem();
+                    cacheTool.IsNewTool = true;
+                    cacheTool.ToolTypeId = toolItem.ToolTypeId;
+                    cacheTool.ToolTypeStr = Enum.GetName(typeof(PDFToolType), toolItem.ToolType);
+                    cacheTool.FnTypeStr = Enum.GetName(typeof(PDFFnType), toolItem.FnType);
+                    Settings.Default.AllPDFToolsList.Add(cacheTool);
+                }
+               
+            }
+            Settings.Default.Save();
+
+        }
+
+        /// <summary>
+        /// 快捷工具
+        /// </summary>
+        private void InitQuickTools()
+        {
+
+            var cacheList = Settings.Default.AllPDFToolsList;
+
+            if (cacheList == null)
+                cacheList = new AllPDFToolsList();
+
+            if(cacheList.Count > 0)
+            {
+                int currentCount = 0;
+                foreach (var cacheItem in cacheList)
+                {
+                    if (cacheItem.ToolLayOutType == 1 && currentCount < QuickToolCount)
+                    {
+                        foreach (var allItem in AllTools)
+                        {
+                            if (cacheItem.FnTypeStr == Enum.GetName(typeof(PDFFnType), allItem.FnType))
+                            {
+                                allItem.IsQuickTool = true;
+
+                                var index = QuickTools.FindIndex(t => t.ToolTypeId > allItem.ToolTypeId);
+                                if (index == -1)
+                                {
+                                    allItem.ToolTypeId = cacheItem.ToolTypeId;
+                                    QuickTools.Add(allItem);
+                                }
+                                else
+                                {
+                                    allItem.ToolTypeId = index;
+                                    QuickTools.Insert(index, allItem);
+                                }
+
+                                currentCount++;
+                                break;
+                            }
+                        }
+                    }
+                }
+
+            }
+            else
             {
-                foreach(var item in AllTools)
+                //当所有工具大于等于快捷工具显示的个数时
+                if (AllTools.Count >= QuickToolCount)
+                {
+                    for (int i = 0; i < QuickToolCount; i++)
+                    {
+                        AllTools[i].ToolTypeId = i;
+                        AllTools[i].IsQuickTool = true;
+                        QuickTools.Add(AllTools[i]);
+                    }
+                }
+                else
                 {
-                    Settings.Default.AllPDFToolsList.FirstOrDefault(tool => tool.Tag == item.Tag);
+                    for (int i = 0; i < AllTools.Count; i++)
+                    {
+                        AllTools[i].ToolTypeId = i;
+                        AllTools[i].IsQuickTool = true;
+                        QuickTools.Add(AllTools[i]);
+                    }
                 }
+                SaveAllTools();
+
             }
+
+
+
         }
 
-        private void AddToolItem(PDFToolType toolType, string imgPath,string title,string titleInfo,int id = 0)
+        private void SaveAllTools()
         {
-            ToolItem toolItem = new ToolItem();
-
-            toolItem.Id = id;
-            toolItem.Tag = (int)toolType;
-            toolItem.TagStr = Enum.GetName(typeof(PDFToolType), toolType);
-            toolItem.Image = imgPath;
-            toolItem.Title = title;
-            toolItem.TitleInfo = titleInfo;
-            AllTools.Add(toolItem);
+            var cacheList = Settings.Default.AllPDFToolsList;
+
+            foreach (var item in AllTools)
+            {
+                CacheToolItem cacheItem = new CacheToolItem();
+                cacheItem.ToolLayOutType = (item.IsQuickTool == true ? 1 : 0);
+                cacheItem.IsNewTool = item.IsNewTool;
+                cacheItem.ToolTypeId = item.ToolTypeId;
+                cacheItem.ToolTypeStr = Enum.GetName(typeof(PDFToolType), item.ToolType);
+                cacheItem.FnTypeStr = Enum.GetName(typeof(PDFFnType), item.FnType);
+                cacheList.Add(cacheItem);
+            }
+            Settings.Default.Save();
         }
 
-        private void InitQuickTools()
+
+        private void InitMoreTools()
         {
-            QuickTools = AllTools.Take(8).ToList<ToolItem>();
+            int currentCount = 0;
+            foreach (var allItem in AllTools)
+            {
+                if (allItem.IsQuickTool == false)
+                {
+                    allItem.ToolTypeId = currentCount;
+                    MoreTools.Add(allItem);
+                    currentCount++;
+                }
+            }
+        }
+
+        public void SaveCacheList()
+        {
+            var cacheLists = Settings.Default.AllPDFToolsList;
+            CacheToolItem cacheItem = null;
+            foreach (var item in AllTools)
+            {
+                cacheItem = cacheLists.Find(t => t.FnTypeStr == Enum.GetName(typeof(PDFFnType), item.FnType));
+                if (cacheItem != null)
+                {
+                    cacheItem.ToolTypeId = item.ToolTypeId;
+                    cacheItem.ToolLayOutType = (item.IsQuickTool == true ? 1 : 0);
+                }
+            }
+
+            Settings.Default.Save();
         }
     }
 

+ 228 - 0
PDF Office/Helper/RichTextBoxHelper.cs

@@ -0,0 +1,228 @@
+using ComPDFKit.PDFDocument;
+using PDF_Office.Model.BOTA;
+using PDF_Office.Views.BOTA;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Media;
+using System.Windows.Media.TextFormatting;
+
+namespace PDF_Office.Helper
+{
+    public class OutlineSerach { 
+          public string Title { get; set; }
+    }
+    public class RichTextBoxHelper : DependencyObject
+    {
+        public static FlowDocument GetDocumentBind(DependencyObject obj)
+        {
+            return (FlowDocument)obj.GetValue(DocumentBindProperty);
+        }
+        public static void SetDocumentBind(DependencyObject obj, FlowDocument value)
+        {
+            obj.SetValue(DocumentBindProperty, value);
+        }
+        public static FlowDocument GetOutlineSearchDocumentBind(DependencyObject obj)
+        {
+            return (FlowDocument)obj.GetValue(OutlineSearchDocumentBindProperty);
+        }
+        public static string searchWord = "";
+        public static void SetOutlineSearchDocumentBind(DependencyObject obj, FlowDocument value)
+        {
+            obj.SetValue(OutlineSearchDocumentBindProperty, value);
+        }
+
+        public static readonly DependencyProperty DocumentBindProperty =
+            DependencyProperty.RegisterAttached("DocumentBind",
+                typeof(TextBindProperty),
+                typeof(RichTextBoxHelper),
+                new FrameworkPropertyMetadata
+                {
+                    BindsTwoWayByDefault = true,
+                    PropertyChangedCallback = (obj, e) =>
+                    {
+                        RichTextBox richTextBox = obj as RichTextBox;
+                        TextBindProperty bindItem = e.NewValue as TextBindProperty;
+                        if (richTextBox != null && bindItem != null)
+                        {
+                            richTextBox.Document = GetFlowDocument(bindItem.TextContent.Trim(), bindItem.SearchWord, bindItem.HighLightColor);
+                        }
+                    }
+                });
+
+        public static readonly DependencyProperty OutlineSearchDocumentBindProperty =
+            DependencyProperty.RegisterAttached("OutlineSearchDocumentBind",
+                typeof(OutlineNode),
+                typeof(RichTextBoxHelper),
+                new FrameworkPropertyMetadata
+                {
+                    BindsTwoWayByDefault = false,
+                    PropertyChangedCallback = (obj, e) =>
+                    {
+                        RichTextBox richTextBox = obj as RichTextBox;
+                        OutlineNode bindItem = e.NewValue as OutlineNode;
+                       
+                        if (richTextBox != null )
+                        {
+                           // richTextBox.Document = GetOutlineFlowDocument(bindItem.outline.Title, searchWord, Color.FromArgb(0x99, 0xFF, 0xF7, 0x00));
+                           /* if (richTextBox.Document.Name!="nodata") {
+                                richTextBox.Visibility = Visibility.Collapsed;
+                            }*/
+                        }
+                    }
+                });
+        public static FlowDocument GetOutlineFlowDocument(string content, string keyword, Color textColor)
+        {
+            FlowDocument Document = new FlowDocument();
+            Paragraph textPara = new Paragraph();
+            Document.Blocks.Add(textPara);
+            List<int> indexList = new List<int>();
+            content = Regex.Replace(content, "[\r\n]", " ");
+            if (keyword.Length > 0)
+            {
+                for (int i = 0; i < content.Length && i >= 0;)
+                {
+                    i = content.IndexOf(keyword, i, StringComparison.OrdinalIgnoreCase);
+                    if (i == -1)
+                    {
+                        break;
+                    }
+                    if (indexList.Contains(i) == false)
+                    {
+                        indexList.Add(i);
+                    }
+                    i += keyword.Length;
+                }
+            }
+            List<string> splitList = new List<string>();
+            int lastIndex = -1;
+            foreach (int index in indexList)
+            {
+                string prevStr = string.Empty;
+                if (lastIndex == -1)
+                {
+                    prevStr = content.Substring(0, index);
+                    //Document.Name = "nodata";
+                }
+                else
+                {
+                    prevStr = content.Substring(lastIndex + keyword.Length, index - lastIndex - 1);
+                }
+                if (prevStr != string.Empty)
+                {
+                    splitList.Add(prevStr);
+                }
+
+                splitList.Add(content.Substring(index, keyword.Length));
+                lastIndex = index;
+            }
+            if (indexList.Count > 0)
+            {
+                lastIndex = indexList[indexList.Count - 1];
+                if (content.Length > lastIndex + keyword.Length)
+                {
+                    splitList.Add(content.Substring(lastIndex + keyword.Length));
+                }
+            }
+            TextBlock addBlock = new TextBlock();
+            if (splitList.Count == 0)
+            {
+                Run textRun = new Run(content);
+                addBlock.Inlines.Add(textRun);
+            }
+            else
+            {
+                foreach (string textappend in splitList)
+                {
+                    Run textRun = new Run(textappend);
+                    if (textappend.Equals(keyword, StringComparison.OrdinalIgnoreCase))
+                    {
+                        textRun.Background = new SolidColorBrush(textColor);
+                    }
+                    addBlock.Inlines.Add(textRun);
+                }
+            }
+            addBlock.TextTrimming = TextTrimming.CharacterEllipsis;
+            textPara.Inlines.Add(addBlock);
+
+            return Document;
+        }
+
+        public static FlowDocument GetFlowDocument(string content, string keyword, Color textColor)
+        {
+            FlowDocument Document = new FlowDocument();
+            Paragraph textPara = new Paragraph();
+            Document.Blocks.Add(textPara);
+            List<int> indexList = new List<int>();
+            content = Regex.Replace(content, "[\r\n]", " ");
+            if (keyword.Length > 0)
+            {
+                for (int i = 0; i < content.Length && i >= 0;)
+                {
+                    i = content.IndexOf(keyword, i, StringComparison.OrdinalIgnoreCase);
+                    if (i == -1)
+                    {
+                        break;
+                    }
+                    if (indexList.Contains(i) == false)
+                    {
+                        indexList.Add(i);
+                    }
+                    i += keyword.Length;
+                }
+            }
+            List<string> splitList = new List<string>();
+            int lastIndex = -1;
+            foreach (int index in indexList)
+            {
+                string prevStr = string.Empty;
+                if (lastIndex == -1)
+                {
+                    prevStr = content.Substring(0, index);
+                }
+                else
+                {
+                    prevStr = content.Substring(lastIndex + keyword.Length, index - lastIndex - 1);
+                }
+                if (prevStr != string.Empty)
+                {
+                    splitList.Add(prevStr);
+                }
+
+                splitList.Add(content.Substring(index, keyword.Length));
+                lastIndex = index;
+            }
+            if (indexList.Count > 0)
+            {
+                lastIndex = indexList[indexList.Count - 1];
+                if (content.Length > lastIndex + keyword.Length)
+                {
+                    splitList.Add(content.Substring(lastIndex + keyword.Length));
+                }
+            }
+            TextBlock addBlock = new TextBlock();
+            foreach (string textappend in splitList)
+            {
+                Run textRun = new Run(textappend);
+                if (textappend.Equals(keyword, StringComparison.OrdinalIgnoreCase))
+                {
+                    textRun.Background = new SolidColorBrush(textColor);
+                }
+                addBlock.Inlines.Add(textRun);
+                }
+            addBlock.TextTrimming = TextTrimming.CharacterEllipsis;
+            textPara.Inlines.Add(addBlock);
+
+            return Document;
+        }
+
+    }
+}

+ 157 - 0
PDF Office/Model/AnnotPanel/Stamp.cs

@@ -0,0 +1,157 @@
+using ComPDFKitViewer.AnnotEvent;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media.Imaging;
+
+namespace PDF_Office.Model.AnnotPanel
+{
+    public class Stamp : BindableBase
+    {
+        private string stampText;
+
+        public string StampText
+        {
+            get { return stampText; }
+            set
+            {
+                SetProperty(ref stampText, value);
+            }
+        }
+
+        private string sourcePath;
+
+        public string SourcePath
+        {
+            get { return sourcePath; }
+            set
+            {
+                SetProperty(ref sourcePath, value);
+            }
+        }
+
+        private int maxWidth;
+
+        public int MaxWidth
+        {
+            get { return maxWidth; }
+            set
+            {
+                SetProperty(ref maxWidth, value);
+            }
+        }
+
+        private int maxHeight;
+
+        public int MaxHeight
+        {
+            get { return maxHeight; }
+            set
+            {
+                SetProperty(ref maxHeight, value);
+            }
+        }
+
+        private StampType type;
+
+        public StampType Type
+        {
+            get { return type; }
+            set
+            {
+                SetProperty(ref type, value);
+            }
+        }
+
+        private string author;
+
+        public string Author
+        {
+            get { return author; }
+            set
+            {
+                SetProperty(ref author, value);
+            }
+        }
+        private double opacity;
+
+        public double Opacity
+        {
+            get { return opacity; }
+            set
+            {
+                SetProperty(ref opacity, value);
+            }
+        }
+
+        private BitmapSource imageSource;
+
+        public BitmapSource ImageSource
+        {
+            get { return imageSource; }
+            set
+            {
+                SetProperty(ref imageSource, value);
+            }
+        }
+
+        private TextStampColor textColor;
+
+        public TextStampColor TextColor
+        {
+            get { return textColor; }
+            set
+            {
+                SetProperty(ref textColor, value);
+            }
+        }
+
+        private string stampTextDate;
+
+        public string StampTextDate
+        {
+            get { return stampTextDate; }
+            set
+            {
+                SetProperty(ref stampTextDate, value);
+            }
+        }
+
+        private TextStampSharp textSharp;
+
+        public TextStampSharp TextSharp
+        {
+            get { return textSharp; }
+            set
+            {
+                SetProperty(ref textSharp, value);
+            }
+        }
+
+        private bool isCheckedDate;
+
+        public bool IsCheckedDate
+        {
+            get { return isCheckedDate; }
+            set
+            {
+                SetProperty(ref isCheckedDate, value);
+            }
+        }
+
+        private bool isCheckedTime;
+
+        public bool IsCheckedTime
+        {
+            get { return isCheckedTime; }
+            set
+            {
+                SetProperty(ref isCheckedTime, value);
+            }
+        }
+
+    }
+}

+ 29 - 0
PDF Office/Model/BOTA/AnnotationHandlerEventArgs.cs

@@ -0,0 +1,29 @@
+using ComPDFKit.PDFDocument;
+using ComPDFKitViewer.AnnotEvent;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media.Imaging;
+
+namespace PDF_Office.Model.BOTA
+{
+    public class AnnotationHandlerEventArgs : EventArgs
+    {
+        public string Content { get; set; }
+        public string MarkupContent { get; set; }
+        public string Author { get; set; }
+        public string CreateTime { get; set; }
+        public string UpdateTime { get; set; }
+        public AnnotArgsType EventType { get; set; }
+        public bool Locked { get; set; }
+        public bool ReadOnly { get; set; }
+        public ComPDFKitViewer.FormField FormField { get; set; }
+        public int PageIndex { get; set; }
+        public int AnnotIndex { get; set; }
+        public AnnotHandlerEventArgs AnnotHandlerEventArgs { get; set; }
+        public WriteableBitmap WriteableBitmap { get; set; }
+        public CPDFDocument Document { get; set; }
+    }
+}

+ 200 - 0
PDF Office/Model/BOTA/OutlineNode.cs

@@ -0,0 +1,200 @@
+using ComPDFKit.PDFDocument;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace PDF_Office.Model.BOTA
+{
+    public class OutlineNode : BindableBase
+    {
+        /// <summary>
+        /// 父类大纲
+        /// </summary>
+        private OutlineNode parent = null;
+
+        public OutlineNode Parent
+        {
+            get { return parent; }
+            set
+            {
+                SetProperty(ref parent, value);
+            }
+        }
+        /// <summary>
+        /// 当前大纲对象
+        /// </summary>
+        private CPDFOutline outline = null;
+
+        public CPDFOutline Outline
+        {
+            get { return outline; }
+            set
+            {
+                SetProperty(ref outline, value);
+            }
+        }
+
+        /// <summary>
+        /// 子类大纲集合
+        /// </summary>
+        private ObservableCollection<OutlineNode> chlidlist = new ObservableCollection<OutlineNode>();
+
+        public ObservableCollection<OutlineNode> Chlidlist
+        {
+            get { return chlidlist; }
+            set
+            {
+                SetProperty(ref chlidlist, value);
+            }
+        }
+
+        /// <summary>
+        /// 控制虚线的显示
+        /// </summary>
+        private bool isInsertNextLayer = false;
+
+        public bool IsInsertNextLayer
+        {
+            get { return isInsertNextLayer; }
+            set
+            {
+                SetProperty(ref isInsertNextLayer, value);
+            }
+        }
+
+        /// <summary>
+        /// 控制实线的显示
+        /// </summary>
+        private bool isInsertCurrentLayer = false;
+
+        public bool IsInsertCurrentLayer
+        {
+            get { return isInsertCurrentLayer; }
+            set
+            {
+                SetProperty(ref isInsertCurrentLayer, value);
+            }
+        }
+
+        /// <summary>
+        /// 当前节点展开状态
+        /// </summary>
+        private bool isExpanded = false;
+
+        public bool IsExpanded
+        {
+            get { return isExpanded; }
+            set
+            {
+                SetProperty(ref isExpanded, value);
+            }
+        }
+
+        private bool isSelected;
+
+        public bool IsSelected
+        {
+            get { return isSelected; }
+            set
+            {
+                SetProperty(ref isSelected, value);
+            }
+        }
+
+        private bool canDown = true;
+
+        public bool CanDown
+        {
+            get { return canDown; }
+            set
+            {
+                SetProperty(ref canDown, value);
+            }
+        }
+
+        private bool canUp = true;
+
+        public bool CanUp
+        {
+            get { return canUp; }
+            set
+            {
+                SetProperty(ref canUp, value);
+            }
+        }
+
+        private bool canAddParent = true;
+
+        public bool CanAddParent
+        {
+            get { return canAddParent; }
+            set
+            {
+                SetProperty(ref canAddParent, value);
+            }
+        }
+
+        private Visibility isReName=Visibility.Visible;
+
+        public Visibility IsReName
+        {
+            get { return isReName; }
+            set
+            {
+                SetProperty(ref isReName, value);
+            }
+        }
+
+
+
+        private string pageIndex = "";
+
+        public string PageIndex
+        {
+            get { return pageIndex; }
+            set
+            {
+                SetProperty(ref pageIndex, value);
+            }
+        }
+
+        private double positionX;
+
+        public double PositionX
+        {
+            get { return positionX; }
+            set
+            {
+                SetProperty(ref positionX, value);
+            }
+        }
+
+        private double positionY;
+
+        public double PositionY
+        {
+            get { return positionY; }
+            set
+            {
+                SetProperty(ref positionY, value);
+            }
+        }
+
+        private double zoom;
+
+        public double Zoom
+        {
+            get { return zoom; }
+            set
+            {
+                SetProperty(ref zoom, value);
+            }
+        }
+
+    }
+}

+ 0 - 1
PDF Office/Model/CloudDrive/CloudDriveItem.cs

@@ -16,7 +16,6 @@ namespace PDF_Office.Model.CloudDrive
         OneDrive
     }
 
-
     public class CloudBoxItem
     {
         public CloudType CloudDiskType { get; set; }

+ 51 - 12
PDF Office/Model/CloudDrive/CloudFiles.cs

@@ -33,7 +33,7 @@ namespace PDF_Office.Model.CloudDrive
         }
     }
 
-    #region 公有云盘
+    #region 云盘基类
 
     /// <summary>
     /// 用户信息
@@ -47,6 +47,13 @@ namespace PDF_Office.Model.CloudDrive
         public string UserAccount { get; set; }
     }
 
+    public class FolderBaseItem
+    {
+        public FileOperation Operation { get; set; }
+        public int Level { get; set; }
+        public string FolderName { get; set; }
+    }
+
     /// <summary>
     /// 用户云盘
     /// </summary>
@@ -56,36 +63,68 @@ namespace PDF_Office.Model.CloudDrive
         public CloudType cloudType { get; set; }
     }
 
+    public class FilesBaseItem
+    {
+        public string Id { get; set; }
+        public bool IsFolder { get; set; }
+        public int Level { get; set; }
+        public string Name { get; set; }
+        public string MimeType { get; set; }
+        public long? Size { get; set; }
+        public DateTime? CreatedTime { get; set; }
+    }
+
     #endregion
 
     #region GooglrDrive
+    //文件夹
+    public class GoogleDriveFolder: FolderBaseItem
+    {
+     
+        
+    }
+
 
     /// <summary>
     /// 谷歌云盘的文件
     /// </summary>
-    public class GoogleDriveFiles
+    public class GoogleDriveFiles: FilesBaseItem
     {
-        public string Id { get; set; }
-        public string Name { get; set; }
-        public long? Size { get; set; }
         public long? Version { get; set; }
-        public DateTime? CreatedTime { get; set; }
     }
 
     #endregion
 
 
-    #region GooglrDrive
+    #region DropbBox
 
     /// <summary>
     /// 谷歌云盘的文件
     /// </summary>
-    public class DropbBoxFiles
+    public class DropbBoxFiles : FilesBaseItem
     {
-        public string Id { get; set; }
-        public string Name { get; set; }
-        public long? Size { get; set; }
-        public DateTime? CreatedTime { get; set; }
+        public string PathDisplay { get; set; }
+    }
+    public class DropbBoxFolder : FolderBaseItem
+    {
+
+
+    }
+
+    /// <summary>
+    /// 指定某云盘某用户,对文件的操作
+    /// </summary>
+    public class FileOperation
+    {
+        public string SourceFileName { get; set; }
+        public string SourceFile { get; set; }
+        public UserBaseItem User { get; set; }
+        public FilesBaseItem DoFile { get; set; }
+        public FileOperation(UserBaseItem user, FilesBaseItem doFile)
+        {
+            User = user;
+            DoFile = doFile;
+        }
     }
 
     #endregion

+ 24 - 1
PDF Office/Model/DialogNames.cs

@@ -95,15 +95,37 @@ namespace PDF_Office.Model
         ///BOTA-书签-添加书签弹窗
         /// </summary>
         public static string AddBookmarkDialog = "AddBookmarkDialog";
+
+        /// <summary>
+        /// BOTA-注释列表-添加笔记
+        /// </summary>
+        public static string AddAnnotationDialog = "AddAnnotationDialog";
+
+        /// <summary>
+        /// BOTA-注释列表-筛选注释
+        /// </summary>
+        public static string ScreenAnnotationDialog = "ScreenAnnotationDialog";
+
         ///<summary>
         ///主页工具-PDF批量工具
         /// </summary>
-        public static string HomePageBatchProcessingDialog ="HomePageBatchProcessingDialog";
+        public static string HomePageBatchProcessingDialog = "HomePageBatchProcessingDialog";
+
+        /// <summary>
+        /// 注释-图章-动态图章设置弹窗
+        /// </summary>
+        public static string DynamicPropertyDialog = "DynamicPropertyDialog";
+
+        /// <summary>
+        /// 注释-图章-自定义图章创建弹窗
+        /// </summary>
+        public static string CustomCreateDialog = "CustomCreateDialog";
 
         ///<summary>
         ///转档-CSVD,PPT,Text,Word,HTML,Img,RTF,Excel弹窗
         /// </summary>
         public static string ConverterCSVDialog = "ConverterCSVDialog";
+
         public static string ConverterPPTDialog = "ConverterPPTDialog";
         public static string ConverterTextDialog = "ConverterTextDialog";
         public static string ConverterWordDialog = "ConverterWordDialog";
@@ -111,6 +133,7 @@ namespace PDF_Office.Model
         public static string ConverterImgDialog = "ConverterImgDialog";
         public static string ConverterRTFDialog = "ConverterRTFDialog";
         public static string ConverterExcelDialog = "ConverterExcelDialog";
+
         ///<summary>
         ///转档进度条弹窗
         /// </summary>

+ 88 - 0
PDF Office/Model/EditTools/Bates/BatesCreateModel.cs

@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+using PDFSettings;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.EditTools.Bates
+{
+    public class BatesCreateModel
+    {
+    }
+    public class BatesInfo
+    {
+        /// <summary>
+        /// 模板名称
+        /// </summary>
+        public string ItemName = "";
+        /// <summary>
+        /// 内容
+        /// </summary>
+        public contentItem[] TextData = new contentItem[6];
+        /// <summary>
+        /// 间距
+        /// </summary>
+        /// 
+        public float[] margin = new float[4];
+        
+
+        /// <summary>
+        /// 起始页
+        /// </summary>
+        public int StarPagetNumber = 1;
+
+        /// <summary>
+        /// 贝茨码:前缀
+        /// </summary>
+        public string Prefix = "";
+
+        /// <summary>
+        /// 贝茨码:后缀
+        /// </summary>
+        public string Suffix = "";
+
+        /// <summary>
+        /// 贝茨码:位数
+        /// </summary>
+        public int DigitNumber = 1;
+
+        /// <summary>
+        /// 页面范围
+        /// </summary>
+        public string PageRange = "0";
+
+        /// <summary>
+        /// 页面范围索引;
+        /// 0:全部页面
+        /// 1:奇数页
+        /// 2;偶数页
+        /// 3:自定义页
+        /// </summary>
+        public int PageRangeIndex = 0;
+    }
+
+    //public struct contentItem
+    //{
+    //    public BateHeaderFooter_ContentType textTag;
+    //    public string text;
+    //    public string fontName;
+    //    public float fontSize;
+
+    //    /// <summary>
+    //    /// 纯色背景颜色
+    //    /// </summary>
+    //    public byte[] Color;
+    //}
+
+    //public enum BateHeaderFooter_ContentType
+    //{
+    //    L_Header,
+    //    C_Header,
+    //    R_Header,
+    //    L_Footer,
+    //    C_Footer,
+    //    R_Footer
+    //}
+
+}

+ 82 - 0
PDF Office/Model/EditTools/HeaderFooter/HeaderFooterCreateModel.cs

@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using PDFSettings;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.EditTools.HeaderFooter
+{
+    public class HeaderFooterCreateModel
+    {
+    }
+
+    public class HeaderFooterInfo {
+        /// <summary>
+        /// 模板名称
+        /// </summary>
+        public string ItemName = "";
+        /// <summary>
+        /// 内容
+        /// </summary>
+        public contentItem[] TextData = new contentItem[6];
+        /// <summary>
+        /// 间距
+        /// </summary>
+        /// 
+        public float[] margin = new float[4];
+
+        /// <summary>
+        /// 起始页
+        /// </summary>
+        public int StarPagetNumber = 1;
+
+
+        /// <summary>
+        /// 页眉页脚:页码格式
+        /// </summary>
+        public string PageNumberFormat = "1";
+        /// <summary>
+        /// 页眉页脚:日期格式
+        /// </summary>
+        public string DateTimeFormat = "m/d";
+
+        /// <summary>
+        /// 页面范围
+        /// </summary>
+        public string PageRange = "0";
+
+        /// <summary>
+        /// 页面范围索引;
+        /// 0:全部页面
+        /// 1:奇数页
+        /// 2;偶数页
+        /// 3:自定义页
+        /// </summary>
+        public int PageRangeIndex = 0;
+    }
+
+    //public struct contentItem
+    //{
+    //    public BateHeaderFooter_ContentType textTag;
+    //    public string text;
+    //    public string fontName;
+    //    public float fontSize;
+    //    /// <summary>
+    //    /// 纯色背景颜色
+    //    /// </summary>
+    //    public byte[] Color;
+    //}
+
+    //public enum BateHeaderFooter_ContentType
+    //{
+    //    L_Header,
+    //    C_Header,
+    //    R_Header,
+    //    L_Footer,
+    //    C_Footer,
+    //    R_Footer
+    //}
+
+}
+

+ 31 - 0
PDF Office/Model/From/FormFieldType.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.From
+{
+    /// <summary>
+    /// 表单栏位字段
+    /// </summary>
+    public enum FormFieldType
+    {
+        /// <summary>
+        /// 可见
+        /// </summary>
+        visible,
+        /// <summary>
+        /// 隐藏
+        /// </summary>
+        hidden,
+        /// <summary>
+        /// 可见但不可打印
+        /// </summary>
+        visibleCantPrint,
+        /// <summary>
+        /// 隐藏但可打印
+        /// </summary>
+        hiddenCanPrint
+    }
+}

+ 28 - 15
PDF Office/Model/PDFTool/ToolItem.cs

@@ -2,29 +2,42 @@
 using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
 namespace PDF_Office.Model.PDFTool
 {
-    public class ToolItem1 : BindableBase
+    public class ToolItem : BindableBase
     {
-        private bool _isShowConciseContent = false;
-        public bool IsShowConciseContent
-        {
-            get { return _isShowConciseContent; }
-            set
-            {
-                SetProperty(ref _isShowConciseContent, value);
-            }
-        }
+        /// <summary>
+        /// 是否为新增的工具
+        /// </summary>
         public bool IsNewTool { get; set; }
-        public int Id { get; set; }
-        public PDFToolType Tag { get; set; }
-        public string Image { get; set; }
-        public string TitleInfo { get; set; }
-        public string Title { get; set; }
+        /// <summary>
+        /// 是否为快捷工具
+        /// </summary>
+        public bool IsQuickTool { get; set; }
+        /// <summary>
+        /// 类型:如普通工具、常用工具、付费工具
+        /// </summary>
+        public int ToolTypeId { get; set; }
+        /// <summary>
+        /// 类型:如普通工具、常用工具、付费工具
+        /// </summary>
+        public PDFToolType ToolType { get; set; }
+        /// <summary>
+        /// 功能名称:拆分功能、合并功能、转档功能等
+        /// </summary>
+        public PDFFnType FnType { get; set; }
 
+        #region 显示内容
+
+        public string FnImg { get; set; }
+        public string FnInfo { get; set; }
+        public string FnName { get; set; }
+
+        #endregion
     }
 }

+ 79 - 0
PDF Office/Model/PageEdit/PageEditHistory.cs

@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace PDF_Office.Model.PageEdit
+{
+    public class PageEditHistory
+    {
+        /// <summary>
+        /// 操作类型
+        /// </summary>
+        public ActionType Type { get; set; }
+
+        /// <summary>
+        /// 原位置-新位置集合  用于倒序、旋转、拖拽排序
+        /// </summary>
+        public Dictionary<int, int> SourceTargetValue { get; set; }
+
+        /// <summary>
+        /// 插入位置
+        /// </summary>
+        public int InsertIndex { get; set; }
+
+        /// <summary>
+        ///插入文件的文件路径
+        /// </summary>
+        public string InsertFilePath { get; set; }
+
+        /// <summary>
+        /// 插入文件的密码
+        /// </summary>
+        public string InsertFilePassWord { get; set; }
+
+        /// <summary>
+        /// 插入文档的页面总数
+        /// </summary>
+        public int InsertPageCount { get; set; }
+
+        /// <summary>
+        /// 插入的页面尺寸大小
+        /// </summary>
+        public Size PageSize { get; set; }
+    }
+
+    /// <summary>
+    /// 操作类型
+    /// </summary>
+    public enum ActionType
+    {
+        /// <summary>
+        /// 页面右旋转
+        /// </summary>
+        RightRotate,
+        /// <summary>
+        /// 页面左旋转
+        /// </summary>
+        LeftRotate,
+        /// <summary>
+        /// 从文件插入
+        /// </summary>
+        InsertFromFile,
+        /// <summary>
+        /// 插入自定义页面
+        /// </summary>
+        InsertCustomPages,
+        /// <summary>
+        /// 拖拽排序
+        /// </summary>
+        DragSort,
+        /// <summary>
+        /// 倒序
+        /// </summary>
+        Reverse
+
+    }
+}

+ 1 - 0
PDF Office/Model/PageEdit/PageEditItem.cs

@@ -100,6 +100,7 @@ namespace PDF_Office.Model.PageEdit
         private bool selected = false; 
         /// <summary>
         /// 是否选中
+        /// 用于获取项的选中状态
         /// </summary>
         public bool Selected
         {

+ 18 - 0
PDF Office/Model/PageEdit/PageItemUnits.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.PageEdit
+{
+    /// <summary>
+    /// 页面编辑 页面宽高单位 mm cm in
+    /// </summary>
+    public enum PageItemUnits
+    {
+       MM,
+       CM,
+       IN
+    }
+}

+ 12 - 2
PDF Office/Model/ParameterNames.cs

@@ -12,12 +12,14 @@ namespace PDF_Office.Model
     public static class ParameterNames
     {
         #region ViewModelName
+
         public static string MainViewModel = "MainViewModel";
 
         public static string ViewContentViewModel = "ViewContentViewModel";
 
-        public static string PropertyPanelContentViewModel = "PropertyPanelContentViewModel";
-        #endregion
+        public static string PropertyPanelContentViewModel = "PropertyPanelContentViewModel";
+
+        #endregion ViewModelName
 
         public static string PDFViewer = "PDFViewer";
 
@@ -46,6 +48,14 @@ namespace PDF_Office.Model
 
         public static string BookmarkInfo = "BookmarkInfo";
 
+        /// <summary>
+        /// 注释列表
+        /// </summary>
+
+        public static string Annotation = "Annotation";
+        public static string AnnotEvent = "AnnotEvent";
+        public static string AnnotationList = "AnnotationList";
+
         /// <summary>
         /// 底部工具栏
         /// </summary>

+ 65 - 0
PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs

@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media;
+
+namespace PDF_Office.Model.PropertyPanel.AnnotPanel
+{
+    public class FontStyleItem
+    {
+        public string mFontStyleName { get; set; }
+        public int mFontSize { get; set; }
+        public FontFamily mFontFamily { get; set; }
+        public FontStyle mFontStyle { get; set; }
+        public FontWeight mFontWeight { get; set; }
+
+    }
+
+    public class LoadFontStyle
+    {
+        public static List<FontStyleItem> Load()
+        {
+            List<FontStyleItem> fontStyleList = new List<FontStyleItem>();
+            FontStyleItem custom = new FontStyleItem();
+            custom.mFontSize = 32;
+            custom.mFontStyleName = "自定义";
+
+            FontStyleItem h1 = new FontStyleItem();
+            h1.mFontSize = 24;
+            h1.mFontStyleName = "H1大标题";
+
+            FontStyleItem h2 = new FontStyleItem();
+            h2.mFontSize = 16;
+            h2.mFontStyleName = "h2(标准)";
+
+            FontStyleItem h3 = new FontStyleItem();
+            h3.mFontSize = 10;
+            h3.mFontStyleName = "H3小标题";
+
+            FontStyleItem b1 = new FontStyleItem();
+            b1.mFontSize = 8;
+            b1.mFontStyleName = "B1标题";
+
+            FontStyleItem b2 = new FontStyleItem();
+            b2.mFontSize = 6;
+            b2.mFontStyleName = "B2标题";
+
+            FontStyleItem b3 = new FontStyleItem();
+            b3.mFontSize = 4;
+            b3.mFontStyleName = "B3标题";
+
+            fontStyleList.Add(custom);
+            fontStyleList.Add(h1);
+            fontStyleList.Add(h2);
+            fontStyleList.Add(h3);
+            fontStyleList.Add(b1);
+            fontStyleList.Add(b2);
+            fontStyleList.Add(b3);
+
+            return fontStyleList;
+        }
+    }
+}

+ 31 - 0
PDF Office/Model/RegionNames.cs

@@ -39,6 +39,14 @@ namespace PDF_Office.Model
             }
         }
 
+        public static string ReadRegionName
+        {
+            get
+            {
+                return GetRegionName("ReadRegionName");
+            }
+        }
+
         /// <summary>
         /// 阅读页PDFViewer 对应的Content RegionName
         /// </summary>
@@ -58,6 +66,21 @@ namespace PDF_Office.Model
             }
         }
 
+        public static string BatesViewerRegionName
+        {
+            get
+            {
+                return GetRegionName("BatesViewerRegionName");
+            }
+        }
+        public static string HeaderFooterViewerRegionName
+        {
+            get
+            {
+                return GetRegionName("HeaderFooterViewerRegionName");
+            }
+        }
+
         public static string RedactionViewerRegionName
         {
             get
@@ -154,6 +177,14 @@ namespace PDF_Office.Model
             }
         }
 
+        public static string ReadModePageRegionName
+        {
+            get
+            {
+                return GetRegionName("ReadModePageRegionName");
+            }
+        }
+
         /// <summary>
         /// 获取MainWindowsViewModel RegionNames字典里的RegionName,
         /// 如果字典里没有键值就新建一个GUID,并插入到

+ 273 - 18
PDF Office/PDF Office.csproj

@@ -45,11 +45,11 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\ComOCRKit.Desk.dll</HintPath>
     </Reference>
-    <Reference Include="ComPDFKit.Desk, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
+    <Reference Include="ComPDFKit.Desk, Version=1.7.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\ComPDFKit.Desk.dll</HintPath>
     </Reference>
-    <Reference Include="ComPDFKit.Viewer, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
+    <Reference Include="ComPDFKit.Viewer, Version=1.7.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\ComPDFKit.Viewer.dll</HintPath>
     </Reference>
@@ -200,10 +200,21 @@
     <Compile Include="CustomControl\CommonWritableComboBox.xaml.cs">
       <DependentUpon>CommonWritableComboBox.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\CompositeControl\ColorSubContent.xaml.cs">
+      <DependentUpon>ColorSubContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="CustomControl\CompositeControl\SlidComboControl.xaml.cs">
+      <DependentUpon>SlidComboControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\CustomIconToggleBtn.cs" />
+    <Compile Include="CustomControl\CustomImageControl.cs" />
     <Compile Include="CustomControl\DialogContent.cs" />
+    <Compile Include="CustomControl\Form\FormFieldCombox.xaml.cs">
+      <DependentUpon>FormFieldCombox.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\IconAndTextTabItem.cs" />
     <Compile Include="CustomControl\ListBoxItemToolBar.cs" />
+    <Compile Include="CustomControl\MenuItemWithPath.cs" />
     <Compile Include="CustomControl\MessageBoxEx.cs" />
     <Compile Include="CustomControl\NumericUpDown.xaml.cs">
       <DependentUpon>NumericUpDown.xaml</DependentUpon>
@@ -214,37 +225,54 @@
     <Compile Include="CustomControl\PageTurningPreview.xaml.cs">
       <DependentUpon>PageTurningPreview.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\PathButton.cs" />
     <Compile Include="CustomControl\SystemControl\CustomCommandAction .cs" />
     <Compile Include="CustomControl\SystemControl\RoutedEventTrigger.cs" />
+    <Compile Include="CustomControl\TextBoxEx.cs" />
     <Compile Include="CustomControl\ToastControl.xaml.cs">
       <DependentUpon>ToastControl.xaml</DependentUpon>
     </Compile>
     <Compile Include="CustomControl\WritableComboBox.xaml.cs">
       <DependentUpon>WritableComboBox.xaml</DependentUpon>
     </Compile>
+    <Compile Include="DataConvert\AnnotateFontSizeConverter.cs" />
+    <Compile Include="DataConvert\BoolToTextWrapConvert.cs" />
+    <Compile Include="DataConvert\CreateTimeToDate.cs" />
     <Compile Include="DataConvert\FileFormatToIconConvert.cs" />
+    <Compile Include="DataConvert\GroupHeaderConverter.cs" />
+    <Compile Include="DataConvert\IntToBooleanConvert.cs" />
     <Compile Include="DataConvert\FileToImageSourceConvert.cs" />
+    <Compile Include="DataConvert\IntAndTagToBoolMultiBinding.cs" />
     <Compile Include="DataConvert\InvertBoolConvert.cs" />
     <Compile Include="DataConvert\ObjectConvert.cs" />
     <Compile Include="DataConvert\PropertyPanelVisible.cs" />
+    <Compile Include="DataConvert\StringToDateConvert.cs" />
     <Compile Include="DataConvert\StringToVisibleConvert.cs" />
     <Compile Include="DataConvert\UnVisivleConvert.cs" />
+    <Compile Include="DataConvert\WidthConvert.cs" />
     <Compile Include="EventAggregators\EditToolsEvent.cs" />
     <Compile Include="EventAggregators\PageEditNotifyEvent.cs" />
     <Compile Include="EventAggregators\PageEditRefreshEvent.cs" />
     <Compile Include="EventAggregators\SendPrintInfoEvent.cs" />
+    <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
+    <Compile Include="Helper\DpiHelpers.cs" />
     <Compile Include="Helper\EditToolsHelper.cs" />
     <Compile Include="Helper\AdvancedInvokeCommandAction.cs" />
     <Compile Include="Helper\ArrowHelper.cs" />
+    <Compile Include="Helper\DragDropHelper.cs" />
     <Compile Include="Helper\HomePageEditHelper.cs" />
     <Compile Include="Helper\ObservableDictionary.cs" />
     <Compile Include="Helper\PasswordBoxHelper.cs" />
+    <Compile Include="Helper\RichTextBoxHelper.cs" />
     <Compile Include="Helper\SDKLisenceHelper.cs" />
     <Compile Include="Helper\PictureConverter.cs" />
     <Compile Include="Helper\SetterAction.cs" />
     <Compile Include="Helper\SettingHelper.cs" />
     <Compile Include="Helper\ToolMethod.cs" />
+    <Compile Include="Model\BOTA\AnnotationHandlerEventArgs.cs" />
+    <Compile Include="Model\AnnotPanel\Stamp.cs" />
+    <Compile Include="Model\BOTA\OutlineNode.cs" />
     <Compile Include="Model\CloudDrive\CloudDriveItem.cs" />
     <Compile Include="Model\CloudDrive\CloudFiles.cs" />
     <Compile Include="Model\DialogNames.cs" />
@@ -284,14 +312,20 @@
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageSplitDialogModel.cs" />
     <Compile Include="Model\EditTools\Background\BackgroundCreateModel.cs" />
     <Compile Include="Model\EditTools\Background\BackgroundTemplateListModel.cs" />
+    <Compile Include="Model\EditTools\Bates\BatesCreateModel.cs" />
+    <Compile Include="Model\EditTools\HeaderFooter\HeaderFooterCreateModel.cs" />
     <Compile Include="Model\EditTools\Watermark\WatermarkCreateModel.cs" />
     <Compile Include="Model\EditTools\Watermark\WatermarkTemplateListModel.cs" />
+    <Compile Include="Model\From\FormFieldType.cs" />
     <Compile Include="Model\PageEdit\CustomInsertModel.cs" />
     <Compile Include="Model\PageEdit\CustomPageItem.cs" />
     <Compile Include="Model\PageEdit\ExtractModel.cs" />
+    <Compile Include="Model\PageEdit\PageEditHistory.cs" />
     <Compile Include="Model\PageEdit\PageEditItem.cs" />
+    <Compile Include="Model\PageEdit\PageItemUnits.cs" />
     <Compile Include="Model\ParameterNames.cs" />
     <Compile Include="Model\PDFTool\ToolItem.cs" />
+    <Compile Include="Model\PropertyPanel\AnnotPanel\FontStyleItem.cs" />
     <Compile Include="Model\RegionNames.cs" />
     <Compile Include="CustomControl\SystemControl\TabablzRegionBehavior.cs" />
     <Compile Include="DataConvert\BoolToVisible.cs" />
@@ -305,16 +339,21 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
-    <Compile Include="Settings.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDocumentContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterPaperSettingsDialogViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesCreateContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesDocumentContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesTemplateListContentViewModel.cs" />
+    <Compile Include="ViewModels\BOTA\AnnotationContentViewModel.cs" />
+    <Compile Include="ViewModels\BOTA\AnnotationListItemViewModel.cs" />
     <Compile Include="ViewModels\BOTA\BookmarkContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\BOTA\AddAnnotationDialogViewModel.cs" />
+    <Compile Include="ViewModels\BOTA\OutLineControlViewModel.cs" />
+    <Compile Include="ViewModels\BOTA\SearchContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\AddBookmarkDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\BookmarkInfoDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\BOTA\ScreenAnnotationDialogViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Background\BackgroundContentViewModel.cs" />
     <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
@@ -345,7 +384,15 @@
     <Compile Include="ViewModels\EditTools\HeaderFooter\HeaderFooterTemplateListContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Redaction\RedactionContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Redaction\RedactionDocumentContentViewModel.cs" />
+    <Compile Include="ViewModels\Form\FormsToolContentViewModel.cs" />
+    <Compile Include="ViewModels\HomePanel\PDFTools\PDFToolsContentViewModel.cs" />
+    <Compile Include="ViewModels\HomePanel\PDFTools\QuickToolsContentViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureAnnotPropertyViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\ViewModular\ReadViewContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\RecentFiles\RecentFilesContentViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\CustomCreateDialogViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\DynamicPropertyDialogViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\TextEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\Tools\ConverterBarContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
@@ -393,7 +440,6 @@
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SharpsAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\StampAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\TextAnnotPropertyViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\TextEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PropertyPanelContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\ReadModeContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\SplitScreenContentViewModel.cs" />
@@ -402,6 +448,7 @@
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Function.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Properties.cs" />
+    <Compile Include="ViewModels\Tools\TextEditToolContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\ToolsBarContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkCreateBaseContentViewModel.cs" />
@@ -410,6 +457,12 @@
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListBaseContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListFileContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListTextContentViewModel.cs" />
+    <Compile Include="Views\BOTA\AnnotationContent.xaml.cs">
+      <DependentUpon>AnnotationContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\BOTA\AnnotationListItem.xaml.cs">
+      <DependentUpon>AnnotationListItem.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\BOTA\BookmarkContent.xaml.cs">
       <DependentUpon>BookmarkContent.xaml</DependentUpon>
     </Compile>
@@ -417,9 +470,21 @@
     <Compile Include="Views\BOTA\BOTAContent.xaml.cs">
       <DependentUpon>BOTAContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\BOTA\OutLineControl.xaml.cs">
+      <DependentUpon>OutLineControl.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\BOTA\SearchContent.xaml.cs">
+      <DependentUpon>SearchContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\BottomToolContent.xaml.cs">
       <DependentUpon>BottomToolContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\BOTA\AddAnnotationDialog.xaml.cs">
+      <DependentUpon>AddAnnotationDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\BOTA\ScreenAnnotationDialog.xaml.cs">
+      <DependentUpon>ScreenAnnotationDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\ConverterDialogs\ConverterCSVDialog.xaml.cs">
       <DependentUpon>ConverterCSVDialog.xaml</DependentUpon>
     </Compile>
@@ -582,6 +647,31 @@
     <Compile Include="Views\FillAndSign\PropertyPanel\TextFillProperty.xaml.cs">
       <DependentUpon>TextFillProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Form\ButtonProperty.xaml.cs">
+      <DependentUpon>ButtonProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\CheckBoxProperty.xaml.cs">
+      <DependentUpon>CheckBoxProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\ComboxProperty.xaml.cs">
+      <DependentUpon>ComboxProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\FormsToolContent.xaml.cs">
+      <DependentUpon>FormsToolContent.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Views\Form\ListBoxProperty.xaml.cs">
+      <DependentUpon>ListBoxProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\RadioButtonProperty.xaml.cs">
+      <DependentUpon>RadioButtonProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\SignProperty.xaml.cs">
+      <DependentUpon>SignProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\TextFieldProperty.xaml.cs">
+      <DependentUpon>TextFieldProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\CloudDrive\CloudDriveContent.xaml.cs">
       <DependentUpon>CloudDriveContent.xaml</DependentUpon>
     </Compile>
@@ -642,6 +732,9 @@
     <Compile Include="Views\HomePanel\HomeGuidContent.xaml.cs">
       <DependentUpon>HomeGuidContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\HomePanel\PDFTools\PDFToolExpendItem.xaml.cs">
+      <DependentUpon>PDFToolExpendItem.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\PDFTools\PDFToolItem.xaml.cs">
       <DependentUpon>PDFToolItem.xaml</DependentUpon>
     </Compile>
@@ -679,6 +772,12 @@
     <Compile Include="CustomControl\CompositeControl\SlidContentPop.xaml.cs">
       <DependentUpon>SlidContentPop.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\AnnotPanel\CustomCreateDialog.xaml.cs">
+      <DependentUpon>CustomCreateDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\PropertyPanel\AnnotPanel\DynamicPropertyDialog.xaml.cs">
+      <DependentUpon>DynamicPropertyDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\FreehandAnnotProperty.xaml.cs">
       <DependentUpon>FreehandAnnotProperty.xaml</DependentUpon>
     </Compile>
@@ -694,24 +793,30 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml.cs">
       <DependentUpon>SharpsAnnotProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\AnnotPanel\SignatureAnnotProperty.xaml.cs">
+      <DependentUpon>SignatureAnnotProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\StampAnnotProperty.xaml.cs">
       <DependentUpon>StampAnnotProperty.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\TextAnnotProperty.xaml.cs">
       <DependentUpon>TextAnnotProperty.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\TextEditProperty.xaml.cs">
-      <DependentUpon>TextEditProperty.xaml</DependentUpon>
-    </Compile>
     <Compile Include="CustomControl\CompositeControl\SlidContent.xaml.cs">
       <DependentUpon>SlidContent.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\PropertyPanel\PropertyPanelContent.xaml.cs">
       <DependentUpon>PropertyPanelContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\TextEditProperty.xaml.cs">
+      <DependentUpon>TextEditProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml.cs">
       <DependentUpon>ReadModeContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\ViewModular\ReadViewContent.xaml.cs">
+      <DependentUpon>ReadViewContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\ViewModular\SplitScreenContent.xaml.cs">
       <DependentUpon>SplitScreenContent.xaml</DependentUpon>
     </Compile>
@@ -727,6 +832,9 @@
     <Compile Include="Views\Tools\ConverterBarContent.xaml.cs">
       <DependentUpon>ConverterBarContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Tools\TextEditToolContent.xaml.cs">
+      <DependentUpon>TextEditToolContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Tools\ToolsBarContent.xaml.cs">
       <DependentUpon>ToolsBarContent.xaml</DependentUpon>
     </Compile>
@@ -749,6 +857,18 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="CustomControl\CompositeControl\ColorSubContent.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="CustomControl\CompositeControl\SlidComboControl.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="CustomControl\Form\FormFieldCombox.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="CustomControl\LoadingControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -789,6 +909,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\ContextMenuStyle.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Styles\ContextMenuTextEditStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\CustomBtnStyle.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -813,6 +941,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\OutLineItemStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Styles\PathButtonStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\RadioButtonStyle.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -845,6 +981,14 @@
       <SubType>Designer</SubType>
       <Generator>XamlIntelliSenseFileGenerator</Generator>
     </Page>
+    <Page Include="Views\BOTA\AnnotationContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\BOTA\AnnotationListItem.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\BOTA\BookmarkContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -853,10 +997,26 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\BOTA\OutLineControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\BOTA\SearchContent.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\BottomToolContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\BOTA\AddAnnotationDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\BOTA\ScreenAnnotationDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\ConverterDialogs\ConverterCSVDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1009,6 +1169,38 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Form\ButtonProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\CheckBoxProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\ComboxProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\FormsToolContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>XamlIntelliSenseFileGenerator</Generator>
+    </Page>
+    <Page Include="Views\Form\ListBoxProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\RadioButtonProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\SignProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Form\TextFieldProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\HomeContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1080,6 +1272,18 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\HomePanel\PDFTools\PDFToolExpendItem.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\PropertyPanel\AnnotPanel\CustomCreateDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\PropertyPanel\AnnotPanel\DynamicPropertyDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\FreehandAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1124,6 +1328,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\AnnotPanel\SignatureAnnotProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\StampAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1144,10 +1352,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\TextEditProperty.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="Views\EditTools\Watermark\WatermarkDocumentContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1174,10 +1378,18 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\TextEditProperty.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\ViewModular\ReadViewContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\ViewModular\SplitScreenContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1284,6 +1496,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Tools\TextEditToolContent.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\Tools\ToolsBarContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1311,6 +1527,24 @@
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     </None>
     <None Include="source\AnalysisWord\Res\word\_rels\document.xml.rels" />
+    <Resource Include="Resources\BOTA\Annotation\Arrow.png" />
+    <Resource Include="Resources\BOTA\Annotation\Bookmark.png" />
+    <Resource Include="Resources\BOTA\Annotation\Circle.png" />
+    <Resource Include="Resources\BOTA\Annotation\Freehande.png" />
+    <Resource Include="Resources\BOTA\Annotation\Freehande2.png" />
+    <Resource Include="Resources\BOTA\Annotation\Hand.png" />
+    <Resource Include="Resources\BOTA\Annotation\Highlight.png" />
+    <Resource Include="Resources\BOTA\Annotation\Hyperlink.png" />
+    <Resource Include="Resources\BOTA\Annotation\Image.png" />
+    <Resource Include="Resources\BOTA\Annotation\Line.png" />
+    <Resource Include="Resources\BOTA\Annotation\Note.png" />
+    <Resource Include="Resources\BOTA\Annotation\Point.png" />
+    <Resource Include="Resources\BOTA\Annotation\Rectangle.png" />
+    <Resource Include="Resources\BOTA\Annotation\Selecttool.png" />
+    <Resource Include="Resources\BOTA\Annotation\Stamp.png" />
+    <Resource Include="Resources\BOTA\Annotation\Textbox.png" />
+    <Resource Include="Resources\BOTA\Annotation\wavyline2.png" />
+    <Resource Include="Resources\BOTA\empty_annotation.png" />
     <Resource Include="Resources\HomeIcon\PDFTools\background.png" />
     <Resource Include="Resources\HomeIcon\PDFTools\batch-remove.png" />
     <Resource Include="Resources\HomeIcon\PDFTools\batch.png" />
@@ -1335,15 +1569,37 @@
     <Resource Include="Resources\HomeIcon\PDFTools\security.png" />
     <Resource Include="Resources\HomeIcon\PDFTools\split.png" />
     <Resource Include="Resources\HomeIcon\PDFTools\watermark.png" />
-    <Resource Include="Resources\PageEdit\GridLine.png">
+    <Resource Include="Resources\StampIcons\Accepted.png" />
+    <Resource Include="Resources\StampIcons\Approved.png" />
+    <Resource Include="Resources\StampIcons\Completed.png" />
+    <Resource Include="Resources\StampIcons\Confidential.png" />
+    <Resource Include="Resources\StampIcons\Draft.png" />
+    <Resource Include="Resources\StampIcons\Empty_stamp.png" />
+    <Resource Include="Resources\StampIcons\Final.png" />
+    <Resource Include="Resources\StampIcons\ForComment.png" />
+    <Resource Include="Resources\StampIcons\ForPublicRelease.png" />
+    <Resource Include="Resources\StampIcons\InformationOnly.png" />
+    <Resource Include="Resources\StampIcons\InitialHere.png" />
+    <Resource Include="Resources\StampIcons\NotApproved.png" />
+    <Resource Include="Resources\StampIcons\NotForPublicRelease.png" />
+    <Resource Include="Resources\StampIcons\PreliminaryResults.png" />
+    <Resource Include="Resources\StampIcons\PrivateMark1.png" />
+    <Resource Include="Resources\StampIcons\PrivateMark2.png" />
+    <Resource Include="Resources\StampIcons\PrivateMark3.png" />
+    <Resource Include="Resources\StampIcons\Rejected.png" />
+    <Resource Include="Resources\StampIcons\revised.png" />
+    <Resource Include="Resources\StampIcons\SignHere.png" />
+    <Resource Include="Resources\StampIcons\Void.png" />
+    <Resource Include="Resources\StampIcons\Witness.png" />
+    <Content Include="Resources\PageEdit\GridLine.jpg">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Resource>
-    <Resource Include="Resources\PageEdit\HorizontalLine.png">
+    </Content>
+    <Content Include="Resources\PageEdit\HorizontalLine.jpg">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Resource>
-    <Resource Include="Resources\PageEdit\Staff.png">
+    </Content>
+    <Content Include="Resources\PageEdit\Staff.jpg">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Resource>
+    </Content>
     <Resource Include="Resources\EditTools\watermark_bg.png" />
     <Content Include="source\AnalysisWord\Res\_rels\.rels">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
@@ -1354,7 +1610,6 @@
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Views\Edit\" />
-    <Folder Include="Views\Forms\" />
     <Folder Include="Views\Scan\" />
   </ItemGroup>
   <ItemGroup>

+ 72 - 2
PDF Office/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace PDF_Office.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -22,7 +22,20 @@ namespace PDF_Office.Properties {
                 return defaultInstance;
             }
         }
-        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("10")]
+        public double AnnotateFontSize
+        {
+            get
+            {
+                return ((double)(this["AnnotateFontSize"]));
+            }
+            set
+            {
+                this["AnnotateFontSize"] = value;
+            }
+        }
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         public global::PDFSettings.Settings.RecentOpenFiles RecentOpenFiles {
@@ -123,5 +136,62 @@ namespace PDF_Office.Properties {
                 this["WatermarkIndex"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::PDFSettings.BatesTemplateList BatesTemplateList {
+            get {
+                return ((global::PDFSettings.BatesTemplateList)(this["BatesTemplateList"]));
+            }
+            set {
+                this["BatesTemplateList"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        public int BatesIndex {
+            get {
+                return ((int)(this["BatesIndex"]));
+            }
+            set {
+                this["BatesIndex"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::PDFSettings.HeaderFooterTemplateList HeaderFooterTemplateList {
+            get {
+                return ((global::PDFSettings.HeaderFooterTemplateList)(this["HeaderFooterTemplateList"]));
+            }
+            set {
+                this["HeaderFooterTemplateList"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        public int HeaderFooterIndex {
+            get {
+                return ((int)(this["HeaderFooterIndex"]));
+            }
+            set {
+                this["HeaderFooterIndex"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::PDFSettings.CustomStampList CustomStampList {
+            get {
+                return ((global::PDFSettings.CustomStampList)(this["CustomStampList"]));
+            }
+            set {
+                this["CustomStampList"] = value;
+            }
+        }
     }
 }

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

@@ -29,5 +29,20 @@
     <Setting Name="WatermarkIndex" Type="System.Int32" Scope="User">
       <Value Profile="(Default)">0</Value>
     </Setting>
+    <Setting Name="BatesTemplateList" Type="PDFSettings.BatesTemplateList" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="BatesIndex" Type="System.Int32" Scope="User">
+      <Value Profile="(Default)">0</Value>
+    </Setting>
+    <Setting Name="HeaderFooterTemplateList" Type="PDFSettings.HeaderFooterTemplateList" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="HeaderFooterIndex" Type="System.Int32" Scope="User">
+      <Value Profile="(Default)">0</Value>
+    </Setting>
+    <Setting Name="CustomStampList" Type="PDFSettings.CustomStampList" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
   </Settings>
 </SettingsFile>

BIN
PDF Office/Resources/BOTA/Annotation/Arrow.png


BIN
PDF Office/Resources/BOTA/Annotation/Bookmark.png


BIN
PDF Office/Resources/BOTA/Annotation/Circle.png


BIN
PDF Office/Resources/BOTA/Annotation/Freehande.png


BIN
PDF Office/Resources/BOTA/Annotation/Freehande2.png


BIN
PDF Office/Resources/BOTA/Annotation/Hand.png


BIN
PDF Office/Resources/BOTA/Annotation/Highlight.png


BIN
PDF Office/Resources/BOTA/Annotation/Hyperlink.png


BIN
PDF Office/Resources/BOTA/Annotation/Image.png


BIN
PDF Office/Resources/BOTA/Annotation/Line.png


BIN
PDF Office/Resources/BOTA/Annotation/Note.png


BIN
PDF Office/Resources/BOTA/Annotation/Point.png


BIN
PDF Office/Resources/BOTA/Annotation/Rectangle.png


BIN
PDF Office/Resources/BOTA/Annotation/Selecttool.png


BIN
PDF Office/Resources/BOTA/Annotation/Stamp.png


BIN
PDF Office/Resources/BOTA/Annotation/Textbox.png


BIN
PDF Office/Resources/BOTA/Annotation/wavyline2.png


BIN
PDF Office/Resources/BOTA/empty_annotation.png


PDF Office/Resources/PageEdit/GridLine.png → PDF Office/Resources/PageEdit/GridLine.jpg


PDF Office/Resources/PageEdit/HorizontalLine.png → PDF Office/Resources/PageEdit/HorizontalLine.jpg


PDF Office/Resources/PageEdit/Staff.png → PDF Office/Resources/PageEdit/Staff.jpg


BIN
PDF Office/Resources/StampIcons/Accepted.png


BIN
PDF Office/Resources/StampIcons/Approved.png


BIN
PDF Office/Resources/StampIcons/Completed.png


BIN
PDF Office/Resources/StampIcons/Confidential.png


BIN
PDF Office/Resources/StampIcons/Draft.png


BIN
PDF Office/Resources/StampIcons/Empty_stamp.png


BIN
PDF Office/Resources/StampIcons/Final.png


BIN
PDF Office/Resources/StampIcons/ForComment.png


BIN
PDF Office/Resources/StampIcons/ForPublicRelease.png


BIN
PDF Office/Resources/StampIcons/InformationOnly.png


BIN
PDF Office/Resources/StampIcons/InitialHere.png


BIN
PDF Office/Resources/StampIcons/NotApproved.png


BIN
PDF Office/Resources/StampIcons/NotForPublicRelease.png


BIN
PDF Office/Resources/StampIcons/PreliminaryResults.png


BIN
PDF Office/Resources/StampIcons/PrivateMark1.png


BIN
PDF Office/Resources/StampIcons/PrivateMark2.png


BIN
PDF Office/Resources/StampIcons/PrivateMark3.png


BIN
PDF Office/Resources/StampIcons/Rejected.png


BIN
PDF Office/Resources/StampIcons/SignHere.png


BIN
PDF Office/Resources/StampIcons/Void.png


BIN
PDF Office/Resources/StampIcons/Witness.png


BIN
PDF Office/Resources/StampIcons/revised.png


+ 0 - 0
PDF Office/SDKLisence.xml


Some files were not shown because too many files changed in this diff