Browse Source

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

lvle 2 years ago
parent
commit
74aded9440
100 changed files with 6961 additions and 757 deletions
  1. 2 2
      PDF Office/App.xaml
  2. 28 0
      PDF Office/App.xaml.cs
  3. BIN
      PDF Office/ComDocumentAIKit.dll
  4. 258 0
      PDF Office/ComPDFKit.Viewer.csproj
  5. BIN
      PDF Office/ComPDFKit.Viewer.dll
  6. BIN
      PDF Office/ComPDFKit_Conversion.dll
  7. 41 3
      PDF Office/CustomControl/CompositeControl/ColorContent.xaml.cs
  8. 116 0
      PDF Office/CustomControl/CompositeControl/ColorMenuItem.xaml
  9. 72 0
      PDF Office/CustomControl/CompositeControl/ColorMenuItem.xaml.cs
  10. 7 4
      PDF Office/CustomControl/WritableComboBox.xaml
  11. 5 1
      PDF Office/CustomControl/WritableComboBox.xaml.cs
  12. 27 0
      PDF Office/DataConvert/ListCountToVisible.cs.cs
  13. 52 0
      PDF Office/DataConvert/TextAlignToCheckedConverter.cs
  14. 78 50
      PDF Office/Helper/ConverterHelper.cs
  15. 114 0
      PDF Office/Helper/CropPageUndoManager.cs
  16. 1 1
      PDF Office/Helper/SecurityHelper.cs
  17. 77 0
      PDF Office/Helper/ServiceHelper.cs
  18. 29 2
      PDF Office/Helper/SettingHelper.cs
  19. 110 20
      PDF Office/Model/AnnotPanel/AnnotCommon.cs
  20. 6 5
      PDF Office/Model/AnnotPanel/FontBoard.cs
  21. 2 1
      PDF Office/Model/BOTA/AnnotationHandlerEventArgs.cs
  22. 6 1
      PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs
  23. 5 0
      PDF Office/Model/DialogNames.cs
  24. 3 0
      PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs
  25. 61 1
      PDF Office/Model/SettingsDialog/AnnotateModel.cs
  26. 369 0
      PDF Office/MultilingualResources/PDF Office.en.xlf
  27. 369 0
      PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf
  28. 369 0
      PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf
  29. 76 3
      PDF Office/PDF Office.csproj
  30. 1 0
      PDF Office/Properties/AssemblyInfo.cs
  31. 12 1
      PDF Office/Properties/Settings.Designer.cs
  32. 3 0
      PDF Office/Properties/Settings.settings
  33. BIN
      PDF Office/Resources/Dialog/helphover.png
  34. 63 0
      PDF Office/Strings/HomePage/HomePage.Designer.cs
  35. 15 0
      PDF Office/Strings/HomePage/HomePage.en.resx
  36. 120 0
      PDF Office/Strings/HomePage/HomePage.resx
  37. 15 0
      PDF Office/Strings/HomePage/HomePage.zh-Hans.resx
  38. 15 0
      PDF Office/Strings/HomePage/HomePage.zh-Hant.resx
  39. 695 0
      PDF Office/Strings/MainPage/MainPage.Designer.cs
  40. 15 0
      PDF Office/Strings/MainPage/MainPage.en.resx
  41. 343 0
      PDF Office/Strings/MainPage/MainPage.resx
  42. 15 0
      PDF Office/Strings/MainPage/MainPage.zh-Hans.resx
  43. 15 0
      PDF Office/Strings/MainPage/MainPage.zh-Hant.resx
  44. 63 0
      PDF Office/Strings/Service/Service.Designer.cs
  45. 15 0
      PDF Office/Strings/Service/Service.en.resx
  46. 101 0
      PDF Office/Strings/Service/Service.resx
  47. 15 0
      PDF Office/Strings/Service/Service.zh-Hans.resx
  48. 15 0
      PDF Office/Strings/Service/Service.zh-Hant.resx
  49. 51 24
      PDF Office/Styles/ContextMenuStyle.xaml
  50. 54 0
      PDF Office/Styles/RadioButtonStyle.xaml
  51. 4 3
      PDF Office/Styles/WindowsStyle.xaml
  52. 120 19
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  53. 14 0
      PDF Office/ViewModels/BOTA/SearchContentViewModel.cs
  54. 46 5
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs
  55. 27 4
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  56. 30 6
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  57. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs
  58. 27 4
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  59. 27 4
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  60. 27 4
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  61. 27 4
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  62. 271 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/CreateFromScannerDialogsViewModel.cs
  63. 3 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs
  64. 34 19
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs
  65. 34 34
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SignatureCreateDialogViewModel.cs
  66. 22 7
      PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs
  67. 6 2
      PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogViewModel.cs
  68. 56 1
      PDF Office/ViewModels/HomeContentViewModel.cs
  69. 16 5
      PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs
  70. 70 0
      PDF Office/ViewModels/HomePanel/RecentFiles/RecentFilesContentViewModel.cs
  71. 62 1
      PDF Office/ViewModels/MainContentViewModel.cs
  72. 39 11
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  73. 20 3
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs
  74. 52 21
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs
  75. 145 77
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs
  76. 17 4
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs
  77. 1 1
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs
  78. 2 1
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs
  79. 13 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs
  80. 0 1
      PDF Office/ViewModels/TipContent/FileRestrictedTipViewModel.cs
  81. 347 161
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  82. 477 82
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  83. 182 54
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs
  84. 12 4
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  85. 50 6
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  86. 82 22
      PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs
  87. 259 18
      PDF Office/ViewModels/ViewContentViewModel.cs
  88. 2 2
      PDF Office/Views/BOTA/AnnotationContent.xaml
  89. 13 1
      PDF Office/Views/BOTA/AnnotationContent.xaml.cs
  90. 9 1
      PDF Office/Views/BOTA/AnnotationListItem.xaml
  91. 69 0
      PDF Office/Views/BOTA/AnnotationListItem.xaml.cs
  92. 1 1
      PDF Office/Views/BOTA/BookmarkContent.xaml
  93. 29 2
      PDF Office/Views/BOTA/BookmarkContent.xaml.cs
  94. 17 19
      PDF Office/Views/BOTA/OutLineControl.xaml
  95. 34 10
      PDF Office/Views/BOTA/OutLineControl.xaml.cs
  96. 9 9
      PDF Office/Views/BOTA/SearchContent.xaml.cs
  97. 4 2
      PDF Office/Views/Dialog/BOTA/ScreenAnnotationDialog.xaml
  98. 200 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/CreateFromScannerDialogs.xaml
  99. 28 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/CreateFromScannerDialogs.xaml.cs
  100. 0 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml

+ 2 - 2
PDF Office/App.xaml

@@ -696,8 +696,7 @@
                         Style="{StaticResource ComboBoxToggleButton}" />
                     <Border
                         x:Name="border"
-                        Margin="4 1 8 1"
-                        HorizontalAlignment="Left"
+                        Margin="3 1 8 1"
                         Background="{StaticResource TextBox.Static.Background}">
                         <TextBox
                             x:Name="PART_EditableTextBox"
@@ -753,6 +752,7 @@
                 <Style.Triggers>
                     <Trigger Property="IsEditable" Value="true">
                         <Setter Property="IsTabStop" Value="false" />
+                        <Setter Property="Padding" Value="2 3 5 3"/>
                         <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
                     </Trigger>
                 </Style.Triggers>

+ 28 - 0
PDF Office/App.xaml.cs

@@ -58,6 +58,9 @@ using PDF_Office.Views.Scan;
 using PDF_Office.Views.TipContent;
 using System.Windows.Threading;
 using PDF_Office.Views.Dialog.ServiceDialog;
+using System.Diagnostics;
+using System.Resources;
+using System.Reflection;
 
 namespace PDF_Office
 {
@@ -68,6 +71,15 @@ namespace PDF_Office
     {
         public static string CurrentPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "PDF Office");
 
+        /// <summary>
+        /// 产品名称
+        /// </summary>
+        public static string Name = "PDF Office";
+        /// <summary>
+        /// 当前app版本号
+        /// </summary>
+        public static string Version = FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule.FileName).ProductVersion;
+
         public static MainWindowViewModel mainWindowViewModel;
 
         /// <summary>
@@ -89,6 +101,21 @@ namespace PDF_Office
         //app第一次启动时需要弹出注册弹窗
         public static bool IsShowRegist = false;
 
+        /// <summary>
+        /// 文案资源管理器  首页
+        /// </summary>
+        public static ResourceManager HomePageLoader = new ResourceManager("PDF_Office.Strings.HomePage.HomePage", Assembly.GetExecutingAssembly());
+
+        /// <summary>
+        /// 文案资源管理器  阅读页
+        /// </summary>
+        public static ResourceManager MainPageLoader = new ResourceManager("PDF_Office.Strings.MainPage.MainPage", Assembly.GetExecutingAssembly());
+
+        /// <summary>
+        /// 文案资源管理器  注册相关
+        /// </summary>
+        public static ResourceManager ServiceLoader = new ResourceManager("PDF_Office.Strings.Service.Service", Assembly.GetExecutingAssembly());
+
         public App()
         {
 #if !DEBUG
@@ -375,6 +402,7 @@ namespace PDF_Office
 
             containerRegistry.RegisterDialog<EditPresetColorsDialog>(DialogNames.EditPresetColorsDialog);
             containerRegistry.RegisterDialog<CreateFromHtmlDialog>(DialogNames.CreateFromHtmlDialog);
+            containerRegistry.RegisterDialog<CreateFromScannerDialogs>(DialogNames.CreateFromScannerDialogs);
             //标记密文弹窗
             containerRegistry.RegisterDialog<MarkSettingDialog>(DialogNames.MarkSettingDialog);
             containerRegistry.RegisterDialog<PageMarkDialog>(DialogNames.PageMarkDialog);

BIN
PDF Office/ComDocumentAIKit.dll


+ 258 - 0
PDF Office/ComPDFKit.Viewer.csproj

@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{18EC356D-8130-49D4-B4E6-AC290E1065B7}</ProjectGuid>
+    <OutputType>library</OutputType>
+    <RootNamespace>ComPDFKitViewer</RootNamespace>
+    <AssemblyName>ComPDFKit.Viewer</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <Deterministic>true</Deterministic>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;PDF_OFFICE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+    <DocumentationFile>bin\Release\ComPDFKit.Viewer.xml</DocumentationFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xaml">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase" />
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AnnotEdit\AreaSelectTool.cs" />
+    <Compile Include="AnnotEdit\CircleCreate.cs" />
+    <Compile Include="AnnotEdit\EraseCreate.cs" />
+    <Compile Include="AnnotEdit\FreehandCreate.cs" />
+    <Compile Include="AnnotEdit\FreeTextCreate.cs" />
+    <Compile Include="AnnotEdit\ImageEditTool.cs" />
+    <Compile Include="AnnotEdit\LineCreate.cs" />
+    <Compile Include="AnnotEdit\LinkAnnotCreate.cs" />
+    <Compile Include="AnnotEdit\RedactionCreate.cs" />
+    <Compile Include="AnnotEdit\RedactionEraseCreate.cs" />
+    <Compile Include="AnnotEdit\SelectAnnotTool.cs" />
+    <Compile Include="AnnotEdit\SelectEditTool.cs" />
+    <Compile Include="AnnotEdit\SelectTool.cs" />
+    <Compile Include="AnnotEdit\SimpleShapeCreate.cs" />
+    <Compile Include="AnnotEdit\SnapshotTool.cs" />
+    <Compile Include="AnnotEdit\SnapshotWithEditTool.cs" />
+    <Compile Include="AnnotEdit\SoundCreate.cs" />
+    <Compile Include="AnnotEdit\SquareCreate.cs" />
+    <Compile Include="AnnotEdit\StampCreate.cs" />
+    <Compile Include="AnnotEdit\StickyNoteCreate.cs" />
+    <Compile Include="AnnotEdit\TextEditManager.cs" />
+    <Compile Include="AnnotEdit\TextEditTool.cs" />
+    <Compile Include="AnnotEdit\TextHighlightCreate.cs" />
+    <Compile Include="AnnotEdit\TextSquigglyCreate.cs" />
+    <Compile Include="AnnotEdit\TextStrikeoutCreate.cs" />
+    <Compile Include="AnnotEdit\TextUnderlineCreate.cs" />
+    <Compile Include="AnnotEdit\Tool.cs" />
+    <Compile Include="AnnotEdit\ToolManager.cs" />
+    <Compile Include="AnnotEdit\UndoHistoryItem.cs" />
+    <Compile Include="AnnotEdit\UndoManager.cs" />
+    <Compile Include="AnnotEdit\UndoManager.Internal.cs" />
+    <Compile Include="AnnotEdit\WidgetCreate.cs" />
+    <Compile Include="AnnotEdit\WidgetCreate.Function.cs" />
+    <Compile Include="AnnotEvent\AnnotCommandArgs.cs" />
+    <Compile Include="AnnotEvent\CircleAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\EraseArgs.cs" />
+    <Compile Include="AnnotEvent\FreehandAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\FreeTextAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\LineAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\LinkAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\RedactionAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\RedactionEraseArgs.cs" />
+    <Compile Include="AnnotEvent\SelectAnnotToolArgs.cs" />
+    <Compile Include="AnnotEvent\SnapshotCommandArgs.cs" />
+    <Compile Include="AnnotEvent\SnapshotEditToolArgs.cs" />
+    <Compile Include="AnnotEvent\SnapshotToolArgs.cs" />
+    <Compile Include="AnnotEvent\SoundAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\SquareAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\StampAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\StickyAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\TextHighlightAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\TextSquigglyAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\TextStrikeoutAnnotArgs.cs" />
+    <Compile Include="AnnotEvent\TextUnderlineAnnotArgs.cs" />
+    <Compile Include="AnnotEdit\AnnotToolManager.cs" />
+    <Compile Include="AnnotEvent\WidgetViewCommandArgs.cs" />
+    <Compile Include="AnnotView\AnnotAttrib.cs" />
+    <Compile Include="AnnotView\AnnotHoverData.cs" />
+    <Compile Include="AnnotView\AnnotVisualText.cs" />
+    <Compile Include="AnnotView\CommonDrawData.cs" />
+    <Compile Include="AnnotView\CustomTextSource.cs" />
+    <Compile Include="AnnotView\Form\WidgetArgs.cs" />
+    <Compile Include="AnnotView\Form\WidgetCheckBoxArgs.cs" />
+    <Compile Include="AnnotView\Form\WidgetComboBoxArgs.cs" />
+    <Compile Include="AnnotView\Form\WidgetListBoxArgs.cs" />
+    <Compile Include="AnnotView\Form\WidgetPushButtonArgs.cs" />
+    <Compile Include="AnnotView\Form\WidgetRadioButtonArgs.cs" />
+    <Compile Include="AnnotView\Form\WidgetSignArgs.cs" />
+    <Compile Include="AnnotView\Form\WidgetTextBoxArgs.cs" />
+    <Compile Include="AnnotView\Form\WidgetView.Function.cs" />
+    <Compile Include="AnnotView\Form\WidgetView.Internal.cs" />
+    <Compile Include="AnnotView\LinkAnnotView.cs" />
+    <Compile Include="AnnotView\MovieAnnotView.cs" />
+    <Compile Include="AnnotView\MultiActiveVisual.cs" />
+    <Compile Include="AnnotView\RedactionAnnot.cs" />
+    <Compile Include="AnnotView\SoundAnnotView.cs" />
+    <Compile Include="AnnotView\StickyPopupControl.xaml.cs">
+      <DependentUpon>StickyPopupControl.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="AnnotView\StickyPopupExt.cs" />
+    <Compile Include="Arrow\ArrowHelper.cs" />
+    <Compile Include="PdfViewer\AdornerDrawing.cs" />
+    <Compile Include="PdfViewer\OrderList.cs" />
+    <Compile Include="PdfViewer\PageImageItem.cs" />
+    <Compile Include="PdfViewer\PagesViewer.Data.cs" />
+    <Compile Include="PdfViewer\PagesViewer.Event.cs" />
+    <Compile Include="PdfViewer\PagesViewer.Internal.cs" />
+    <Compile Include="TextEdit\BaseEditVisual.cs" />
+    <Compile Include="TextEdit\BaseEditVisual.Data.cs" />
+    <Compile Include="TextEdit\BaseEditVisual.Draw.cs" />
+    <Compile Include="TextEdit\CaretVisual.cs" />
+    <Compile Include="AnnotView\FontRendering.cs" />
+    <Compile Include="AnnotView\Form\WidgetView.cs" />
+    <Compile Include="AnnotView\FreehandAnnot.cs" />
+    <Compile Include="AnnotView\FreeTextAnnot.cs" />
+    <Compile Include="AnnotView\GenericTextProperties.cs" />
+    <Compile Include="AnnotView\StickyPopWindow.cs" />
+    <Compile Include="AnnotView\StampAnnot.cs" />
+    <Compile Include="AnnotView\StickyNoteAnnot.cs" />
+    <Compile Include="AnnotView\TextHightlightAnnot.cs" />
+    <Compile Include="AnnotView\TextSquigglyAnnot.cs" />
+    <Compile Include="AnnotView\TextStrikeoutAnnot.cs" />
+    <Compile Include="AnnotView\TextUnderlineAnnot.cs" />
+    <Compile Include="CPDFWrapper.cs" />
+    <Compile Include="AnnotEvent\AnnotHandlerEventArgs.cs" />
+    <Compile Include="AnnotView\AnnotVisualRect.cs" />
+    <Compile Include="AnnotView\CircleAnnotVisual.cs" />
+    <Compile Include="PdfViewer\AdornerContentPresenter.cs" />
+    <Compile Include="PdfViewer\CommandArgs.cs" />
+    <Compile Include="PdfViewer\Helpers.cs" />
+    <Compile Include="AnnotView\LineAnnotVisual.cs" />
+    <Compile Include="PdfViewer\PageElement.cs" />
+    <Compile Include="PdfViewer\PagesViewer.Command.cs" />
+    <Compile Include="PdfViewer\PagesViewer.cs" />
+    <Compile Include="PdfViewer\PagesViewer.Method.cs" />
+    <Compile Include="PdfViewer\PoistionNotify.cs" />
+    <Compile Include="PdfViewer\RenderElement.cs" />
+    <Compile Include="PdfViewer\RenderJobThread.cs" />
+    <Compile Include="PdfViewer\CPDFViewer.Method.cs" />
+    <Compile Include="AnnotView\SquareAnnotVisual.cs" />
+    <Compile Include="PdfViewer\PDFTextSearch.cs" />
+    <Compile Include="PdfViewer\TextSelectInfo.cs" />
+    <Compile Include="PdfViewer\ViewMode.cs" />
+    <Compile Include="AnnotView\VisualElement.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <Compile Include="PdfViewer\RenderViewer.cs" />
+    <Compile Include="PdfViewer\CPDFViewer.cs" />
+    <Compile Include="TextEdit\ImageEditVisual.cs" />
+    <Compile Include="TextEdit\ImageEditVisual.Draw.cs" />
+    <Compile Include="TextEdit\ImageEditVisual.Function.cs" />
+    <Compile Include="TextEdit\IME.cs" />
+    <Compile Include="TextEdit\PDFEditEvent.cs" />
+    <Compile Include="TextEdit\PDFEditCommand.cs" />
+    <Compile Include="TextEdit\TextEditVisual.cs" />
+    <Compile Include="TextEdit\TextEditVisual.Draw.cs" />
+    <Compile Include="TextEdit\TextEditVisual.Function.cs" />
+    <Compile Include="Tools\Tools.cs" />
+    <Compile Include="AnnotEdit\WidgetToolManager.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup />
+  <ItemGroup>
+    <EmbeddedResource Include="Resource\PanTool2.cur" />
+    <EmbeddedResource Include="Resource\PanTool.cur" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Resource\AnnotEdit.cur" />
+  </ItemGroup>
+  <ItemGroup>
+    <Page Include="AnnotView\StickyPopupControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
+      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
+      <Name>ComPDFKit.Desk</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

BIN
PDF Office/ComPDFKit.Viewer.dll


BIN
PDF Office/ComPDFKit_Conversion.dll


+ 41 - 3
PDF Office/CustomControl/CompositeControl/ColorContent.xaml.cs

@@ -1,4 +1,7 @@
-using Prism.Mvvm;
+using PDF_Office.Helper;
+using PDF_Office.Model.AnnotPanel;
+using PDFSettings;
+using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -19,7 +22,7 @@ namespace PDF_Office.CustomControl.CompositeControl
 {
     public class ColorItem: BindableBase
     {
-
+        public int Index = 0;
         private Brush _color;
         public Brush Color
         {
@@ -51,11 +54,12 @@ namespace PDF_Office.CustomControl.CompositeControl
             }
         }
 
-        public ColorItem(Color color)
+        public ColorItem(Color color,int index = 0)
         {
             var colorBrush = new SolidColorBrush(color);
             Color = colorBrush;
             defaultColor = colorBrush;
+            Index = index;
         }
 
         //恢复颜色默认值
@@ -79,6 +83,16 @@ namespace PDF_Office.CustomControl.CompositeControl
         public event RoutedEventHandler SelectedColorInvoke;
         private ColorItem ChangedColorItem;
 
+        public ColorSelectorType ColorType
+        {
+            get { return (ColorSelectorType)GetValue(ColorTypeProperty); }
+            set { SetValue(ColorTypeProperty, value); }
+        }
+
+        public static readonly DependencyProperty ColorTypeProperty =
+            DependencyProperty.Register("ColorType", typeof(ColorSelectorType), typeof(ColorContent), new PropertyMetadata(ColorSelectorType.Highlight));
+
+
         /// <summary>
         /// 选中项的颜色,当前颜色
         /// </summary>
@@ -210,13 +224,26 @@ namespace PDF_Office.CustomControl.CompositeControl
             SelectedColorInvoke?.Invoke(selectCo, null);
         }
 
+        //更改颜色,选择器
         private void PnlColor_SelectedColorChanged(object sender, Color? e)
         {
             ChangedColorItem.Color = new SolidColorBrush(e.Value);
+
+            if (ColorType != ColorSelectorType.None)
+            {
+                ColorSelectorItem selectorItem = new ColorSelectorItem();
+                selectorItem.SelectorType = ColorType;
+                selectorItem.color = e.Value;
+                selectorItem.Index = ChangedColorItem.Index;
+                selectorItem.IsChangedColor = true;
+                SettingHelper.SetColorSelector(selectorItem);
+            }
+
             if (ChangedColorItem == ListColor.SelectedItem as ColorItem)
                 SelectedColorHandler?.Invoke(this, (ChangedColorItem.Color as SolidColorBrush).Color);
         }
 
+        //列表项更改颜色
         private void ChangeColorMenuItem_Click(object sender, RoutedEventArgs e)
         {
             var colorIem = (sender as FrameworkElement).DataContext as ColorItem;
@@ -231,6 +258,7 @@ namespace PDF_Office.CustomControl.CompositeControl
 
         }
 
+        //恢复默认颜色
         private void BackColorMenuItem_Click(object sender, RoutedEventArgs e)
         {
             var colorIem = (sender as FrameworkElement).DataContext as ColorItem;
@@ -240,6 +268,16 @@ namespace PDF_Office.CustomControl.CompositeControl
 
             if (newColor.A != oldColor.A || newColor.B != oldColor.B || newColor.R != oldColor.R || newColor.G != oldColor.G)
             {
+                if(ColorType != ColorSelectorType.None)
+                {
+                    ColorSelectorItem selectorItem = new ColorSelectorItem();
+                    selectorItem.SelectorType = ColorType;
+                    selectorItem.color = oldColor;
+                    selectorItem.Index = colorIem.Index;
+                    selectorItem.IsChangedColor = false;
+                    SettingHelper.SetColorSelector(selectorItem);
+                }
+
                 colorIem.RestoreColor();
                 if(colorIem == ListColor.SelectedItem as ColorItem)
                 {

+ 116 - 0
PDF Office/CustomControl/CompositeControl/ColorMenuItem.xaml

@@ -0,0 +1,116 @@
+<UserControl x:Class="PDF_Office.CustomControl.CompositeControl.ColorMenuItem"
+             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:convert="clr-namespace:PDF_Office.DataConvert"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+            <convert:ColorBrushConvert x:Key="colorBrushConvert" />
+            <convert:BoolToVisible x:Key="BoolToVisible"/>
+            <convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
+            <DataTemplate x:Key="listboxData">
+                <Grid>
+                    <Ellipse
+                    Width="20"
+                    Height="20" StrokeThickness="1"
+                    Stroke="{StaticResource color.sys.layout.divider}"
+                    Fill="{Binding Color}" 
+                    Visibility="{Binding IsTransparent,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                     />
+                    <Grid Visibility="{Binding IsTransparent,Converter={StaticResource BoolToVisible}}">
+                        <Ellipse
+                    Width="20"
+                    Height="20" StrokeThickness="1" Stroke="{StaticResource color.sys.layout.divider}"
+                    Fill="White" />
+                        <Path Margin="0,0,2,2" VerticalAlignment="Center" HorizontalAlignment="Center" Data="M15 1L0.999618 14.9999" Stroke="{StaticResource color.icon.base.state.error}" StrokeThickness="1"/>
+                    </Grid>
+
+                </Grid>
+
+            </DataTemplate>
+
+            <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
+                <Setter Property="HorizontalContentAlignment" Value="Center" />
+                <Setter Property="Height" Value="32"/>
+                <Setter Property="Width" Value="32"/>
+                <Setter Property="Margin" Value="0,0,8,0" />
+                <Setter Property="BorderThickness"  Value="0" />
+
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type ContentControl}">
+                            <Border CornerRadius="4"
+                                x:Name="border"
+                                Padding="0,0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource color.item-state.sel.border.lv3}"
+                                Background="{TemplateBinding Background}">
+                                <ContentPresenter />
+                            </Border>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+
+                <Style.Triggers>
+                    <Trigger Property="IsMouseOver" Value="True">
+                        <Setter Property="Background" Value="#e2e3e5" />
+                    </Trigger>
+                    <Trigger Property="IsMouseOver" Value="False">
+                        <Setter Property="Background" Value="Transparent" />
+                    </Trigger>
+                    <Trigger Property="IsSelected" Value="True">
+                        <Setter Property="Background" Value="#e2e3e5" />
+                        <Setter Property="BorderThickness"  Value="1" />
+                    </Trigger>
+                </Style.Triggers>
+
+            </Style>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="auto" />
+        </Grid.ColumnDefinitions>
+        <StackPanel VerticalAlignment="Center" Orientation="Horizontal" Grid.Column="1">
+            <Ellipse x:Name="ellipseBtn"
+            Width="20"
+            Height="20"
+            HorizontalAlignment="Center"
+            VerticalAlignment="Center"
+            PreviewMouseLeftButtonDown="Ellipse_PreviewMouseLeftButtonDown"  
+                >
+                <Ellipse.Fill>
+                    <DrawingBrush>
+                        <DrawingBrush.Drawing>
+                            <ImageDrawing ImageSource="../../Resources/PropertyPanel/colorIcon.png">
+                                <ImageDrawing.Rect>
+                                    <Rect Width="16" Height="16" />
+                                </ImageDrawing.Rect>
+                            </ImageDrawing>
+                        </DrawingBrush.Drawing>
+                    </DrawingBrush>
+                </Ellipse.Fill>
+            </Ellipse>
+        </StackPanel>
+
+        <ListBox
+            x:Name="ListColor"
+            Background="Transparent"
+            BorderThickness="0"
+            ItemContainerStyle="{StaticResource listboxItemStyle}"
+            ItemTemplate="{StaticResource listboxData}"
+            SelectionChanged="ListColor_SelectionChanged">
+            <ListBox.ItemsPanel>
+            <ItemsPanelTemplate>
+                <WrapPanel Orientation="Horizontal" />
+            </ItemsPanelTemplate>
+            </ListBox.ItemsPanel>
+        </ListBox>
+    </Grid>
+</UserControl>

+ 72 - 0
PDF Office/CustomControl/CompositeControl/ColorMenuItem.xaml.cs

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+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>
+    /// ColorMenuItem.xaml 的交互逻辑
+    /// </summary>
+    public partial class ColorMenuItem : UserControl
+    {
+        private ObservableCollection<ColorItem> colors = new ObservableCollection<ColorItem>();
+        public event EventHandler<Color> ColorChanged;
+        public ColorMenuItem()
+        {
+            InitializeComponent();
+            colors.Add(new ColorItem(Color.FromArgb(0xFF, 0xFF, 0xFF, 0x10)));
+            colors.Add(new ColorItem(Color.FromArgb(0xFF, 0xFF, 0x10, 0x10)));
+            colors.Add(new ColorItem(Color.FromArgb(0xFF, 0x10, 0xFF, 0x10)));
+            colors.Add(new ColorItem(Color.FromArgb(0xFF, 0x10, 0x70, 0xFF)));
+            ListColor.ItemsSource = colors;
+        }
+
+        public List<ColorItem> ItemSource
+        {
+            get { return (List<ColorItem>)GetValue(ItemSourceProperty); }
+            set { SetValue(ItemSourceProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for ShowColorList.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty ItemSourceProperty =
+            DependencyProperty.Register("ItemSource", typeof(List<ColorItem>), typeof(ColorMenuItem), new PropertyMetadata(null, ItemSourcePropertyChanged));
+
+        private static void ItemSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as ColorMenuItem;
+            var co = (List<ColorItem>)e.NewValue;
+            if (control != null && co != null && control.colors != null)
+            {
+                control.colors.Clear();
+                foreach (var item in co)
+                    control.colors.Add(item);
+            }
+        }
+
+        private void Ellipse_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            ColorChanged?.Invoke(ellipseBtn, Colors.Transparent);
+        }
+
+        private void ListColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var item = ListColor.SelectedItem as ColorItem;
+            if (item != null)
+            {
+                ColorChanged?.Invoke(sender, (item.Color as SolidColorBrush).Color);
+            }
+        }
+    }
+}

+ 7 - 4
PDF Office/CustomControl/WritableComboBox.xaml

@@ -19,15 +19,18 @@
             SelectedIndex="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=SelectedIndex}"
             SelectionChanged="writableComboBox_SelectionChanged"
             Visibility="Visible">
-            <ComboBoxItem Tag="AllPage" Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=IsAllPageVisible}">全部页面</ComboBoxItem>
-            <ComboBoxItem Tag="OddPage">奇数页</ComboBoxItem>
-            <ComboBoxItem IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=EvenPageIsEnabled}" Tag="EvenPage">偶数页</ComboBoxItem>
-            <ComboBoxItem Tag="CustomPage">自定义页面</ComboBoxItem>
+            <ComboBoxItem x:Name="AllPageItem" Tag="AllPage" Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=IsAllPageVisible}"/>
+            <ComboBoxItem x:Name="OddPageItem" Tag="OddPage"/>
+            <ComboBoxItem x:Name="EvenPageItem" IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=EvenPageIsEnabled}" Tag="EvenPage"/>
+            <ComboBoxItem x:Name="CustomPageItem" Tag="CustomPage"/>
         </ComboBox>
         <TextBox
             x:Name="writableTextBox"
             Grid.Column="0"
             MinHeight="{Binding ElementName=writableComboBox, Path=MinHeight}"
+            BorderBrush="{x:Null}"
+            BorderThickness="0"
+            Margin="2"
             HorizontalAlignment="Left"
             VerticalContentAlignment="Center"
             Panel.ZIndex="1"

+ 5 - 1
PDF Office/CustomControl/WritableComboBox.xaml.cs

@@ -252,7 +252,7 @@ namespace PDF_Office.CustomControl
             if (this.writableComboBox.SelectedIndex == this.writableComboBox.Items.Count - 1)
             {
                 if (this.writableComboBox.ActualWidth == 0) { this.writableTextBox.Width = 210; this.writableTextBox.Visibility = Visibility.Visible; return; }
-                this.writableTextBox.Width = this.writableComboBox.ActualWidth - 18;
+                this.writableTextBox.Width = this.writableComboBox.ActualWidth - 28;
                 Trace.WriteLine(this.writableComboBox.ActualWidth);
                 this.writableTextBox.Visibility = Visibility.Visible;
 
@@ -393,6 +393,10 @@ namespace PDF_Office.CustomControl
         private void UserControl_Loaded(object sender, RoutedEventArgs e)
         {
             UpDataPagesInRange();
+            AllPageItem.Content = App.MainPageLoader.GetString("WritableComboBox_AllPage");
+            OddPageItem.Content = App.MainPageLoader.GetString("WritableComboBox_OddPage");
+            EvenPageItem.Content = App.MainPageLoader.GetString("WritableComboBox_EvenPage");
+            CustomPageItem.Content = App.MainPageLoader.GetString("WritableComboBox_CustomRange");
         }
     }
 }

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

@@ -35,6 +35,33 @@ namespace PDF_Office.DataConvert
             throw new NotImplementedException();
         }
     }
+    
+    public class MergeListCountToBool : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return false;
+            }
+            else
+            {
+                if ((int)value >=2)
+                {
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
 
 
     public class ListCountAndBoolToVisible : IMultiValueConverter

+ 52 - 0
PDF Office/DataConvert/TextAlignToCheckedConverter.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+
+    public class TextAlignToCheckedConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value is string)
+            {
+                if (parameter is string)
+                {
+                    var args = (string)value;
+                    if ((string)parameter == "AlignLeft" && args == "Left")
+                    {
+                        return true;
+                    }
+
+                    if ((string)parameter == "AlignCenter" && args == "Center")
+                    {
+                        return true;
+                    }
+
+                    if ((string)parameter == "AlignRight" && args == "Right")
+                    {
+                        return true;
+                    }
+
+                    if ((string)parameter == "Justify" && args == "Justify")
+                    {
+                        return true;
+                    }
+
+                }
+            }
+            return false;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 78 - 50
PDF Office/Helper/ConverterHelper.cs

@@ -27,24 +27,24 @@ namespace PDF_Office.Helper
         public static CPDFConverterImg imgConverter = null;
         public static CPDFConverterRTF rtfConverter = null;
         public static CPDFConverterHTML htmlConverter = null;
-        public static async Task<bool> WordConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertWordOptions wordOptions = null)
+        public static async Task<bool> WordConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertWordOptions wordOptions = null, bool IsCustomFileName = true)
         {
             bool result = false;
             try
             {
                 int[] pageArray = pageIndexLists.ToArray();
                 wordConverter = new CPDFConverterWord(inputpath, pawssword);
-                string outputFolder = outputpath;
-                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                string outputFolder = outputpath.Remove(outputpath.LastIndexOf("\\"));
+                string outputFileName = Path.GetFileNameWithoutExtension(outputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
                 string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".docx");
                 result = await Task.Run(() => wordConverter.Convert(outputFolder, ref outputFileName, wordOptions, pageArray, ref error, getProgress));
                 if (result)
                 {
-                       CommonHelper.ShowFileBrowser(outputFileName.Replace("/","\\"));
+                    CommonHelper.ShowFileBrowser(outputFileName.Replace("/", "\\"));
                 }
             }
-            
+
             catch (Exception ex)
             {
 
@@ -52,7 +52,7 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> PPTConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertPPTOptions pptOptions=null)
+        public static async Task<bool> PPTConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertPPTOptions pptOptions = null, bool IsCustomFileName = true)
         {
             bool result = false;
             try
@@ -60,13 +60,13 @@ namespace PDF_Office.Helper
                 int[] pageArray = pageIndexLists.ToArray();
 
                 pptConverter = new CPDFConverterPPT(inputpath, pawssword);
-                string outputFolder = outputpath;
-                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                string outputFolder = outputpath.Remove(outputpath.LastIndexOf("\\"));
+                string outputFileName = Path.GetFileNameWithoutExtension(outputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
 
                 string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".ppt");
 
-                result = await Task.Run(() => pptConverter.Convert(outputFolder, ref outputFileName, pptOptions,pageArray, ref error, getProgress));
+                result = await Task.Run(() => pptConverter.Convert(outputFolder, ref outputFileName, pptOptions, pageArray, ref error, getProgress));
                 if (result)
                 {
                     CommonHelper.ShowFileBrowser(outputFileName.Replace("/", "\\"));
@@ -79,18 +79,18 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> ExcelConvert(string inputpath, string outputpath,OnProgress getProgress , List<int> pageIndexLists, string pawssword,CPDFConvertExcelOptions ExcelOption)
+        public static async Task<bool> ExcelConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertExcelOptions ExcelOption, bool IsCustomFileName = true)
         {
             bool result = false;
             try
             {
-                excelConverter = new CPDFConverterExcel(inputpath,pawssword);
+                excelConverter = new CPDFConverterExcel(inputpath, pawssword);
                 int[] pageArray = pageIndexLists.ToArray();
 
-                string outputFolder = outputpath;
-                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                string outputFolder = outputpath.Remove(outputpath.LastIndexOf("\\"));
+                string outputFileName = Path.GetFileNameWithoutExtension(outputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
-                 result = await Task.Run(() => excelConverter.Convert(outputFolder, ref outputFileName, ExcelOption, pageArray, ref error, getProgress));
+                result = await Task.Run(() => excelConverter.Convert(outputFolder, ref outputFileName, ExcelOption, pageArray, ref error, getProgress));
                 if (result)
                 {
                     if (File.Exists(outputFileName))
@@ -98,13 +98,13 @@ namespace PDF_Office.Helper
                     else if (outputFileName == "NoTable")
                         MessageBoxEx.Show("No Table");
                 }
-               
-                   
+
+
             }
             catch (Exception ex)
-           {
+            {
 
-               }
+            }
             return result;
         }
 
@@ -129,7 +129,7 @@ namespace PDF_Office.Helper
         //    return result;
         //}
 
-        public static async Task<bool> CSVConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertCsvOptions csvOptions =null)
+        public static async Task<bool> CSVConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertCsvOptions csvOptions = null, bool IsCustomFileName = true)
         {
             bool result = false;
             try
@@ -137,18 +137,44 @@ namespace PDF_Office.Helper
                 int[] pageArray = pageIndexLists.ToArray();
 
                 csvConverter = new CPDFConverterCsv(inputpath, pawssword);
-                string outputFolder = outputpath;
-                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                string outputFolder = "";
+                string outputFileName = "";
+                if (IsCustomFileName)
+                {
+                    outputFolder = outputpath.Remove(outputpath.LastIndexOf("\\"));
+                    outputFileName = Path.GetFileNameWithoutExtension(outputpath);
+                }
+                else
+                {
+                    outputFolder = outputpath;
+                    outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                }
+
                 ConvertError error = ConvertError.ERR_UNKNOWN;
                 string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".csv");
                 result = await Task.Run(() => csvConverter.Convert(outputFolder, ref outputFileName, csvOptions, pageArray, ref error, getProgress));
                 if (result)
                 {
+
+
                     if (File.Exists(outputFileName))
-                        CommonHelper.ShowFileBrowser(outputFileName.Replace("/", "\\"));
+                    {
+                        if (IsCustomFileName)
+                        {
+                            CommonHelper.ShowFileBrowser(outputFileName.Replace("/", "\\"));
+                        }
+                        else
+                        {
+                            string FileName = CommonHelper.CreateFolder(outputFileName.Replace(".zip", ""));
+                            ZipFile.ExtractToDirectory(outputFileName, FileName);
+                            File.Delete(outputFileName);
+                            CommonHelper.ShowFileBrowser(FileName.Replace("/", "\\"));
+                        }
+
+                    }
                     else
                         MessageBox.Show("None CSV");
-                    
+
                 }
             }
             catch (Exception ex)
@@ -158,7 +184,7 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> TxtConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword,CPDFConvertTxtOptions txtOptions =null)
+        public static async Task<bool> TxtConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertTxtOptions txtOptions = null, bool IsCustomFileName = true)
         {
             bool result = false;
             try
@@ -166,8 +192,8 @@ namespace PDF_Office.Helper
                 int[] pageArray = pageIndexLists.ToArray();
 
                 txtConverter = new CPDFConverterTxt(inputpath, pawssword);
-                string outputFolder = outputpath;
-                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                string outputFolder = outputpath.Remove(outputpath.LastIndexOf("\\"));
+                string outputFileName = Path.GetFileNameWithoutExtension(outputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
                 string filename = GetFileNameAddSuffix(outputFolder, outputFileName, ".txt");
                 result = await Task.Run(() => txtConverter.Convert(outputFolder, ref outputFileName, txtOptions, pageArray, ref error, getProgress));
@@ -183,29 +209,31 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static void ImageMagickPDFToImage(string imageType,string filePath,string outputFolder,string outputFileName,ref string FileName) {
-            FileName = CommonHelper.CreateFolder(outputFolder +"\\"+ outputFileName);
+        public static void ImageMagickPDFToImage(string imageType, string filePath, string outputFolder, string outputFileName, ref string FileName)
+        {
+            FileName = CommonHelper.CreateFolder(outputFolder + "\\" + outputFileName);
             ZipFile.ExtractToDirectory(filePath, FileName);
             var files = Directory.GetFiles(FileName, "*.png");
-            int i=0;
+            int i = 0;
             var images = new MagickImageCollection();
             foreach (var file in files)
             {
                 //pdf整体转为gif,将.gifoff改为.gif
                 Trace.WriteLine(file);
-                if (imageType == ".gifoff") {
+                if (imageType == ".gifoff")
+                {
                     images.Add(file);
                     images[i].AnimationDelay = 100; // in this example delay is 1000ms/1sec
                     images[i].Flip();
                 }
-                
+
                 using (var image = new MagickImage(file))
                 {
                     if (imageType != ".gifoff")
                     {
-                    //Save frame as jpg
-                    //image.Format = MagickFormat.Jp2;
-                    image.Write(file.Remove(file.LastIndexOf(".png"), 4) + imageType);
+                        //Save frame as jpg
+                        //image.Format = MagickFormat.Jp2;
+                        image.Write(file.Remove(file.LastIndexOf(".png"), 4) + imageType);
                     }
                     // 删除该文件
                     System.IO.File.Delete(file);
@@ -236,11 +264,11 @@ namespace PDF_Office.Helper
                     }
                 }
                 else { images.Write(outputFolder + "\\" + outputFileName + ".gif"); }
-               
+
             }
             //else {
             //    int fileIndex = 1;
-                
+
             //    if (File.Exists(outputFolder + "\\" + outputFileName + ".zip"))
             //    {
             //        while (fileIndex>=1) {
@@ -253,15 +281,15 @@ namespace PDF_Office.Helper
             //        }
             //    }
             //    else { ZipFile.CreateFromDirectory(outputFolder + "\\" + outputFileName, outputFolder + "\\" + outputFileName + ".zip"); }
-                
+
             //}
             //DirectoryInfo di = new DirectoryInfo(outputFolder + "\\" + outputFileName);
             //di.Delete(true);
 
 
-        }       
+        }
 
-        public static async Task<bool> ImgConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists,string pawssword,string imageType=".png", CPDFConvertImgOptions imgOptions = null)
+        public static async Task<bool> ImgConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, string imageType = ".png", CPDFConvertImgOptions imgOptions = null)
         {
             string FileName = "";
             bool result = false;
@@ -283,7 +311,7 @@ namespace PDF_Office.Helper
                 }
                 else
                 { //创建缓存文件夹
-                   
+
                     string folderPath = Path.Combine(App.CurrentPath, "ConverterImg");
                     //有可能因为其他原因存在同名文件,导致创建文件夹失败,需要先删除同名文件
                     //保险措施(猜测)
@@ -301,8 +329,8 @@ namespace PDF_Office.Helper
                     //预览图缓存
                     string saveName = Guid.NewGuid().ToString();
                     string savePath = Path.Combine(folderPath, saveName);
-                     result = await Task.Run(() => imgConverter.Convert(folderPath, ref saveName, imgOptions, pageArray, ref error, getProgress));
-                    ImageMagickPDFToImage(imageType, saveName, outputFolder, outputFileName,ref FileName);
+                    result = await Task.Run(() => imgConverter.Convert(folderPath, ref saveName, imgOptions, pageArray, ref error, getProgress));
+                    ImageMagickPDFToImage(imageType, saveName, outputFolder, outputFileName, ref FileName);
                     DirectoryInfo di = new DirectoryInfo(folderPath);
                     di.Delete(true);
                 }
@@ -310,7 +338,7 @@ namespace PDF_Office.Helper
                 if (result)
                 {
                     //Process.Start(FileName.Replace("/", "\\"));
-                    CommonHelper.ShowFileBrowser(FileName);
+                    CommonHelper.ShowFileBrowser(FileName.Replace("/", "\\"));
                 }
             }
             catch (Exception ex)
@@ -320,17 +348,17 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> RTFConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertRTFOptions rtfOptions=null)
+        public static async Task<bool> RTFConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertRTFOptions rtfOptions = null, bool IsCustomFileName = true)
         {
             bool result = false;
             try
             {
                 int[] pageArray = pageIndexLists.ToArray();
                 rtfConverter = new CPDFConverterRTF(inputpath, pawssword);
-                string outputFolder = outputpath;
-                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                string outputFolder = outputpath.Remove(outputpath.LastIndexOf("\\"));
+                string outputFileName = Path.GetFileNameWithoutExtension(outputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
-                result = await Task.Run(() => rtfConverter.Convert(outputFolder, ref outputFileName, rtfOptions,pageArray, ref error, getProgress));
+                result = await Task.Run(() => rtfConverter.Convert(outputFolder, ref outputFileName, rtfOptions, pageArray, ref error, getProgress));
                 if (result)
                 {
                     CommonHelper.ShowFileBrowser(outputFileName.Replace("/", "\\"));
@@ -343,7 +371,7 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> HTMLConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertHTMLOptions HtmlOption)
+        public static async Task<bool> HTMLConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists, string pawssword, CPDFConvertHTMLOptions HtmlOption, bool IsCustomFileName = true)
         {
             bool result = false;
             try
@@ -351,8 +379,8 @@ namespace PDF_Office.Helper
                 htmlConverter = new CPDFConverterHTML(inputpath, pawssword);
                 int[] pageArray = pageIndexLists.ToArray();
 
-                string outputFolder = outputpath;
-                string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
+                string outputFolder = outputpath.Remove(outputpath.LastIndexOf("\\"));
+                string outputFileName = Path.GetFileNameWithoutExtension(outputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
                 result = await Task.Run(() => htmlConverter.Convert(outputFolder, ref outputFileName, HtmlOption, pageArray, ref error, getProgress));
                 if (result)

+ 114 - 0
PDF Office/Helper/CropPageUndoManager.cs

@@ -0,0 +1,114 @@
+using ComPDFKitViewer;
+using ComPDFKitViewer.PdfViewer;
+using Microsoft.Office.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Helper
+{
+    public enum CropPageEnum
+    {
+        CropCurrentPageWM,
+        CropAllPagesWM
+    }
+
+    public class CropPageUndoManager : IHistory
+    {
+        public List<int> cropPageList = new List<int>();
+
+        private List<CropPageEnum> cropPageEnumList = new List<CropPageEnum>();
+
+        private int cropPageEnumIndex = -1;
+
+        private int cropPageListInterval = 0;
+
+        private CPDFViewer pdfviewer = null;
+
+        public CropPageUndoManager()
+        {
+
+        }
+
+        public void setPDFViewer(CPDFViewer pDFViewer)
+        {
+            pdfviewer = pDFViewer;
+        }
+
+        public void ADDCropCurrentPageWM()
+        {
+            cropPageEnumIndex++;
+            cropPageEnumList.Insert(cropPageEnumIndex, CropPageEnum.CropCurrentPageWM);
+            if (cropPageEnumIndex != cropPageEnumList.Count - 1)
+            {
+                cropPageEnumList.RemoveRange(cropPageEnumIndex + 1, cropPageEnumList.Count - cropPageEnumIndex-1);
+                cropPageList.RemoveRange(cropPageList.Count - cropPageListInterval-1, cropPageListInterval);
+                cropPageListInterval = 0;
+            }
+
+
+
+        }
+        public void ADDCropAllPagesWM()
+        {
+            cropPageEnumIndex++;
+            cropPageEnumList.Insert(cropPageEnumIndex, CropPageEnum.CropAllPagesWM);
+            if (cropPageEnumIndex != cropPageEnumList.Count - 1)
+            {
+                cropPageEnumList.RemoveRange(cropPageEnumIndex+1, cropPageEnumList.Count - cropPageEnumIndex-1);
+                cropPageList.RemoveRange(cropPageList.Count - cropPageListInterval-37, cropPageListInterval);
+                cropPageListInterval = 0;
+            }
+            
+        }
+
+        public void setPageList(List<int> CropPageList)
+        {
+            cropPageList = CropPageList;
+        }
+
+        public bool Redo()
+        {
+            cropPageEnumIndex++;
+            if (cropPageEnumIndex < cropPageEnumList.Count )
+            {
+                
+                if (cropPageEnumList[cropPageEnumIndex] == CropPageEnum.CropAllPagesWM) { cropPageListInterval -= pdfviewer.Document.PageCount; } else { cropPageListInterval--; }
+                
+                if (cropPageList.Count - cropPageListInterval == 0) { pdfviewer.SetCropMode(false); } else { pdfviewer.SetCropMode(true, cropPageList.GetRange(0, cropPageList.Count - cropPageListInterval)); }
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public bool Undo()
+        {
+            if (cropPageEnumIndex > -1)
+            {
+                if (cropPageEnumList[cropPageEnumIndex] == CropPageEnum.CropAllPagesWM)
+                {
+                    cropPageListInterval += pdfviewer.Document.PageCount;
+                }
+                else
+                {
+                    cropPageListInterval++;
+                }
+                if (cropPageList.Count - cropPageListInterval == 0) { pdfviewer.SetCropMode(false); } else { pdfviewer.SetCropMode(true, cropPageList.GetRange(0, cropPageList.Count - cropPageListInterval)); }
+
+                cropPageEnumIndex--;
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+
+
+        }
+    }
+}

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

@@ -33,7 +33,7 @@ namespace PDF_Office.Helper
                 permissionsInfo.AllowsCopying &&
                 permissionsInfo.AllowsDocumentAssembly &&
                 permissionsInfo.AllowsFormFieldEntry &&
-                permissionsInfo.AllowsCommenting)
+                permissionsInfo.AllowsCommenting||string.IsNullOrEmpty(document.FilePath) )
             {
                 return true;
             }

+ 77 - 0
PDF Office/Helper/ServiceHelper.cs

@@ -5,6 +5,7 @@ using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Management;
 using System.Net;
 using System.Text;
 using System.Threading.Tasks;
@@ -59,6 +60,82 @@ namespace PDF_Office.Helper
         //获取用户信息
         public static string GetUserUrl = "/pdf-office-sso/user/me";
 
+        private static string computerInfo;
+        /// <summary>
+        /// 电脑品牌信息
+        /// </summary>
+        public static string ComputerInfo
+        {
+            get {
+                if (computerInfo == null)
+                {
+                    computerInfo = GetComputerInfo();
+                }
+                return computerInfo; 
+            
+            }
+            set { computerInfo = value; }
+        }
+
+        private static string systemInfo;
+
+        /// <summary>
+        /// 系统信息
+        /// </summary>
+        public static string SystemInfo
+        {
+            get
+            {
+
+                if (systemInfo == null)
+                {
+                    systemInfo = GetSystemInfo();
+                }
+                return systemInfo;
+            }
+
+            set { systemInfo = value; }
+        }
+
+
+        private static string GetSystemInfo()
+        {
+            try
+            {
+                string s = "";
+                SelectQuery sq = new SelectQuery("Win32_OperatingSystem");
+                ManagementObjectSearcher mos = new ManagementObjectSearcher(sq);
+                ManagementObjectCollection moc = mos.Get();
+                foreach (ManagementObject mo in moc)
+                {
+                    s = mo.Properties["Version"].Value.ToString();
+                }
+                moc.Dispose();
+                sq = null;
+                return s;
+            }
+            catch { return ""; }
+        }
+
+        private static string GetComputerInfo()
+        {
+            try
+            {
+                string s = "";
+                System.Windows.Controls.TextBox text = new System.Windows.Controls.TextBox();
+                SelectQuery sq = new SelectQuery("Win32_ComputerSystem");
+                ManagementObjectSearcher mos = new ManagementObjectSearcher(sq);
+                ManagementObjectCollection moc = mos.Get();
+                foreach (ManagementObject mo in moc)
+                {
+                    s = mo.Properties["Manufacturer"].Value + " " + mo.Properties["Model"].Value;
+                }
+                moc.Dispose();
+                sq = null;
+                return s;
+            }
+            catch { return ""; }
+        }
 
 
         //超时同步为20秒

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

@@ -150,7 +150,8 @@ namespace PDF_Office.Helper
             catch { }
         }
 
-        public static DefaultAnnotProperty GetAnnotDefaultProperty(AnnotArgsType annotToolType,string saveKey="")
+        #region 缓存注释属性
+        public static DefaultAnnotProperty GetAnnotDefaultProperty(AnnotArgsType annotToolType, string saveKey = "")
         {
             if (Settings.Default.DefautAnnotProperties != null)
             {
@@ -162,7 +163,6 @@ namespace PDF_Office.Helper
             }
             return null;
         }
-
         public static void SetAnnotDefaultProperty(DefaultAnnotProperty annotProperty)
         {
             if (Settings.Default.DefautAnnotProperties == null)
@@ -172,6 +172,33 @@ namespace PDF_Office.Helper
             Settings.Default.DefautAnnotProperties.SetAnnotProperty(annotProperty);
             Settings.Default.Save();
         }
+
+        #endregion 缓存注释属性
+
+
+        #region 缓存颜色列表
+
+        public static void SetColorSelector(ColorSelectorItem selectorItem)
+        {
+            if (Settings.Default.ColorSelectors == null)
+            {
+                Settings.Default.ColorSelectors = new ColorSelectorList();
+            }
+            Settings.Default.ColorSelectors.SetColorSelector(selectorItem);
+            Settings.Default.Save();
+        }
+
+        public static ColorSelectorItem GetColorSelectorItem(ColorSelectorType selectorType,int Index)
+        {
+            if (Settings.Default.ColorSelectors != null)
+            {
+                return Settings.Default.ColorSelectors.GetColorSelector(selectorType, Index);
+            }
+            return null;
+        }
+
+        #endregion 缓存颜色列表
+
         private static string KeyAlaphabet = "0123456789ABCDEFGHIGKLMNOPQRSTUVWXYZ";
         public static char NumberToChar(int num)
         {

+ 110 - 20
PDF Office/Model/AnnotPanel/AnnotCommon.cs

@@ -1,5 +1,8 @@
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.CustomControl.CompositeControl;
+using PDF_Office.Helper;
+using PDF_Office.Properties;
+using PDFSettings;
 using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
@@ -178,68 +181,155 @@ namespace PDF_Office.Model.AnnotPanel
     public class AnnotColorList
     {
         //用于高亮注释颜色
-        public static List<ColorItem> GetHighlightColorList()
+        public static List<ColorItem> GetColorList(ColorSelectorType type)
+        {
+            ColorSelectorItem cacheColorItem = null;
+            if (Settings.Default.ColorSelectors == null)
+            {
+                Settings.Default.ColorSelectors = new ColorSelectorList();
+            }
+            else
+            {
+                //是否存在某类型的颜色列表
+                cacheColorItem = Settings.Default.ColorSelectors.FirstOrDefault(temp => temp.SelectorType == type);
+            }
+
+            List<ColorItem> Items = GetSpecifiedColorList(type);
+
+            if (cacheColorItem== null)
+            {
+                SaveInitSelector(Items, type);
+            }
+            else
+            {
+                //若存在,同步缓存里的数据
+                foreach(var item in Items)
+                {
+                    var selector = SettingHelper.GetColorSelectorItem(type, item.Index);
+                    if (selector != null)
+                    {
+                        item.Color = new SolidColorBrush(selector.color);
+                    }
+                }
+                
+            }
+
+            return Items;
+        }
+
+        //缓存第一次初始化数据
+        private static void SaveInitSelector(List<ColorItem> colors, ColorSelectorType type)
+        {
+            if (Settings.Default.ColorSelectors == null)
+            {
+                Settings.Default.ColorSelectors = new ColorSelectorList();
+            }
+
+            foreach (var item in colors)
+            {
+                ColorSelectorItem colorSelectorItem = new ColorSelectorItem();
+                colorSelectorItem.color = (item.Color as SolidColorBrush).Color;
+                colorSelectorItem.SelectorType = type;
+                colorSelectorItem.Index = item.Index;
+                colorSelectorItem.IsChangedColor = false;
+                Settings.Default.ColorSelectors.Add(colorSelectorItem);
+            }
+
+            Settings.Default.Save();
+        }
+
+        //选取某类型第一次初始化(默认值)的颜色列表
+        private static List<ColorItem> GetSpecifiedColorList(ColorSelectorType type)
+        {
+            List<ColorItem> Items = null;
+            switch (type)
+            {
+                case ColorSelectorType.Highlight:
+                    Items = GetHighlightColorList();
+                    break;
+                case ColorSelectorType.Border:
+                    Items = GetBorderColorList();
+                    break;
+                case ColorSelectorType.Fill:
+                    Items = GetFillColorList();
+                    break;
+                case ColorSelectorType.Sticky:
+                    Items = GetStyleColorList();
+                    break;
+                default:
+                    Items = GetHighlightColorList();
+                    break;
+            }
+
+            return Items;
+
+        }
+
+        //用于高亮注释颜色
+        private static List<ColorItem> GetHighlightColorList()
         {
             List<ColorItem> HighlightItems = new List<ColorItem>();
             HighlightItems = new List<ColorItem>();
-            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xC7, 0x00));
+            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xC7, 0x00), 0);
             HighlightItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0xFC, 0x1F, 0x1F));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xFC, 0x1F, 0x1F), 1);
             HighlightItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0x3E, 0xED, 0x92));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x3E, 0xED, 0x92), 2);
             HighlightItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0x47, 0xC8, 0xFF));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x47, 0xC8, 0xFF), 3);
             HighlightItems.Add(colorItem);
             return HighlightItems;
         }
 
+
         //用于边框颜色
-        public static List<ColorItem> GetBorderColorList()
+        private static List<ColorItem> GetBorderColorList()
         {
             List<ColorItem> BorderItems = new List<ColorItem>();
             BorderItems = new List<ColorItem>();
-            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xFC, 0x1F, 0x1F));
+            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xFC, 0x1F, 0x1F), 0);
             BorderItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0x29, 0x53, 0x93));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x29, 0x53, 0x93), 1);
             BorderItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0x1E, 0x89, 0x56));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x1E, 0x89, 0x56), 2);
             BorderItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0xB8, 0x08, 0xD4));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xB8, 0x08, 0xD4), 3);
             BorderItems.Add(colorItem);
             return BorderItems;
         }
 
         //用于填充颜色
-        public static List<ColorItem> GetFillColorList()
+        private static List<ColorItem> GetFillColorList()
         {
             List<ColorItem> FillItems = new List<ColorItem>();
             FillItems = new List<ColorItem>();
-            ColorItem colorItem = new ColorItem(Colors.Transparent);
+            ColorItem colorItem = new ColorItem(Colors.Transparent, 0);
             FillItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xff, 0xff));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xff, 0xff), 1);
             FillItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0xDF, 0xE1, 0xE4));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xDF, 0xE1, 0xE4), 2);
             FillItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0xFF, 0xF1, 0xC1));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xFF, 0xF1, 0xC1), 3);
             FillItems.Add(colorItem);
             return FillItems;
         }
 
         //用于注释样式颜色:如便签样式颜色
-        public static List<ColorItem> GetStyleColorList()
+        private static List<ColorItem> GetStyleColorList()
         {
             List<ColorItem> StyleItems = new List<ColorItem>();
             StyleItems = new List<ColorItem>();
-            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xD5, 0x73));
+            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xD5, 0x73), 0);
             StyleItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0xF8, 0x59, 0xC8));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xF8, 0x59, 0xC8), 1);
             StyleItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0x1A, 0xD5, 0x98));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x1A, 0xD5, 0x98), 2);
             StyleItems.Add(colorItem);
-            colorItem = new ColorItem(Color.FromArgb(0xff, 0x68, 0xAC, 0xF8));
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x68, 0xAC, 0xF8), 3);
             StyleItems.Add(colorItem);
             return StyleItems;
         }
 
     }
+
 }

+ 6 - 5
PDF Office/Model/AnnotPanel/FontBoard.cs

@@ -441,13 +441,14 @@ namespace PDF_Office.Model.AnnotPanel
             }
         }
 
-        private C_TEXT_ALIGNMENT _textAlignment;
-        public C_TEXT_ALIGNMENT TextAlignmentItem
+        //文字内容对齐
+        private string _strtextAlign;
+        public string StrTextAlign
         {
-            get { return _textAlignment; }
-            set { SetProperty(ref _textAlignment, value); }
+            get { return _strtextAlign; }
+            set { SetProperty(ref _strtextAlign, value); }
         }
-
+        
         //颜色
         private Brush _fontColor = new SolidColorBrush(Colors.Black);
         public Brush FontColor

+ 2 - 1
PDF Office/Model/BOTA/AnnotationHandlerEventArgs.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using System;
 using System.Collections.Generic;
+using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -24,7 +25,7 @@ namespace PDF_Office.Model.BOTA
         public int PageIndex { get; set; }
         public int AnnotIndex { get; set; }
         public AnnotHandlerEventArgs AnnotHandlerEventArgs { get; set; }
-        public WriteableBitmap WriteableBitmap { get; set; }
+        public BitmapImage WriteableBitmap { get; set; }
         public CPDFDocument Document { get; set; }
 
         public Rect ClientRect { get; set; }

+ 6 - 1
PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs

@@ -60,6 +60,11 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
         /// </summary>
         public string Pawssword="";
 
+        /// <summary>
+        /// 文档密码;
+        /// </summary>
+        public bool IsCustomFileName=true;
+               
 
         /// <summary>
         /// OCR,与部分功能;
@@ -103,7 +108,7 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
                         {
                             ConverterCSVModel.PageIndexLists[i] = ConverterCSVModel.PageIndexLists[i] + 1;
                         }
-                        result = await ConverterHelper.CSVConvert(ConverterCSVModel.InputPath, ConverterCSVModel.OutputPath, GetProgress, ConverterCSVModel.PageIndexLists, ConverterCSVModel.Pawssword, ConverterCSVModel.csvOptions);
+                        result = await ConverterHelper.CSVConvert(ConverterCSVModel.InputPath, ConverterCSVModel.OutputPath, GetProgress, ConverterCSVModel.PageIndexLists, ConverterCSVModel.Pawssword, ConverterCSVModel.csvOptions, ConverterCSVModel.IsCustomFileName);
 
                     }
                     else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }

+ 5 - 0
PDF Office/Model/DialogNames.cs

@@ -182,6 +182,11 @@ namespace PDF_Office.Model
         /// </summary>
         public static string CreateFromHtmlDialog = "CreateFromHtmlDialog";
 
+        /// <summary>
+        /// 从网页创建PDF弹窗
+        /// </summary>
+        public static string CreateFromScannerDialogs = "CreateFromScannerDialogs";
+
         /// <summary>
         /// 标记密文相关弹窗
         /// </summary>

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

@@ -33,6 +33,7 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
                     newItem.mFontStyle = cacheItem.mFontStyle;
                     newItem.mFontWeight = cacheItem.mFontWeight;
                     newItem.mFontSize = cacheItem.mFontSize;
+                    newItem.mFontFamily = cacheItem.mFontFamily;
                     Settings.Default.PresetFontList.Add(newItem);
                 }
 
@@ -48,6 +49,7 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
                     newItem.mFontStyle = item.mFontStyle;
                     newItem.mFontWeight = item.mFontWeight;
                     newItem.mFontSize = item.mFontSize;
+                    newItem.mFontFamily = item.mFontFamily;
                     cacheTempList.Add(newItem);
                 }
             }
@@ -115,6 +117,7 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
                 {
                     if (item.mTag == itemDefault.mTag)
                     {
+                        item.mTagContent = itemDefault.mTagContent;
                         item.mFontFamily = itemDefault.mFontFamily;
                         item.mFontWeight = itemDefault.mFontWeight;
                         item.mFontStyle = itemDefault.mFontStyle;

+ 61 - 1
PDF Office/Model/SettingsDialog/AnnotateModel.cs

@@ -1,4 +1,6 @@
-using PDF_Office.Properties;
+using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.Helper;
+using PDF_Office.Properties;
 using PDFSettings;
 using Prism.Mvvm;
 using System;
@@ -192,6 +194,62 @@ namespace PDF_Office.Model.SettingsDialog
             this.TextAlign = annote.TextAlign;
         }
 
+        private void SaveDefaultAnnotSettings()
+        {
+            var highLightAnnot = GetAnnotDefault(AnnotArgsType.AnnotHighlight);
+            highLightAnnot.ForgoundColor = this.HighLightColor;
+            SetDefautAnnotProperties(highLightAnnot);
+
+            var UnderLineAnnot = GetAnnotDefault(AnnotArgsType.AnnotUnderline); 
+            UnderLineAnnot.ForgoundColor = this.UnderLineColor;
+            SetDefautAnnotProperties(UnderLineAnnot);
+
+            var StrikethroughColor = GetAnnotDefault(AnnotArgsType.AnnotStrikeout);
+            StrikethroughColor.ForgoundColor = this.strikethroughColor;
+            SetDefautAnnotProperties(StrikethroughColor);
+
+            var FreeHandAnnot = GetAnnotDefault(AnnotArgsType.AnnotFreehand);
+            FreeHandAnnot.ForgoundColor = this.FreeHandColor;
+            SetDefautAnnotProperties(FreeHandAnnot);
+
+            var TextAnnoteAnnot = GetAnnotDefault(AnnotArgsType.AnnotFreeText);
+            TextAnnoteAnnot.ForgoundColor = this.textAnnoteColor;
+            SetDefautAnnotProperties(TextAnnoteAnnot);
+
+            var NoteAnnoteAnnot = GetAnnotDefault(AnnotArgsType.AnnotSticky);
+            NoteAnnoteAnnot.ForgoundColor = this.NoteAnnoteColor;
+            SetDefautAnnotProperties(NoteAnnoteAnnot);
+
+            var RectangleAnnot = GetAnnotDefault(AnnotArgsType.AnnotSquare);
+            RectangleAnnot.BorderColor = this.RectangleBorderColor;
+            RectangleAnnot.BackgroundColor = this.RectangleFillColor;
+            SetDefautAnnotProperties(RectangleAnnot);
+
+            var AnnotLineAnnot = GetAnnotDefault(AnnotArgsType.AnnotLine);
+            AnnotLineAnnot.BorderColor = this.LineColor;
+            SetDefautAnnotProperties(AnnotLineAnnot);
+            Settings.Default.Save();
+        }
+
+        private void SetDefautAnnotProperties(DefaultAnnotProperty annotProperty)
+        {
+            if (Settings.Default.DefautAnnotProperties == null)
+            {
+                Settings.Default.DefautAnnotProperties = new DefaultAnnotProperties();
+            }
+            Settings.Default.DefautAnnotProperties.SetAnnotProperty(annotProperty);
+        }
+
+        private DefaultAnnotProperty GetAnnotDefault(AnnotArgsType annotArgsType)
+        {
+            var Annot = SettingHelper.GetAnnotDefaultProperty(annotArgsType);
+            if (Annot == null)
+            {
+                Annot = new DefaultAnnotProperty();
+            }
+            return Annot;
+        }
+
         public void Save()
         {
             AnnotatePropertyClass annote = new AnnotatePropertyClass();
@@ -211,6 +269,8 @@ namespace PDF_Office.Model.SettingsDialog
             annote.TextAlign = this.TextAlign;
 
             Settings.Default.AppProperties.Annotate = annote;
+
+            SaveDefaultAnnotSettings();
         }
 
         public void Reset()

+ 369 - 0
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
+  <file datatype="xml" source-language="en-US" target-language="en" original="PDF OFFICE/PROPERTIES/RESOURCES.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/PROPERTIES/RESOURCES.RESX" datatype="resx">
+        <trans-unit id="excelex" translate="yes" xml:space="preserve">
+          <source>*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</source>
+          <target state="new">*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的excel文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="htmlex" translate="yes" xml:space="preserve">
+          <source>*.html;</source>
+          <target state="new">*.html;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的html格式</note>
+        </trans-unit>
+        <trans-unit id="imageex" translate="yes" xml:space="preserve">
+          <source>*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</source>
+          <target state="new">*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</target>
+        </trans-unit>
+        <trans-unit id="OpenDialogFilter" translate="yes" xml:space="preserve">
+          <source>PDF Files (*.pdf)|*.pdf</source>
+          <target state="new">PDF Files (*.pdf)|*.pdf</target>
+        </trans-unit>
+        <trans-unit id="pptex" translate="yes" xml:space="preserve">
+          <source>*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</source>
+          <target state="new">*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的ppt文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="SDKLisence" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+          <source>..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</source>
+          <target state="needs-review-translation">..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</target>
+        </trans-unit>
+        <trans-unit id="txtex" translate="yes" xml:space="preserve">
+          <source>*.txt;</source>
+          <target state="new">*.txt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的txt格式</note>
+        </trans-unit>
+        <trans-unit id="wordex" translate="yes" xml:space="preserve">
+          <source>*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</source>
+          <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="en" original="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="en" original="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" datatype="resx">
+        <trans-unit id="Merge_AddFiles" translate="yes" xml:space="preserve">
+          <source>Add Files</source>
+          <target state="new">Add Files</target>
+        </trans-unit>
+        <trans-unit id="Merge_AddOpenFile" translate="yes" xml:space="preserve">
+          <source>Add an Open File</source>
+          <target state="new">Add an Open File</target>
+        </trans-unit>
+        <trans-unit id="Merge_Hint" translate="yes" xml:space="preserve">
+          <source>Selected files
+Drop files here or Click “Add Files” at bottom right button. 
+Drag files to reorder as you need.</source>
+          <target state="new">Selected files
+Drop files here or Click “Add Files” at bottom right button. 
+Drag files to reorder as you need.</target>
+        </trans-unit>
+        <trans-unit id="Merge_ItemPages" translate="yes" xml:space="preserve">
+          <source>Pages</source>
+          <target state="new">Pages</target>
+        </trans-unit>
+        <trans-unit id="Merge_No" translate="yes" xml:space="preserve">
+          <source>Cancel</source>
+          <target state="new">Cancel</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitleFileName" translate="yes" xml:space="preserve">
+          <source>File Name</source>
+          <target state="new">File Name</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitlePageRange" translate="yes" xml:space="preserve">
+          <source>Page Range</source>
+          <target state="new">Page Range</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitleSize" translate="yes" xml:space="preserve">
+          <source>Size</source>
+          <target state="new">Size</target>
+        </trans-unit>
+        <trans-unit id="Merge_Yes" translate="yes" xml:space="preserve">
+          <source>Merge</source>
+          <target state="new">Merge</target>
+        </trans-unit>
+        <trans-unit id="Outline_Add" translate="yes" xml:space="preserve">
+          <source>Add Item</source>
+          <target state="new">Add Item</target>
+        </trans-unit>
+        <trans-unit id="Outline_AddLevel" translate="yes" xml:space="preserve">
+          <source>Add To Higher Level</source>
+          <target state="new">Add To Higher Level</target>
+        </trans-unit>
+        <trans-unit id="Outline_AddSub" translate="yes" xml:space="preserve">
+          <source>Add Sub-Item</source>
+          <target state="new">Add Sub-Item</target>
+        </trans-unit>
+        <trans-unit id="Outline_Change" translate="yes" xml:space="preserve">
+          <source>Change Destination</source>
+          <target state="new">Change Destination</target>
+        </trans-unit>
+        <trans-unit id="Outline_Collapse" translate="yes" xml:space="preserve">
+          <source>Collapse All</source>
+          <target state="new">Collapse All</target>
+        </trans-unit>
+        <trans-unit id="Outline_Delete" translate="yes" xml:space="preserve">
+          <source>Delete</source>
+          <target state="new">Delete</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogContent" translate="yes" xml:space="preserve">
+          <source>Are you sure you want to set the destination as the current location?</source>
+          <target state="new">Are you sure you want to set the destination as the current location?</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogNO" translate="yes" xml:space="preserve">
+          <source>No</source>
+          <target state="new">No</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogYes" translate="yes" xml:space="preserve">
+          <source>Yes</source>
+          <target state="new">Yes</target>
+        </trans-unit>
+        <trans-unit id="Outline_Down" translate="yes" xml:space="preserve">
+          <source>Demote</source>
+          <target state="new">Demote</target>
+        </trans-unit>
+        <trans-unit id="Outline_Expand" translate="yes" xml:space="preserve">
+          <source>Expand All</source>
+          <target state="new">Expand All</target>
+        </trans-unit>
+        <trans-unit id="Outline_RemoveAll" translate="yes" xml:space="preserve">
+          <source>Remove All Outlines</source>
+          <target state="new">Remove All Outlines</target>
+        </trans-unit>
+        <trans-unit id="Outline_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+        </trans-unit>
+        <trans-unit id="Outline_Title" translate="yes" xml:space="preserve">
+          <source>Outline</source>
+          <target state="new">Outline</target>
+        </trans-unit>
+        <trans-unit id="Outline_Up" translate="yes" xml:space="preserve">
+          <source>Promote</source>
+          <target state="new">Promote</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogClear" translate="yes" xml:space="preserve">
+          <source>Clear</source>
+          <target state="new">Clear</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogDraw" translate="yes" xml:space="preserve">
+          <source>Drawing</source>
+          <target state="new">Drawing</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">手绘分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogDrawHint" translate="yes" xml:space="preserve">
+          <source>Sign here</source>
+          <target state="new">Sign here</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogNo" translate="yes" xml:space="preserve">
+          <source>Cancel</source>
+          <target state="new">Cancel</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPicture" translate="yes" xml:space="preserve">
+          <source>Image</source>
+          <target state="new">Image</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">图片分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureHint" translate="yes" xml:space="preserve">
+          <source>Select image file</source>
+          <target state="new">Select image file</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReBkg" translate="yes" xml:space="preserve">
+          <source>Remove Background</source>
+          <target state="new">Remove Background</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">去背功能按钮描述</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReBkgHint" translate="yes" xml:space="preserve">
+          <source>Remove white background from images</source>
+          <target state="new">Remove white background from images</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">去背功能按钮悬浮提示</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReselect" translate="yes" xml:space="preserve">
+          <source>Reselect</source>
+          <target state="new">Reselect</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogText" translate="yes" xml:space="preserve">
+          <source>Keyboard</source>
+          <target state="new">Keyboard</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">文字分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogTextHint" translate="yes" xml:space="preserve">
+          <source>Enter your signature here</source>
+          <target state="new">Enter your signature here</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogTitle" translate="yes" xml:space="preserve">
+          <source>Create New Signature</source>
+          <target state="new">Create New Signature</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogYes" translate="yes" xml:space="preserve">
+          <source>Apply</source>
+          <target state="new">Apply</target>
+        </trans-unit>
+        <trans-unit id="Signatur_Title" translate="yes" xml:space="preserve">
+          <source>Signature</source>
+          <target state="new">Signature</target>
+        </trans-unit>
+        <trans-unit id="Stamp_Title" translate="yes" xml:space="preserve">
+          <source>Stamp</source>
+          <target state="new">Stamp</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_AllPage" translate="yes" xml:space="preserve">
+          <source>All pages</source>
+          <target state="new">All pages</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_CustomRange" translate="yes" xml:space="preserve">
+          <source>Custom Range</source>
+          <target state="new">Custom Range</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_EvenPage" translate="yes" xml:space="preserve">
+          <source>Even Pages</source>
+          <target state="new">Even Pages</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_OddPage" translate="yes" xml:space="preserve">
+          <source>Odd Pages</source>
+          <target state="new">Odd Pages</target>
+        </trans-unit>
+        <trans-unit id="Merge_AddFolder" translate="yes" xml:space="preserve">
+          <source>Add Folder</source>
+          <target state="new">Add Folder</target>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ Close" translate="yes" xml:space="preserve">
+          <source>Close Tab</source>
+          <target state="new">Close Tab</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-关闭当前页</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ CloseAll" translate="yes" xml:space="preserve">
+          <source>Close All Tabs</source>
+          <target state="new">Close All Tabs</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-关闭全部</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ Folder" translate="yes" xml:space="preserve">
+          <source>Show in Folder</source>
+          <target state="new">Show in Folder</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-打开所在文件夹</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-重命名</note>
+        </trans-unit>
+        <trans-unit id="HomeTool_Title" translate="yes" xml:space="preserve">
+          <source>Quick Tools</source>
+          <target state="new">Quick Tools</target>
+        </trans-unit>
+        <trans-unit id="Home_OpenFiles" translate="yes" xml:space="preserve">
+          <source>Open Files</source>
+          <target state="new">Open Files</target>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_Default" translate="yes" xml:space="preserve">
+          <source>Home</source>
+          <target state="new">Home</target>
+        </trans-unit>
+        <trans-unit id="Home_CreatePDF" translate="yes" xml:space="preserve">
+          <source>Create PDF</source>
+          <target state="new">Create PDF</target>
+        </trans-unit>
+        <trans-unit id="Home_CreateToNew" translate="yes" xml:space="preserve">
+          <source>New Blank Page</source>
+          <target state="new">New Blank Page</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">下拉菜单-新建空白文档</note>
+        </trans-unit>
+        <trans-unit id="HomeList_MenuRemove" translate="yes" xml:space="preserve">
+          <source>Remove from Recents</source>
+          <target state="new">Remove from Recents</target>
+        </trans-unit>
+        <trans-unit id="HomeList_MenuShow" translate="yes" xml:space="preserve">
+          <source>Show in Folder</source>
+          <target state="new">Show in Folder</target>
+        </trans-unit>
+        <trans-unit id="HomeList_Title" translate="yes" xml:space="preserve">
+          <source>Recents</source>
+          <target state="new">Recents</target>
+        </trans-unit>
+        <trans-unit id="HomeList_NoFilesContent" translate="yes" xml:space="preserve">
+          <source>Click “Open Files” or drag file here to open</source>
+          <target state="new">Click “Open Files” or drag file here to open</target>
+        </trans-unit>
+        <trans-unit id="HomeList_NoFilesTitle" translate="yes" xml:space="preserve">
+          <source>No recently opened files</source>
+          <target state="new">No recently opened files</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Annotation" translate="yes" xml:space="preserve">
+          <source>Annotation</source>
+          <target state="new">Annotation</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Converter" translate="yes" xml:space="preserve">
+          <source>Converter</source>
+          <target state="new">Converter</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_File" translate="yes" xml:space="preserve">
+          <source>File</source>
+          <target state="new">File</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">阅读页顶部工具栏的文件按钮</note>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Fill&amp;amp;Sign" translate="yes" xml:space="preserve">
+          <source>Fill&amp;Sign</source>
+          <target state="new">Fill&amp;Sign</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_PageEdit" translate="yes" xml:space="preserve">
+          <source>Page Edit</source>
+          <target state="new">Page Edit</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Print" translate="yes" xml:space="preserve">
+          <source>Print</source>
+          <target state="new">Print</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Properties" translate="yes" xml:space="preserve">
+          <source>Properties</source>
+          <target state="new">Properties</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Redo" translate="yes" xml:space="preserve">
+          <source>Redo</source>
+          <target state="new">Redo</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Save" translate="yes" xml:space="preserve">
+          <source>Save</source>
+          <target state="new">Save</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Share" translate="yes" xml:space="preserve">
+          <source>Share</source>
+          <target state="new">Share</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Tools" translate="yes" xml:space="preserve">
+          <source>Tools</source>
+          <target state="new">Tools</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Undo" translate="yes" xml:space="preserve">
+          <source>Undo</source>
+          <target state="new">Undo</target>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="en" original="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" datatype="resx" />
+    </body>
+  </file>
+</xliff>

+ 369 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
+  <file datatype="xml" source-language="en-US" target-language="zh-Hans" original="PDF OFFICE/PROPERTIES/RESOURCES.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/PROPERTIES/RESOURCES.RESX" datatype="resx">
+        <trans-unit id="excelex" translate="yes" xml:space="preserve">
+          <source>*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</source>
+          <target state="new">*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的excel文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="htmlex" translate="yes" xml:space="preserve">
+          <source>*.html;</source>
+          <target state="new">*.html;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的html格式</note>
+        </trans-unit>
+        <trans-unit id="imageex" translate="yes" xml:space="preserve">
+          <source>*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</source>
+          <target state="new">*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</target>
+        </trans-unit>
+        <trans-unit id="OpenDialogFilter" translate="yes" xml:space="preserve">
+          <source>PDF Files (*.pdf)|*.pdf</source>
+          <target state="new">PDF Files (*.pdf)|*.pdf</target>
+        </trans-unit>
+        <trans-unit id="pptex" translate="yes" xml:space="preserve">
+          <source>*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</source>
+          <target state="new">*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的ppt文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="SDKLisence" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+          <source>..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</source>
+          <target state="needs-review-translation">..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</target>
+        </trans-unit>
+        <trans-unit id="txtex" translate="yes" xml:space="preserve">
+          <source>*.txt;</source>
+          <target state="new">*.txt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的txt格式</note>
+        </trans-unit>
+        <trans-unit id="wordex" translate="yes" xml:space="preserve">
+          <source>*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</source>
+          <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hans" original="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hans" original="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" datatype="resx">
+        <trans-unit id="Merge_AddFiles" translate="yes" xml:space="preserve">
+          <source>Add Files</source>
+          <target state="new">Add Files</target>
+        </trans-unit>
+        <trans-unit id="Merge_AddOpenFile" translate="yes" xml:space="preserve">
+          <source>Add an Open File</source>
+          <target state="new">Add an Open File</target>
+        </trans-unit>
+        <trans-unit id="Merge_Hint" translate="yes" xml:space="preserve">
+          <source>Selected files
+Drop files here or Click “Add Files” at bottom right button. 
+Drag files to reorder as you need.</source>
+          <target state="new">Selected files
+Drop files here or Click “Add Files” at bottom right button. 
+Drag files to reorder as you need.</target>
+        </trans-unit>
+        <trans-unit id="Merge_ItemPages" translate="yes" xml:space="preserve">
+          <source>Pages</source>
+          <target state="new">Pages</target>
+        </trans-unit>
+        <trans-unit id="Merge_No" translate="yes" xml:space="preserve">
+          <source>Cancel</source>
+          <target state="new">Cancel</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitleFileName" translate="yes" xml:space="preserve">
+          <source>File Name</source>
+          <target state="new">File Name</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitlePageRange" translate="yes" xml:space="preserve">
+          <source>Page Range</source>
+          <target state="new">Page Range</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitleSize" translate="yes" xml:space="preserve">
+          <source>Size</source>
+          <target state="new">Size</target>
+        </trans-unit>
+        <trans-unit id="Merge_Yes" translate="yes" xml:space="preserve">
+          <source>Merge</source>
+          <target state="new">Merge</target>
+        </trans-unit>
+        <trans-unit id="Outline_Add" translate="yes" xml:space="preserve">
+          <source>Add Item</source>
+          <target state="new">Add Item</target>
+        </trans-unit>
+        <trans-unit id="Outline_AddLevel" translate="yes" xml:space="preserve">
+          <source>Add To Higher Level</source>
+          <target state="new">Add To Higher Level</target>
+        </trans-unit>
+        <trans-unit id="Outline_AddSub" translate="yes" xml:space="preserve">
+          <source>Add Sub-Item</source>
+          <target state="new">Add Sub-Item</target>
+        </trans-unit>
+        <trans-unit id="Outline_Change" translate="yes" xml:space="preserve">
+          <source>Change Destination</source>
+          <target state="new">Change Destination</target>
+        </trans-unit>
+        <trans-unit id="Outline_Collapse" translate="yes" xml:space="preserve">
+          <source>Collapse All</source>
+          <target state="new">Collapse All</target>
+        </trans-unit>
+        <trans-unit id="Outline_Delete" translate="yes" xml:space="preserve">
+          <source>Delete</source>
+          <target state="new">Delete</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogContent" translate="yes" xml:space="preserve">
+          <source>Are you sure you want to set the destination as the current location?</source>
+          <target state="new">Are you sure you want to set the destination as the current location?</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogNO" translate="yes" xml:space="preserve">
+          <source>No</source>
+          <target state="new">No</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogYes" translate="yes" xml:space="preserve">
+          <source>Yes</source>
+          <target state="new">Yes</target>
+        </trans-unit>
+        <trans-unit id="Outline_Down" translate="yes" xml:space="preserve">
+          <source>Demote</source>
+          <target state="new">Demote</target>
+        </trans-unit>
+        <trans-unit id="Outline_Expand" translate="yes" xml:space="preserve">
+          <source>Expand All</source>
+          <target state="new">Expand All</target>
+        </trans-unit>
+        <trans-unit id="Outline_RemoveAll" translate="yes" xml:space="preserve">
+          <source>Remove All Outlines</source>
+          <target state="new">Remove All Outlines</target>
+        </trans-unit>
+        <trans-unit id="Outline_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+        </trans-unit>
+        <trans-unit id="Outline_Title" translate="yes" xml:space="preserve">
+          <source>Outline</source>
+          <target state="new">Outline</target>
+        </trans-unit>
+        <trans-unit id="Outline_Up" translate="yes" xml:space="preserve">
+          <source>Promote</source>
+          <target state="new">Promote</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogClear" translate="yes" xml:space="preserve">
+          <source>Clear</source>
+          <target state="new">Clear</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogDraw" translate="yes" xml:space="preserve">
+          <source>Drawing</source>
+          <target state="new">Drawing</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">手绘分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogDrawHint" translate="yes" xml:space="preserve">
+          <source>Sign here</source>
+          <target state="new">Sign here</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogNo" translate="yes" xml:space="preserve">
+          <source>Cancel</source>
+          <target state="new">Cancel</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPicture" translate="yes" xml:space="preserve">
+          <source>Image</source>
+          <target state="new">Image</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">图片分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureHint" translate="yes" xml:space="preserve">
+          <source>Select image file</source>
+          <target state="new">Select image file</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReBkg" translate="yes" xml:space="preserve">
+          <source>Remove Background</source>
+          <target state="new">Remove Background</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">去背功能按钮描述</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReBkgHint" translate="yes" xml:space="preserve">
+          <source>Remove white background from images</source>
+          <target state="new">Remove white background from images</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">去背功能按钮悬浮提示</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReselect" translate="yes" xml:space="preserve">
+          <source>Reselect</source>
+          <target state="new">Reselect</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogText" translate="yes" xml:space="preserve">
+          <source>Keyboard</source>
+          <target state="new">Keyboard</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">文字分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogTextHint" translate="yes" xml:space="preserve">
+          <source>Enter your signature here</source>
+          <target state="new">Enter your signature here</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogTitle" translate="yes" xml:space="preserve">
+          <source>Create New Signature</source>
+          <target state="new">Create New Signature</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogYes" translate="yes" xml:space="preserve">
+          <source>Apply</source>
+          <target state="new">Apply</target>
+        </trans-unit>
+        <trans-unit id="Signatur_Title" translate="yes" xml:space="preserve">
+          <source>Signature</source>
+          <target state="new">Signature</target>
+        </trans-unit>
+        <trans-unit id="Stamp_Title" translate="yes" xml:space="preserve">
+          <source>Stamp</source>
+          <target state="new">Stamp</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_AllPage" translate="yes" xml:space="preserve">
+          <source>All pages</source>
+          <target state="new">All pages</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_CustomRange" translate="yes" xml:space="preserve">
+          <source>Custom Range</source>
+          <target state="new">Custom Range</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_EvenPage" translate="yes" xml:space="preserve">
+          <source>Even Pages</source>
+          <target state="new">Even Pages</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_OddPage" translate="yes" xml:space="preserve">
+          <source>Odd Pages</source>
+          <target state="new">Odd Pages</target>
+        </trans-unit>
+        <trans-unit id="Merge_AddFolder" translate="yes" xml:space="preserve">
+          <source>Add Folder</source>
+          <target state="new">Add Folder</target>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ Close" translate="yes" xml:space="preserve">
+          <source>Close Tab</source>
+          <target state="new">Close Tab</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-关闭当前页</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ CloseAll" translate="yes" xml:space="preserve">
+          <source>Close All Tabs</source>
+          <target state="new">Close All Tabs</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-关闭全部</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ Folder" translate="yes" xml:space="preserve">
+          <source>Show in Folder</source>
+          <target state="new">Show in Folder</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-打开所在文件夹</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-重命名</note>
+        </trans-unit>
+        <trans-unit id="HomeTool_Title" translate="yes" xml:space="preserve">
+          <source>Quick Tools</source>
+          <target state="new">Quick Tools</target>
+        </trans-unit>
+        <trans-unit id="Home_OpenFiles" translate="yes" xml:space="preserve">
+          <source>Open Files</source>
+          <target state="new">Open Files</target>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_Default" translate="yes" xml:space="preserve">
+          <source>Home</source>
+          <target state="new">Home</target>
+        </trans-unit>
+        <trans-unit id="Home_CreatePDF" translate="yes" xml:space="preserve">
+          <source>Create PDF</source>
+          <target state="new">Create PDF</target>
+        </trans-unit>
+        <trans-unit id="Home_CreateToNew" translate="yes" xml:space="preserve">
+          <source>New Blank Page</source>
+          <target state="new">New Blank Page</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">下拉菜单-新建空白文档</note>
+        </trans-unit>
+        <trans-unit id="HomeList_MenuRemove" translate="yes" xml:space="preserve">
+          <source>Remove from Recents</source>
+          <target state="new">Remove from Recents</target>
+        </trans-unit>
+        <trans-unit id="HomeList_MenuShow" translate="yes" xml:space="preserve">
+          <source>Show in Folder</source>
+          <target state="new">Show in Folder</target>
+        </trans-unit>
+        <trans-unit id="HomeList_Title" translate="yes" xml:space="preserve">
+          <source>Recents</source>
+          <target state="new">Recents</target>
+        </trans-unit>
+        <trans-unit id="HomeList_NoFilesContent" translate="yes" xml:space="preserve">
+          <source>Click “Open Files” or drag file here to open</source>
+          <target state="new">Click “Open Files” or drag file here to open</target>
+        </trans-unit>
+        <trans-unit id="HomeList_NoFilesTitle" translate="yes" xml:space="preserve">
+          <source>No recently opened files</source>
+          <target state="new">No recently opened files</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Annotation" translate="yes" xml:space="preserve">
+          <source>Annotation</source>
+          <target state="new">Annotation</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Converter" translate="yes" xml:space="preserve">
+          <source>Converter</source>
+          <target state="new">Converter</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_File" translate="yes" xml:space="preserve">
+          <source>File</source>
+          <target state="new">File</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">阅读页顶部工具栏的文件按钮</note>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Fill&amp;amp;Sign" translate="yes" xml:space="preserve">
+          <source>Fill&amp;Sign</source>
+          <target state="new">Fill&amp;Sign</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_PageEdit" translate="yes" xml:space="preserve">
+          <source>Page Edit</source>
+          <target state="new">Page Edit</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Print" translate="yes" xml:space="preserve">
+          <source>Print</source>
+          <target state="new">Print</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Properties" translate="yes" xml:space="preserve">
+          <source>Properties</source>
+          <target state="new">Properties</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Redo" translate="yes" xml:space="preserve">
+          <source>Redo</source>
+          <target state="new">Redo</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Save" translate="yes" xml:space="preserve">
+          <source>Save</source>
+          <target state="new">Save</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Share" translate="yes" xml:space="preserve">
+          <source>Share</source>
+          <target state="new">Share</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Tools" translate="yes" xml:space="preserve">
+          <source>Tools</source>
+          <target state="new">Tools</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Undo" translate="yes" xml:space="preserve">
+          <source>Undo</source>
+          <target state="new">Undo</target>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hans" original="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" datatype="resx" />
+    </body>
+  </file>
+</xliff>

+ 369 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
+  <file datatype="xml" source-language="en-US" target-language="zh-Hant" original="PDF OFFICE/PROPERTIES/RESOURCES.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/PROPERTIES/RESOURCES.RESX" datatype="resx">
+        <trans-unit id="excelex" translate="yes" xml:space="preserve">
+          <source>*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</source>
+          <target state="new">*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的excel文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="htmlex" translate="yes" xml:space="preserve">
+          <source>*.html;</source>
+          <target state="new">*.html;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的html格式</note>
+        </trans-unit>
+        <trans-unit id="imageex" translate="yes" xml:space="preserve">
+          <source>*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</source>
+          <target state="new">*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</target>
+        </trans-unit>
+        <trans-unit id="OpenDialogFilter" translate="yes" xml:space="preserve">
+          <source>PDF Files (*.pdf)|*.pdf</source>
+          <target state="new">PDF Files (*.pdf)|*.pdf</target>
+        </trans-unit>
+        <trans-unit id="pptex" translate="yes" xml:space="preserve">
+          <source>*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</source>
+          <target state="new">*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的ppt文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="SDKLisence" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+          <source>..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</source>
+          <target state="needs-review-translation">..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</target>
+        </trans-unit>
+        <trans-unit id="txtex" translate="yes" xml:space="preserve">
+          <source>*.txt;</source>
+          <target state="new">*.txt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的txt格式</note>
+        </trans-unit>
+        <trans-unit id="wordex" translate="yes" xml:space="preserve">
+          <source>*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</source>
+          <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hant" original="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hant" original="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" datatype="resx">
+        <trans-unit id="Merge_AddFiles" translate="yes" xml:space="preserve">
+          <source>Add Files</source>
+          <target state="new">Add Files</target>
+        </trans-unit>
+        <trans-unit id="Merge_AddOpenFile" translate="yes" xml:space="preserve">
+          <source>Add an Open File</source>
+          <target state="new">Add an Open File</target>
+        </trans-unit>
+        <trans-unit id="Merge_Hint" translate="yes" xml:space="preserve">
+          <source>Selected files
+Drop files here or Click “Add Files” at bottom right button. 
+Drag files to reorder as you need.</source>
+          <target state="new">Selected files
+Drop files here or Click “Add Files” at bottom right button. 
+Drag files to reorder as you need.</target>
+        </trans-unit>
+        <trans-unit id="Merge_ItemPages" translate="yes" xml:space="preserve">
+          <source>Pages</source>
+          <target state="new">Pages</target>
+        </trans-unit>
+        <trans-unit id="Merge_No" translate="yes" xml:space="preserve">
+          <source>Cancel</source>
+          <target state="new">Cancel</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitleFileName" translate="yes" xml:space="preserve">
+          <source>File Name</source>
+          <target state="new">File Name</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitlePageRange" translate="yes" xml:space="preserve">
+          <source>Page Range</source>
+          <target state="new">Page Range</target>
+        </trans-unit>
+        <trans-unit id="Merge_TitleSize" translate="yes" xml:space="preserve">
+          <source>Size</source>
+          <target state="new">Size</target>
+        </trans-unit>
+        <trans-unit id="Merge_Yes" translate="yes" xml:space="preserve">
+          <source>Merge</source>
+          <target state="new">Merge</target>
+        </trans-unit>
+        <trans-unit id="Outline_Add" translate="yes" xml:space="preserve">
+          <source>Add Item</source>
+          <target state="new">Add Item</target>
+        </trans-unit>
+        <trans-unit id="Outline_AddLevel" translate="yes" xml:space="preserve">
+          <source>Add To Higher Level</source>
+          <target state="new">Add To Higher Level</target>
+        </trans-unit>
+        <trans-unit id="Outline_AddSub" translate="yes" xml:space="preserve">
+          <source>Add Sub-Item</source>
+          <target state="new">Add Sub-Item</target>
+        </trans-unit>
+        <trans-unit id="Outline_Change" translate="yes" xml:space="preserve">
+          <source>Change Destination</source>
+          <target state="new">Change Destination</target>
+        </trans-unit>
+        <trans-unit id="Outline_Collapse" translate="yes" xml:space="preserve">
+          <source>Collapse All</source>
+          <target state="new">Collapse All</target>
+        </trans-unit>
+        <trans-unit id="Outline_Delete" translate="yes" xml:space="preserve">
+          <source>Delete</source>
+          <target state="new">Delete</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogContent" translate="yes" xml:space="preserve">
+          <source>Are you sure you want to set the destination as the current location?</source>
+          <target state="new">Are you sure you want to set the destination as the current location?</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogNO" translate="yes" xml:space="preserve">
+          <source>No</source>
+          <target state="new">No</target>
+        </trans-unit>
+        <trans-unit id="Outline_DialogYes" translate="yes" xml:space="preserve">
+          <source>Yes</source>
+          <target state="new">Yes</target>
+        </trans-unit>
+        <trans-unit id="Outline_Down" translate="yes" xml:space="preserve">
+          <source>Demote</source>
+          <target state="new">Demote</target>
+        </trans-unit>
+        <trans-unit id="Outline_Expand" translate="yes" xml:space="preserve">
+          <source>Expand All</source>
+          <target state="new">Expand All</target>
+        </trans-unit>
+        <trans-unit id="Outline_RemoveAll" translate="yes" xml:space="preserve">
+          <source>Remove All Outlines</source>
+          <target state="new">Remove All Outlines</target>
+        </trans-unit>
+        <trans-unit id="Outline_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+        </trans-unit>
+        <trans-unit id="Outline_Title" translate="yes" xml:space="preserve">
+          <source>Outline</source>
+          <target state="new">Outline</target>
+        </trans-unit>
+        <trans-unit id="Outline_Up" translate="yes" xml:space="preserve">
+          <source>Promote</source>
+          <target state="new">Promote</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogClear" translate="yes" xml:space="preserve">
+          <source>Clear</source>
+          <target state="new">Clear</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogDraw" translate="yes" xml:space="preserve">
+          <source>Drawing</source>
+          <target state="new">Drawing</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">手绘分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogDrawHint" translate="yes" xml:space="preserve">
+          <source>Sign here</source>
+          <target state="new">Sign here</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogNo" translate="yes" xml:space="preserve">
+          <source>Cancel</source>
+          <target state="new">Cancel</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPicture" translate="yes" xml:space="preserve">
+          <source>Image</source>
+          <target state="new">Image</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">图片分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureHint" translate="yes" xml:space="preserve">
+          <source>Select image file</source>
+          <target state="new">Select image file</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReBkg" translate="yes" xml:space="preserve">
+          <source>Remove Background</source>
+          <target state="new">Remove Background</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">去背功能按钮描述</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReBkgHint" translate="yes" xml:space="preserve">
+          <source>Remove white background from images</source>
+          <target state="new">Remove white background from images</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">去背功能按钮悬浮提示</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogPictureReselect" translate="yes" xml:space="preserve">
+          <source>Reselect</source>
+          <target state="new">Reselect</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogText" translate="yes" xml:space="preserve">
+          <source>Keyboard</source>
+          <target state="new">Keyboard</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">文字分类</note>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogTextHint" translate="yes" xml:space="preserve">
+          <source>Enter your signature here</source>
+          <target state="new">Enter your signature here</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogTitle" translate="yes" xml:space="preserve">
+          <source>Create New Signature</source>
+          <target state="new">Create New Signature</target>
+        </trans-unit>
+        <trans-unit id="Signatur_DialogYes" translate="yes" xml:space="preserve">
+          <source>Apply</source>
+          <target state="new">Apply</target>
+        </trans-unit>
+        <trans-unit id="Signatur_Title" translate="yes" xml:space="preserve">
+          <source>Signature</source>
+          <target state="new">Signature</target>
+        </trans-unit>
+        <trans-unit id="Stamp_Title" translate="yes" xml:space="preserve">
+          <source>Stamp</source>
+          <target state="new">Stamp</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_AllPage" translate="yes" xml:space="preserve">
+          <source>All pages</source>
+          <target state="new">All pages</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_CustomRange" translate="yes" xml:space="preserve">
+          <source>Custom Range</source>
+          <target state="new">Custom Range</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_EvenPage" translate="yes" xml:space="preserve">
+          <source>Even Pages</source>
+          <target state="new">Even Pages</target>
+        </trans-unit>
+        <trans-unit id="WritableComboBox_OddPage" translate="yes" xml:space="preserve">
+          <source>Odd Pages</source>
+          <target state="new">Odd Pages</target>
+        </trans-unit>
+        <trans-unit id="Merge_AddFolder" translate="yes" xml:space="preserve">
+          <source>Add Folder</source>
+          <target state="new">Add Folder</target>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ Close" translate="yes" xml:space="preserve">
+          <source>Close Tab</source>
+          <target state="new">Close Tab</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-关闭当前页</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ CloseAll" translate="yes" xml:space="preserve">
+          <source>Close All Tabs</source>
+          <target state="new">Close All Tabs</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-关闭全部</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_ Folder" translate="yes" xml:space="preserve">
+          <source>Show in Folder</source>
+          <target state="new">Show in Folder</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-打开所在文件夹</note>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_Rename" translate="yes" xml:space="preserve">
+          <source>Rename</source>
+          <target state="new">Rename</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">右键菜单-重命名</note>
+        </trans-unit>
+        <trans-unit id="HomeTool_Title" translate="yes" xml:space="preserve">
+          <source>Quick Tools</source>
+          <target state="new">Quick Tools</target>
+        </trans-unit>
+        <trans-unit id="Home_OpenFiles" translate="yes" xml:space="preserve">
+          <source>Open Files</source>
+          <target state="new">Open Files</target>
+        </trans-unit>
+        <trans-unit id="MultipleTabs_Default" translate="yes" xml:space="preserve">
+          <source>Home</source>
+          <target state="new">Home</target>
+        </trans-unit>
+        <trans-unit id="Home_CreatePDF" translate="yes" xml:space="preserve">
+          <source>Create PDF</source>
+          <target state="new">Create PDF</target>
+        </trans-unit>
+        <trans-unit id="Home_CreateToNew" translate="yes" xml:space="preserve">
+          <source>New Blank Page</source>
+          <target state="new">New Blank Page</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">下拉菜单-新建空白文档</note>
+        </trans-unit>
+        <trans-unit id="HomeList_MenuRemove" translate="yes" xml:space="preserve">
+          <source>Remove from Recents</source>
+          <target state="new">Remove from Recents</target>
+        </trans-unit>
+        <trans-unit id="HomeList_MenuShow" translate="yes" xml:space="preserve">
+          <source>Show in Folder</source>
+          <target state="new">Show in Folder</target>
+        </trans-unit>
+        <trans-unit id="HomeList_Title" translate="yes" xml:space="preserve">
+          <source>Recents</source>
+          <target state="new">Recents</target>
+        </trans-unit>
+        <trans-unit id="HomeList_NoFilesContent" translate="yes" xml:space="preserve">
+          <source>Click “Open Files” or drag file here to open</source>
+          <target state="new">Click “Open Files” or drag file here to open</target>
+        </trans-unit>
+        <trans-unit id="HomeList_NoFilesTitle" translate="yes" xml:space="preserve">
+          <source>No recently opened files</source>
+          <target state="new">No recently opened files</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Annotation" translate="yes" xml:space="preserve">
+          <source>Annotation</source>
+          <target state="new">Annotation</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Converter" translate="yes" xml:space="preserve">
+          <source>Converter</source>
+          <target state="new">Converter</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_File" translate="yes" xml:space="preserve">
+          <source>File</source>
+          <target state="new">File</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">阅读页顶部工具栏的文件按钮</note>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Fill&amp;amp;Sign" translate="yes" xml:space="preserve">
+          <source>Fill&amp;Sign</source>
+          <target state="new">Fill&amp;Sign</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_PageEdit" translate="yes" xml:space="preserve">
+          <source>Page Edit</source>
+          <target state="new">Page Edit</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Print" translate="yes" xml:space="preserve">
+          <source>Print</source>
+          <target state="new">Print</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Properties" translate="yes" xml:space="preserve">
+          <source>Properties</source>
+          <target state="new">Properties</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Redo" translate="yes" xml:space="preserve">
+          <source>Redo</source>
+          <target state="new">Redo</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Save" translate="yes" xml:space="preserve">
+          <source>Save</source>
+          <target state="new">Save</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Share" translate="yes" xml:space="preserve">
+          <source>Share</source>
+          <target state="new">Share</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Tools" translate="yes" xml:space="preserve">
+          <source>Tools</source>
+          <target state="new">Tools</target>
+        </trans-unit>
+        <trans-unit id="ViewTopToolbar_Undo" translate="yes" xml:space="preserve">
+          <source>Undo</source>
+          <target state="new">Undo</target>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hant" original="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" datatype="resx" />
+    </body>
+  </file>
+</xliff>

+ 76 - 3
PDF Office/PDF Office.csproj

@@ -58,6 +58,12 @@
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
+  <PropertyGroup Label="MultilingualAppToolkit">
+    <MultilingualAppToolkitVersion>4.0</MultilingualAppToolkitVersion>
+    <MultilingualFallbackLanguage>en-US</MultilingualFallbackLanguage>
+    <TranslationReport Condition="'$(Configuration)' == 'Release'">true</TranslationReport>
+    <SuppressPseudoWarning Condition="'$(Configuration)' == 'Debug'">true</SuppressPseudoWarning>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="ComDocumentAIKit, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -145,6 +151,9 @@
     <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
+    <Reference Include="NTwain, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>packages\NTwain.3.7.2\lib\net462\NTwain.dll</HintPath>
+    </Reference>
     <Reference Include="office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
       <EmbedInteropTypes>True</EmbedInteropTypes>
     </Reference>
@@ -233,6 +242,9 @@
     <Compile Include="CustomControl\CommonWritableComboBox.xaml.cs">
       <DependentUpon>CommonWritableComboBox.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\CompositeControl\ColorMenuItem.xaml.cs">
+      <DependentUpon>ColorMenuItem.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\CompositeControl\ColorSubContent.xaml.cs">
       <DependentUpon>ColorSubContent.xaml</DependentUpon>
     </Compile>
@@ -306,6 +318,7 @@
     <Compile Include="DataConvert\SignatureButtonConvert.cs" />
     <Compile Include="DataConvert\StringToDateConvert.cs" />
     <Compile Include="DataConvert\StringToVisibleConvert.cs" />
+    <Compile Include="DataConvert\TextAlignToCheckedConverter.cs" />
     <Compile Include="DataConvert\UnVisivleConvert.cs" />
     <Compile Include="DataConvert\WidthConvert.cs" />
     <Compile Include="EventAggregators\EditToolsEvent.cs" />
@@ -318,6 +331,7 @@
     <Compile Include="EventAggregators\SplitEvent.cs" />
     <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
+    <Compile Include="Helper\CropPageUndoManager.cs" />
     <Compile Include="Helper\Win32Helper.cs" />
     <Compile Include="Helper\DpiHelpers.cs" />
     <Compile Include="Helper\EditToolsHelper.cs" />
@@ -416,7 +430,23 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
+    <Compile Include="Strings\HomePage\HomePage.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>HomePage.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Strings\MainPage\MainPage.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>MainPage.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Strings\Service\Service.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Service.resx</DependentUpon>
+    </Compile>
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromHtmlDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromScannerDialogsViewModel.cs" />
     <Compile Include="ViewModels\Dialog\PropertiesDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\Redaction\MarkSettingDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\Redaction\PageMarkDialogViewModel.cs" />
@@ -512,7 +542,7 @@
     <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\AnnotPanel\SignatureCreateDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\SignatureCreateDialogViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SnapshotEditMenuViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\StickyNotePropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageEditPropertyViewModel.cs" />
@@ -664,6 +694,9 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\CreateFromHtmlDialog.xaml.cs">
       <DependentUpon>CreateFromHtmlDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\CreateFromScannerDialogs.xaml.cs">
+      <DependentUpon>CreateFromScannerDialogs.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateBaseContent.xaml.cs">
       <DependentUpon>HomePageBackgroundCreateBaseContent.xaml</DependentUpon>
     </Compile>
@@ -1059,7 +1092,7 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\SignatureAnnotProperty.xaml.cs">
       <DependentUpon>SignatureAnnotProperty.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\SignatureCreateDialog.xaml.cs">
+    <Compile Include="Views\Dialog\SignatureCreateDialog.xaml.cs">
       <DependentUpon>SignatureCreateDialog.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\SnapshotEditMenu.xaml.cs">
@@ -1169,6 +1202,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="CustomControl\CompositeControl\ColorMenuItem.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="CustomControl\CompositeControl\ColorSubContent.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -1413,6 +1450,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\CreateFromScannerDialogs.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateBaseContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1844,7 +1885,7 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\SignatureCreateDialog.xaml">
+    <Page Include="Views\Dialog\SignatureCreateDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -2101,6 +2142,7 @@
     <Content Include="ComDocumentAIKit.dll">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <None Include="source\models\OCR.model" />
     <Resource Include="Resources\ToolBarIcon\Scan\enhance.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Resource>
@@ -2114,6 +2156,7 @@
     <Resource Include="Resources\PropertyPanel\nosign.png" />
     <Resource Include="Resources\Dialog\password.png" />
     <Resource Include="Resources\BOTA\no search.png" />
+    <Resource Include="Resources\Dialog\helphover.png" />
     <Content Include="source\AnalysisWord\Res\word\_rels\document.xml.rels">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
@@ -2469,6 +2512,27 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
+    <EmbeddedResource Include="Strings\HomePage\HomePage.en.resx" />
+    <EmbeddedResource Include="Strings\HomePage\HomePage.resx">
+      <Generator>PublicResXFileCodeGenerator</Generator>
+      <LastGenOutput>HomePage.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Strings\HomePage\HomePage.zh-Hans.resx" />
+    <EmbeddedResource Include="Strings\HomePage\HomePage.zh-Hant.resx" />
+    <EmbeddedResource Include="Strings\MainPage\MainPage.en.resx" />
+    <EmbeddedResource Include="Strings\MainPage\MainPage.resx">
+      <Generator>PublicResXFileCodeGenerator</Generator>
+      <LastGenOutput>MainPage.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Strings\MainPage\MainPage.zh-Hans.resx" />
+    <EmbeddedResource Include="Strings\MainPage\MainPage.zh-Hant.resx" />
+    <EmbeddedResource Include="Strings\Service\Service.en.resx" />
+    <EmbeddedResource Include="Strings\Service\Service.resx">
+      <Generator>PublicResXFileCodeGenerator</Generator>
+      <LastGenOutput>Service.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Strings\Service\Service.zh-Hans.resx" />
+    <EmbeddedResource Include="Strings\Service\Service.zh-Hant.resx" />
   </ItemGroup>
   <ItemGroup>
     <BootstrapperPackage Include=".NETFramework,Version=v4.6.2">
@@ -2482,6 +2546,11 @@
       <Install>false</Install>
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup>
+    <XliffResource Include="MultilingualResources\PDF Office.en.xlf" />
+    <XliffResource Include="MultilingualResources\PDF Office.zh-Hans.xlf" />
+    <XliffResource Include="MultilingualResources\PDF Office.zh-Hant.xlf" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
@@ -2492,4 +2561,8 @@
   </Target>
   <Import Project="packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets" Condition="Exists('packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets')" />
   <Import Project="packages\Magick.NET-Q16-AnyCPU.12.2.2\build\netstandard20\Magick.NET-Q16-AnyCPU.targets" Condition="Exists('packages\Magick.NET-Q16-AnyCPU.12.2.2\build\netstandard20\Magick.NET-Q16-AnyCPU.targets')" />
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\Microsoft.Multilingual.ResxResources.targets" Label="MultilingualAppToolkit" Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\v$(MultilingualAppToolkitVersion)\Microsoft.Multilingual.ResxResources.targets')" />
+  <Target Name="MATPrerequisite" BeforeTargets="PrepareForBuild" Condition="!Exists('$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\Microsoft.Multilingual.ResxResources.targets')" Label="MultilingualAppToolkit">
+    <Warning Text="$(MSBuildProjectFile) is Multilingual build enabled, but the Multilingual App Toolkit is unavailable during the build. If building with Visual Studio, please check to ensure that toolkit is properly installed." />
+  </Target>
 </Project>

+ 1 - 0
PDF Office/Properties/AssemblyInfo.cs

@@ -15,6 +15,7 @@ using System.Windows;
 [assembly: AssemblyCopyright("Copyright ©  2022")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
+[assembly: NeutralResourcesLanguage("en-US")]
 
 // 将 ComVisible 设置为 false 会使此程序集中的类型
 //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型

+ 12 - 1
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.10.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -225,5 +225,16 @@ namespace PDF_Office.Properties {
                 this["UpdateSettings"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::PDFSettings.ColorSelectorList ColorSelectors {
+            get {
+                return ((global::PDFSettings.ColorSelectorList)(this["ColorSelectors"]));
+            }
+            set {
+                this["ColorSelectors"] = value;
+            }
+        }
     }
 }

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

@@ -56,5 +56,8 @@
     <Setting Name="UpdateSettings" Type="System.Boolean" Scope="User">
       <Value Profile="(Default)">True</Value>
     </Setting>
+    <Setting Name="ColorSelectors" Type="PDFSettings.ColorSelectorList" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
   </Settings>
 </SettingsFile>

BIN
PDF Office/Resources/Dialog/helphover.png


+ 63 - 0
PDF Office/Strings/HomePage/HomePage.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PDF_Office.Strings.HomePage {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    public class HomePage {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal HomePage() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDF_Office.Strings.HomePage.HomePage", typeof(HomePage).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 15 - 0
PDF Office/Strings/HomePage/HomePage.en.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 120 - 0
PDF Office/Strings/HomePage/HomePage.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 15 - 0
PDF Office/Strings/HomePage/HomePage.zh-Hans.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 15 - 0
PDF Office/Strings/HomePage/HomePage.zh-Hant.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 695 - 0
PDF Office/Strings/MainPage/MainPage.Designer.cs

@@ -0,0 +1,695 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PDF_Office.Strings.MainPage {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    public class MainPage {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal MainPage() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDF_Office.Strings.MainPage.MainPage", typeof(MainPage).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Create PDF 的本地化字符串。
+        /// </summary>
+        public static string Home_CreatePDF {
+            get {
+                return ResourceManager.GetString("Home_CreatePDF", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 New Blank Page 的本地化字符串。
+        /// </summary>
+        public static string Home_CreateToNew {
+            get {
+                return ResourceManager.GetString("Home_CreateToNew", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Open Files 的本地化字符串。
+        /// </summary>
+        public static string Home_OpenFiles {
+            get {
+                return ResourceManager.GetString("Home_OpenFiles", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Remove from Recents 的本地化字符串。
+        /// </summary>
+        public static string HomeList_MenuRemove {
+            get {
+                return ResourceManager.GetString("HomeList_MenuRemove", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Show in Folder 的本地化字符串。
+        /// </summary>
+        public static string HomeList_MenuShow {
+            get {
+                return ResourceManager.GetString("HomeList_MenuShow", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Click “Open Files” or drag file here to open 的本地化字符串。
+        /// </summary>
+        public static string HomeList_NoFilesContent {
+            get {
+                return ResourceManager.GetString("HomeList_NoFilesContent", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 No recently opened files 的本地化字符串。
+        /// </summary>
+        public static string HomeList_NoFilesTitle {
+            get {
+                return ResourceManager.GetString("HomeList_NoFilesTitle", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Recents 的本地化字符串。
+        /// </summary>
+        public static string HomeList_Title {
+            get {
+                return ResourceManager.GetString("HomeList_Title", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Quick Tools 的本地化字符串。
+        /// </summary>
+        public static string HomeTool_Title {
+            get {
+                return ResourceManager.GetString("HomeTool_Title", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Add Files 的本地化字符串。
+        /// </summary>
+        public static string Merge_AddFiles {
+            get {
+                return ResourceManager.GetString("Merge_AddFiles", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Add Folder 的本地化字符串。
+        /// </summary>
+        public static string Merge_AddFolder {
+            get {
+                return ResourceManager.GetString("Merge_AddFolder", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Add an Open File 的本地化字符串。
+        /// </summary>
+        public static string Merge_AddOpenFile {
+            get {
+                return ResourceManager.GetString("Merge_AddOpenFile", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Selected files
+        ///Drop files here or Click “Add Files” at bottom right button. 
+        ///Drag files to reorder as you need. 的本地化字符串。
+        /// </summary>
+        public static string Merge_Hint {
+            get {
+                return ResourceManager.GetString("Merge_Hint", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Pages 的本地化字符串。
+        /// </summary>
+        public static string Merge_ItemPages {
+            get {
+                return ResourceManager.GetString("Merge_ItemPages", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Cancel 的本地化字符串。
+        /// </summary>
+        public static string Merge_No {
+            get {
+                return ResourceManager.GetString("Merge_No", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 File Name 的本地化字符串。
+        /// </summary>
+        public static string Merge_TitleFileName {
+            get {
+                return ResourceManager.GetString("Merge_TitleFileName", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Page Range 的本地化字符串。
+        /// </summary>
+        public static string Merge_TitlePageRange {
+            get {
+                return ResourceManager.GetString("Merge_TitlePageRange", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Size 的本地化字符串。
+        /// </summary>
+        public static string Merge_TitleSize {
+            get {
+                return ResourceManager.GetString("Merge_TitleSize", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Merge 的本地化字符串。
+        /// </summary>
+        public static string Merge_Yes {
+            get {
+                return ResourceManager.GetString("Merge_Yes", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Close Tab 的本地化字符串。
+        /// </summary>
+        public static string MultipleTabs__Close {
+            get {
+                return ResourceManager.GetString("MultipleTabs_ Close", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Close All Tabs 的本地化字符串。
+        /// </summary>
+        public static string MultipleTabs__CloseAll {
+            get {
+                return ResourceManager.GetString("MultipleTabs_ CloseAll", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Show in Folder 的本地化字符串。
+        /// </summary>
+        public static string MultipleTabs__Folder {
+            get {
+                return ResourceManager.GetString("MultipleTabs_ Folder", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Home 的本地化字符串。
+        /// </summary>
+        public static string MultipleTabs_Default {
+            get {
+                return ResourceManager.GetString("MultipleTabs_Default", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Rename 的本地化字符串。
+        /// </summary>
+        public static string MultipleTabs_Rename {
+            get {
+                return ResourceManager.GetString("MultipleTabs_Rename", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Add Item 的本地化字符串。
+        /// </summary>
+        public static string Outline_Add {
+            get {
+                return ResourceManager.GetString("Outline_Add", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Add To Higher Level 的本地化字符串。
+        /// </summary>
+        public static string Outline_AddLevel {
+            get {
+                return ResourceManager.GetString("Outline_AddLevel", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Add Sub-Item 的本地化字符串。
+        /// </summary>
+        public static string Outline_AddSub {
+            get {
+                return ResourceManager.GetString("Outline_AddSub", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Change Destination 的本地化字符串。
+        /// </summary>
+        public static string Outline_Change {
+            get {
+                return ResourceManager.GetString("Outline_Change", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Collapse All 的本地化字符串。
+        /// </summary>
+        public static string Outline_Collapse {
+            get {
+                return ResourceManager.GetString("Outline_Collapse", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Delete 的本地化字符串。
+        /// </summary>
+        public static string Outline_Delete {
+            get {
+                return ResourceManager.GetString("Outline_Delete", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Are you sure you want to set the destination as the current location? 的本地化字符串。
+        /// </summary>
+        public static string Outline_DialogContent {
+            get {
+                return ResourceManager.GetString("Outline_DialogContent", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 No 的本地化字符串。
+        /// </summary>
+        public static string Outline_DialogNO {
+            get {
+                return ResourceManager.GetString("Outline_DialogNO", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Yes 的本地化字符串。
+        /// </summary>
+        public static string Outline_DialogYes {
+            get {
+                return ResourceManager.GetString("Outline_DialogYes", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Demote 的本地化字符串。
+        /// </summary>
+        public static string Outline_Down {
+            get {
+                return ResourceManager.GetString("Outline_Down", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Expand All 的本地化字符串。
+        /// </summary>
+        public static string Outline_Expand {
+            get {
+                return ResourceManager.GetString("Outline_Expand", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Remove All Outlines 的本地化字符串。
+        /// </summary>
+        public static string Outline_RemoveAll {
+            get {
+                return ResourceManager.GetString("Outline_RemoveAll", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Rename 的本地化字符串。
+        /// </summary>
+        public static string Outline_Rename {
+            get {
+                return ResourceManager.GetString("Outline_Rename", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Outline 的本地化字符串。
+        /// </summary>
+        public static string Outline_Title {
+            get {
+                return ResourceManager.GetString("Outline_Title", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Promote 的本地化字符串。
+        /// </summary>
+        public static string Outline_Up {
+            get {
+                return ResourceManager.GetString("Outline_Up", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Clear 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogClear {
+            get {
+                return ResourceManager.GetString("Signatur_DialogClear", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Drawing 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogDraw {
+            get {
+                return ResourceManager.GetString("Signatur_DialogDraw", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Sign here 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogDrawHint {
+            get {
+                return ResourceManager.GetString("Signatur_DialogDrawHint", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Cancel 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogNo {
+            get {
+                return ResourceManager.GetString("Signatur_DialogNo", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Image 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogPicture {
+            get {
+                return ResourceManager.GetString("Signatur_DialogPicture", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Select image file 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogPictureHint {
+            get {
+                return ResourceManager.GetString("Signatur_DialogPictureHint", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Remove Background 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogPictureReBkg {
+            get {
+                return ResourceManager.GetString("Signatur_DialogPictureReBkg", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Remove white background from images 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogPictureReBkgHint {
+            get {
+                return ResourceManager.GetString("Signatur_DialogPictureReBkgHint", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Reselect 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogPictureReselect {
+            get {
+                return ResourceManager.GetString("Signatur_DialogPictureReselect", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Keyboard 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogText {
+            get {
+                return ResourceManager.GetString("Signatur_DialogText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Enter your signature here 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogTextHint {
+            get {
+                return ResourceManager.GetString("Signatur_DialogTextHint", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Create New Signature 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogTitle {
+            get {
+                return ResourceManager.GetString("Signatur_DialogTitle", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Apply 的本地化字符串。
+        /// </summary>
+        public static string Signatur_DialogYes {
+            get {
+                return ResourceManager.GetString("Signatur_DialogYes", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Signature 的本地化字符串。
+        /// </summary>
+        public static string Signatur_Title {
+            get {
+                return ResourceManager.GetString("Signatur_Title", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Stamp 的本地化字符串。
+        /// </summary>
+        public static string Stamp_Title {
+            get {
+                return ResourceManager.GetString("Stamp_Title", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Annotation 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Annotation {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Annotation", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Converter 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Converter {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Converter", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 File 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_File {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_File", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Fill&amp;Sign 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Fill_Sign {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Fill&Sign", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Page Edit 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_PageEdit {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_PageEdit", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Print 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Print {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Print", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Properties 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Properties {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Properties", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Redo 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Redo {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Redo", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Save 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Save {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Save", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Share 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Share {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Share", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Tools 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Tools {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Tools", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Undo 的本地化字符串。
+        /// </summary>
+        public static string ViewTopToolbar_Undo {
+            get {
+                return ResourceManager.GetString("ViewTopToolbar_Undo", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 All pages 的本地化字符串。
+        /// </summary>
+        public static string WritableComboBox_AllPage {
+            get {
+                return ResourceManager.GetString("WritableComboBox_AllPage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Custom Range 的本地化字符串。
+        /// </summary>
+        public static string WritableComboBox_CustomRange {
+            get {
+                return ResourceManager.GetString("WritableComboBox_CustomRange", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Even Pages 的本地化字符串。
+        /// </summary>
+        public static string WritableComboBox_EvenPage {
+            get {
+                return ResourceManager.GetString("WritableComboBox_EvenPage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Odd Pages 的本地化字符串。
+        /// </summary>
+        public static string WritableComboBox_OddPage {
+            get {
+                return ResourceManager.GetString("WritableComboBox_OddPage", resourceCulture);
+            }
+        }
+    }
+}

+ 15 - 0
PDF Office/Strings/MainPage/MainPage.en.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 343 - 0
PDF Office/Strings/MainPage/MainPage.resx

@@ -0,0 +1,343 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="HomeList_MenuRemove" xml:space="preserve">
+    <value>Remove from Recents</value>
+  </data>
+  <data name="HomeList_MenuShow" xml:space="preserve">
+    <value>Show in Folder</value>
+  </data>
+  <data name="HomeList_NoFilesContent" xml:space="preserve">
+    <value>Click “Open Files” or drag file here to open</value>
+  </data>
+  <data name="HomeList_NoFilesTitle" xml:space="preserve">
+    <value>No recently opened files</value>
+  </data>
+  <data name="HomeList_Title" xml:space="preserve">
+    <value>Recents</value>
+  </data>
+  <data name="HomeTool_Title" xml:space="preserve">
+    <value>Quick Tools</value>
+  </data>
+  <data name="Home_CreatePDF" xml:space="preserve">
+    <value>Create PDF</value>
+  </data>
+  <data name="Home_CreateToNew" xml:space="preserve">
+    <value>New Blank Page</value>
+    <comment>下拉菜单-新建空白文档</comment>
+  </data>
+  <data name="Home_OpenFiles" xml:space="preserve">
+    <value>Open Files</value>
+  </data>
+  <data name="Merge_AddFiles" xml:space="preserve">
+    <value>Add Files</value>
+  </data>
+  <data name="Merge_AddFolder" xml:space="preserve">
+    <value>Add Folder</value>
+  </data>
+  <data name="Merge_AddOpenFile" xml:space="preserve">
+    <value>Add an Open File</value>
+  </data>
+  <data name="Merge_Hint" xml:space="preserve">
+    <value>Selected files
+Drop files here or Click “Add Files” at bottom right button. 
+Drag files to reorder as you need.</value>
+  </data>
+  <data name="Merge_ItemPages" xml:space="preserve">
+    <value>Pages</value>
+  </data>
+  <data name="Merge_No" xml:space="preserve">
+    <value>Cancel</value>
+  </data>
+  <data name="Merge_TitleFileName" xml:space="preserve">
+    <value>File Name</value>
+  </data>
+  <data name="Merge_TitlePageRange" xml:space="preserve">
+    <value>Page Range</value>
+  </data>
+  <data name="Merge_TitleSize" xml:space="preserve">
+    <value>Size</value>
+  </data>
+  <data name="Merge_Yes" xml:space="preserve">
+    <value>Merge</value>
+  </data>
+  <data name="MultipleTabs_ Close" xml:space="preserve">
+    <value>Close Tab</value>
+    <comment>右键菜单-关闭当前页</comment>
+  </data>
+  <data name="MultipleTabs_ CloseAll" xml:space="preserve">
+    <value>Close All Tabs</value>
+    <comment>右键菜单-关闭全部</comment>
+  </data>
+  <data name="MultipleTabs_ Folder" xml:space="preserve">
+    <value>Show in Folder</value>
+    <comment>右键菜单-打开所在文件夹</comment>
+  </data>
+  <data name="MultipleTabs_Default" xml:space="preserve">
+    <value>Home</value>
+  </data>
+  <data name="MultipleTabs_Rename" xml:space="preserve">
+    <value>Rename</value>
+    <comment>右键菜单-重命名</comment>
+  </data>
+  <data name="Outline_Add" xml:space="preserve">
+    <value>Add Item</value>
+  </data>
+  <data name="Outline_AddLevel" xml:space="preserve">
+    <value>Add To Higher Level</value>
+  </data>
+  <data name="Outline_AddSub" xml:space="preserve">
+    <value>Add Sub-Item</value>
+  </data>
+  <data name="Outline_Change" xml:space="preserve">
+    <value>Change Destination</value>
+  </data>
+  <data name="Outline_Collapse" xml:space="preserve">
+    <value>Collapse All</value>
+  </data>
+  <data name="Outline_Delete" xml:space="preserve">
+    <value>Delete</value>
+  </data>
+  <data name="Outline_DialogContent" xml:space="preserve">
+    <value>Are you sure you want to set the destination as the current location?</value>
+  </data>
+  <data name="Outline_DialogNO" xml:space="preserve">
+    <value>No</value>
+  </data>
+  <data name="Outline_DialogYes" xml:space="preserve">
+    <value>Yes</value>
+  </data>
+  <data name="Outline_Down" xml:space="preserve">
+    <value>Demote</value>
+  </data>
+  <data name="Outline_Expand" xml:space="preserve">
+    <value>Expand All</value>
+  </data>
+  <data name="Outline_RemoveAll" xml:space="preserve">
+    <value>Remove All Outlines</value>
+  </data>
+  <data name="Outline_Rename" xml:space="preserve">
+    <value>Rename</value>
+  </data>
+  <data name="Outline_Title" xml:space="preserve">
+    <value>Outline</value>
+  </data>
+  <data name="Outline_Up" xml:space="preserve">
+    <value>Promote</value>
+  </data>
+  <data name="Signatur_DialogClear" xml:space="preserve">
+    <value>Clear</value>
+  </data>
+  <data name="Signatur_DialogDraw" xml:space="preserve">
+    <value>Drawing</value>
+    <comment>手绘分类</comment>
+  </data>
+  <data name="Signatur_DialogDrawHint" xml:space="preserve">
+    <value>Sign here</value>
+  </data>
+  <data name="Signatur_DialogNo" xml:space="preserve">
+    <value>Cancel</value>
+  </data>
+  <data name="Signatur_DialogPicture" xml:space="preserve">
+    <value>Image</value>
+    <comment>图片分类</comment>
+  </data>
+  <data name="Signatur_DialogPictureHint" xml:space="preserve">
+    <value>Select image file</value>
+  </data>
+  <data name="Signatur_DialogPictureReBkg" xml:space="preserve">
+    <value>Remove Background</value>
+    <comment>去背功能按钮描述</comment>
+  </data>
+  <data name="Signatur_DialogPictureReBkgHint" xml:space="preserve">
+    <value>Remove white background from images</value>
+    <comment>去背功能按钮悬浮提示</comment>
+  </data>
+  <data name="Signatur_DialogPictureReselect" xml:space="preserve">
+    <value>Reselect</value>
+  </data>
+  <data name="Signatur_DialogText" xml:space="preserve">
+    <value>Keyboard</value>
+    <comment>文字分类</comment>
+  </data>
+  <data name="Signatur_DialogTextHint" xml:space="preserve">
+    <value>Enter your signature here</value>
+  </data>
+  <data name="Signatur_DialogTitle" xml:space="preserve">
+    <value>Create New Signature</value>
+  </data>
+  <data name="Signatur_DialogYes" xml:space="preserve">
+    <value>Apply</value>
+  </data>
+  <data name="Signatur_Title" xml:space="preserve">
+    <value>Signature</value>
+  </data>
+  <data name="Stamp_Title" xml:space="preserve">
+    <value>Stamp</value>
+  </data>
+  <data name="ViewTopToolbar_Annotation" xml:space="preserve">
+    <value>Annotation</value>
+  </data>
+  <data name="ViewTopToolbar_Converter" xml:space="preserve">
+    <value>Converter</value>
+  </data>
+  <data name="ViewTopToolbar_File" xml:space="preserve">
+    <value>File</value>
+    <comment>阅读页顶部工具栏的文件按钮</comment>
+  </data>
+  <data name="ViewTopToolbar_Fill&amp;Sign" xml:space="preserve">
+    <value>Fill&amp;Sign</value>
+  </data>
+  <data name="ViewTopToolbar_PageEdit" xml:space="preserve">
+    <value>Page Edit</value>
+  </data>
+  <data name="ViewTopToolbar_Print" xml:space="preserve">
+    <value>Print</value>
+  </data>
+  <data name="ViewTopToolbar_Properties" xml:space="preserve">
+    <value>Properties</value>
+  </data>
+  <data name="ViewTopToolbar_Redo" xml:space="preserve">
+    <value>Redo</value>
+  </data>
+  <data name="ViewTopToolbar_Save" xml:space="preserve">
+    <value>Save</value>
+  </data>
+  <data name="ViewTopToolbar_Share" xml:space="preserve">
+    <value>Share</value>
+  </data>
+  <data name="ViewTopToolbar_Tools" xml:space="preserve">
+    <value>Tools</value>
+  </data>
+  <data name="ViewTopToolbar_Undo" xml:space="preserve">
+    <value>Undo</value>
+  </data>
+  <data name="WritableComboBox_AllPage" xml:space="preserve">
+    <value>All pages</value>
+  </data>
+  <data name="WritableComboBox_CustomRange" xml:space="preserve">
+    <value>Custom Range</value>
+  </data>
+  <data name="WritableComboBox_EvenPage" xml:space="preserve">
+    <value>Even Pages</value>
+  </data>
+  <data name="WritableComboBox_OddPage" xml:space="preserve">
+    <value>Odd Pages</value>
+  </data>
+</root>

+ 15 - 0
PDF Office/Strings/MainPage/MainPage.zh-Hans.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 15 - 0
PDF Office/Strings/MainPage/MainPage.zh-Hant.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 63 - 0
PDF Office/Strings/Service/Service.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PDF_Office.Strings.Service {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    public class Service {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Service() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDF_Office.Strings.Service.Service", typeof(Service).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 15 - 0
PDF Office/Strings/Service/Service.en.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 101 - 0
PDF Office/Strings/Service/Service.resx

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+	<!-- 
+		Microsoft ResX Schema
+
+		Version 1.3
+
+		The primary goals of this format is to allow a simple XML format 
+		that is mostly human readable. The generation and parsing of the 
+		various data types are done through the TypeConverter classes 
+		associated with the data types.
+
+		Example:
+
+		... ado.net/XML headers & schema ...
+		<resheader name="resmimetype">text/microsoft-resx</resheader>
+		<resheader name="version">1.3</resheader>
+		<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+		<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+		<data name="Name1">this is my long string</data>
+		<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+		<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+			[base64 mime encoded serialized .NET Framework object]
+		</data>
+		<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+			[base64 mime encoded string representing a byte array form of the .NET Framework object]
+		</data>
+
+		There are any number of "resheader" rows that contain simple 
+		name/value pairs.
+
+		Each data row contains a name, and value. The row also contains a 
+		type or mimetype. Type corresponds to a .NET class that support 
+		text/value conversion through the TypeConverter architecture. 
+		Classes that don't support this are serialized and stored with the 
+		mimetype set.
+
+		The mimetype is used for serialized objects, and tells the 
+		ResXResourceReader how to depersist the object. This is currently not 
+		extensible. For a given mimetype the value must be set accordingly:
+
+		Note - application/x-microsoft.net.object.binary.base64 is the format 
+		that the ResXResourceWriter will generate, however the reader can 
+		read any of the formats listed below.
+
+		mimetype: application/x-microsoft.net.object.binary.base64
+		value   : The object must be serialized with 
+			: System.Serialization.Formatters.Binary.BinaryFormatter
+			: and then encoded with base64 encoding.
+
+		mimetype: application/x-microsoft.net.object.soap.base64
+		value   : The object must be serialized with 
+			: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+			: and then encoded with base64 encoding.
+
+		mimetype: application/x-microsoft.net.object.bytearray.base64
+		value   : The object must be serialized into a byte array 
+			: using a System.ComponentModel.TypeConverter
+			: and then encoded with base64 encoding.
+	-->
+	
+	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+		<xsd:element name="root" msdata:IsDataSet="true">
+			<xsd:complexType>
+				<xsd:choice maxOccurs="unbounded">
+					<xsd:element name="data">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+							<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+							<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+						</xsd:complexType>
+					</xsd:element>
+					<xsd:element name="resheader">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" use="required" />
+						</xsd:complexType>
+					</xsd:element>
+				</xsd:choice>
+			</xsd:complexType>
+		</xsd:element>
+	</xsd:schema>
+	<resheader name="resmimetype">
+		<value>text/microsoft-resx</value>
+	</resheader>
+	<resheader name="version">
+		<value>1.3</value>
+	</resheader>
+	<resheader name="reader">
+		<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+	<resheader name="writer">
+		<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+</root>

+ 15 - 0
PDF Office/Strings/Service/Service.zh-Hans.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 15 - 0
PDF Office/Strings/Service/Service.zh-Hant.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 51 - 24
PDF Office/Styles/ContextMenuStyle.xaml

@@ -19,6 +19,31 @@
             IsEnabled="True" />
     </ContextMenu>
 
+    <!--便签ToolTip-->
+    <Style x:Key="FlowToolTip" TargetType="ToolTip">
+        <Setter Property="HorizontalAlignment" Value="Left" />
+        <Setter Property="VerticalAlignment" Value="Top" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Grid>
+                        <Border Background="{StaticResource color.sys.layout.dark.bg}" CornerRadius="4" BorderBrush="{StaticResource color.sys.layout.dark.bg}" BorderThickness="4">
+                            <Border.Effect>
+                                <DropShadowEffect Direction="0" BlurRadius="7" ShadowDepth="0" Color="Black" Opacity="0.09" />
+                            </Border.Effect>
+                        </Border>
+                        <TextBlock
+                            Margin="16,8,16,8"
+                            FontSize="13"
+                            TextWrapping="Wrap"
+                            Foreground="{StaticResource color.sys.text.anti.norm}"
+                            Text="{TemplateBinding ContentControl.Content}" />
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
     <!--  注释 - 高亮、下划线、删除线 -右键菜单  -->
     <Style x:Key="UIElementMenuItem" TargetType="MenuItem">
         <Setter Property="Template">
@@ -133,26 +158,26 @@
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
         <MenuItem Header="添加注释" Tag="AddAnnotation">
-            <MenuItem Header="绘制" Tag="AnnotFreehand" />
+            <MenuItem Header="绘制" Tag="AnnotFreehand"  />
             <MenuItem Header="文本" Tag="AnnotFreeText" />
-            <MenuItem Header="便签" Tag="AnnotSticky" />
+            <MenuItem Header="便签" Tag="AnnotSticky"/>
             <Separator
                 Height="1"
                 BorderBrush="#33000000"
                 BorderThickness="1"
                 Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-            <MenuItem Header="矩形" Tag="AnnotSquare" />
-            <MenuItem Header="椭圆形" Tag="AnnotCircle" />
-            <MenuItem Header="箭头" Tag="AnnotArrow" />
-            <MenuItem Header="直线" Tag="AnnotLine" />
+            <MenuItem Header="矩形" Tag="AnnotSquare"  />
+            <MenuItem Header="椭圆形" Tag="AnnotCircle"  />
+            <MenuItem Header="箭头" Tag="AnnotArrow"  />
+            <MenuItem Header="直线" Tag="AnnotLine"  />
             <Separator
                 Height="1"
                 BorderBrush="#33000000"
                 BorderThickness="1"
                 Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-            <MenuItem Header="链接" Tag="AnnotLink" />
-            <MenuItem Header="图章" Tag="AnnotStamp" />
-            <MenuItem Header="签名" Tag="AnnotAutograph" />
+            <MenuItem Header="链接" Tag="AnnotLink"  />
+            <MenuItem Header="图章" Tag="AnnotStamp"  />
+            <MenuItem Header="签名" Tag="AnnotAutograph"  />
         </MenuItem>
         <MenuItem Header="隐藏注释" Tag="HiddenAnnot" />
         <MenuItem Header="显示注释" Tag="DisplayAnnot" />
@@ -164,17 +189,17 @@
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
         <MenuItem Header="工具模式" Tag="ToolMode">
-            <MenuItem Header="默认工具" Tag="default" />
-            <MenuItem Header="滚动工具" Tag="roll" />
+            <MenuItem Header="默认工具" Tag="default" IsCheckable="True" />
+            <MenuItem Header="滚动工具" Tag="roll" IsCheckable="True" />
             <MenuItem
                 Header="放大镜"
                 Tag="magnifier"
-                Visibility="Collapsed" />
-            <MenuItem Header="内容选择" Tag="content" />
+                Visibility="Collapsed" IsCheckable="True" />
+            <MenuItem Header="内容选择" Tag="content" IsCheckable="True" />
             <MenuItem
                 Header="缩放至选定区域"
                 Tag="zoom"
-                Visibility="Collapsed" />
+                Visibility="Collapsed" IsCheckable="True" />
         </MenuItem>
         <MenuItem Header="进入阅读模式" Tag="ReadModel" />
         <MenuItem Header="退出阅读模式" Tag="UnReadModel" />
@@ -184,18 +209,20 @@
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
         <MenuItem Header="视图缩放" Tag="ViewZoom">
-            <MenuItem Header="适应宽度" Tag="FitWidth" />
-            <MenuItem Header="适应页面" Tag="FitHeight" />
-            <MenuItem Header="实际大小" Tag="FitSize" />
-            <MenuItem Header="放大" Tag="enlarge" />
-            <MenuItem Header="缩小" Tag="narrow" />
+            <MenuItem Header="适应宽度" Tag="FitWidth" IsCheckable="True" />
+            <MenuItem Header="适应页面" Tag="FitHeight" IsCheckable="True" />
+            <MenuItem Header="实际大小" Tag="FitSize" IsCheckable="True" />
+            <MenuItem Header="放大" Tag="enlarge" IsCheckable="True" />
+            <MenuItem Header="缩小" Tag="narrow" IsCheckable="True" />
         </MenuItem>
         <MenuItem Header="页面显示" Tag="PageDisplay">
-            <MenuItem Header="单页" Tag="SingleView" />
-            <MenuItem Header="单页连续" Tag="SingleContinueView" />
-            <MenuItem Header="双页" Tag="DoubleView" />
-            <MenuItem Header="双页连续" Tag="DoubleContinueView" />
-            <MenuItem Header="书本模式" Tag="BookMode" />
+            <MenuItem Header="单页" Tag="SingleView" IsCheckable="True" />
+            <MenuItem Header="单页连续" Tag="SingleContinueView" IsCheckable="True" />
+            <MenuItem Header="双页" Tag="DoubleView" IsCheckable="True" />
+            <MenuItem Header="双页连续" Tag="DoubleContinueView" IsCheckable="True" />
+            <MenuItem Header="书本模式" Tag="BookMode" IsCheckable="True" />
+        </MenuItem>
+        <MenuItem  Tag="HighlightLinks" Header="高亮显示超链接" IsCheckable="True">
         </MenuItem>
         <Separator
             Height="1"

+ 54 - 0
PDF Office/Styles/RadioButtonStyle.xaml

@@ -430,6 +430,60 @@
         </Setter>
     </Style>
 
+    <!--右键菜单,单选按钮-->
+    <Style x:Key="MenuRadioBtnStyle" TargetType="{x:Type RadioButton}">
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RadioButton}">
+                    <Border
+                        x:Name="templateRoot"
+                        Background="{TemplateBinding Background}"
+                        CornerRadius="0"
+                        SnapsToDevicePixels="True">
+                        <Grid>
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="20"/>
+                                <ColumnDefinition />
+                            </Grid.ColumnDefinitions>
+
+                            <Path x:Name="pathIcon" Visibility="Collapsed" Data="M11.1144 1.57308L5.71438 9.28737C5.58464 9.47271 5.37817 9.58958 5.15248 9.60543C4.9268 9.62128 4.70603 9.5344 4.55166 9.36901L0.95166 5.51187L2.04824 4.48839L5.01649 7.66866L9.88553 0.712891L11.1144 1.57308Z"
+                                  Fill="{StaticResource color.icon.base.neutral.norm.lv1}" 
+                                  />
+
+                            <ContentPresenter
+                            x:Name="contentPresenter"
+                            Grid.Column="1"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                        </Grid>
+                        
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="HasContent" Value="true">
+                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
+                            <Setter Property="Padding" Value="4,-1,0,0" />
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true">
+                         
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true" />
+                        <Trigger Property="IsChecked" Value="true">
+                            <Setter TargetName="pathIcon" Property="Visibility" Value="Visible" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
     <!--  悬浮灰色背景单选按钮  -->
     <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
         <Setter Property="BorderThickness" Value="1" />

+ 4 - 3
PDF Office/Styles/WindowsStyle.xaml

@@ -136,9 +136,10 @@
     </Style>
 
 
-    <Style x:Key="stlWindowEx" TargetType="{x:Type Window}">
-        <Setter Property="Height" Value="554"/>
-        <Setter Property="Width" Value="892"/>
+    <Style x:Key="stlWindowEx" 
+        BasedOn="{StaticResource DialogWindowStyle}"
+        TargetType="{x:Type Window}">
+        <Setter Property="ResizeMode" Value="CanResize" />
     </Style>
 
 </ResourceDictionary>

+ 120 - 19
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -28,6 +28,7 @@ using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.Configuration;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -41,6 +42,7 @@ using System.Windows.Forms;
 using System.Windows.Markup;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
 using System.Windows.Shapes;
 using static Dropbox.Api.Files.SearchMatchType;
 using static Dropbox.Api.TeamLog.SpaceCapsType;
@@ -97,6 +99,18 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        private bool CanIsEnabled()
+        {
+            if (AnnotationListItems.Count > 0)
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
         private List<string> colors = new List<string>();
         private List<string> authors = new List<string>();
         private List<AnnotArgsType> annotArgsTypes = new List<AnnotArgsType>();
@@ -104,8 +118,8 @@ namespace PDF_Office.ViewModels.BOTA
         public DelegateCommand<object> ListBoxItemPreviewMouseLeftButtonDown { get; set; }
         public DelegateCommand<object> AddNotesCommand { get; set; }
         public DelegateCommand<object> ScreenCommand { get; set; }
-        public DelegateCommand<object> ExportCommentsCommand { get; set; }
-        public DelegateCommand<object> ImportCommentsCommand { get; set; }
+        public DelegateCommand ExportCommentsCommand { get; set; }
+        public DelegateCommand ImportCommentsCommand { get; set; }
         public DelegateCommand<object> DeleteCommand { get; set; }
 
         public DelegateCommand DeleteAllCommand { get; set; }
@@ -123,20 +137,32 @@ namespace PDF_Office.ViewModels.BOTA
             ListBoxItemPreviewMouseLeftButtonDown = new DelegateCommand<object>(ListBoxItem_PreviewMouseLeftButtonDown);
             AddNotesCommand = new DelegateCommand<object>(AddNotesEvent);
             ScreenCommand = new DelegateCommand<object>(ScreenEvent);
-            ExportCommentsCommand = new DelegateCommand<object>(ExportCommentsEvent);
-            ImportCommentsCommand = new DelegateCommand<object>(ImportCommentsEvent);
+            ExportCommentsCommand = new DelegateCommand(ExportCommentsEvent, CanIsEnabled).ObservesProperty(() => AnnotationListItems);
+            ImportCommentsCommand = new DelegateCommand(ImportCommentsEvent);
             DeleteCommand = new DelegateCommand<object>(DelegateEvent);
-            DeleteAllCommand = new DelegateCommand(DeleteAllEvent);
+            DeleteAllCommand = new DelegateCommand(DeleteAllEvent, CanIsEnabled).ObservesProperty(() => AnnotationListItems);
             PageSortCommand = new DelegateCommand(PageSortEvent);
             TimeAscendingCommand = new DelegateCommand(TimeAscendingEvent);
             TimeDescendingCommand = new DelegateCommand(TimeDescendingEvent);
         }
 
+        public void HiddenAnnot()
+        {
+            AnnotationListItems.Clear();
+            IsEmptyPanelVisibility = Visibility.Visible;
+        }
+
+        public void DisplayAnnot()
+        {
+            AnnotationListItems = GetDocumentAnnotionList();
+            RefreshAnnotationListItems();
+        }
+
         /// <summary>
         /// 导入注释
         /// </summary>
         /// <param name="obj"></param>
-        private async void ImportCommentsEvent(object obj)
+        private async void ImportCommentsEvent()
         {
             Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
             dlg.Filter = "PDF|*.xfdf";
@@ -260,17 +286,22 @@ namespace PDF_Office.ViewModels.BOTA
                     var result = PdfViewer.RemovePageAnnot(annotation.PageIndex, annotation.AnnotIndex);
                     if (result)
                     {
-                        AnnotationListItems.Remove(annotation);
-                        var annotation1 = CurrentAnnotationLists.FirstOrDefault(x => x.PageIndex == annotation.PageIndex && x.AnnotIndex == annotation.AnnotIndex);
-                        CurrentAnnotationLists.Remove(annotation1);
-                        //记录是删除了哪些页面的注释,然后更新对应页面的注释即可
-                        UpdateAnnotListAfterDelete(annotation.PageIndex, annotation.AnnotIndex);
-                        PdfViewer.UndoManager.CanSave = true;
+                        RemoveItem(annotation);
                     }
                 }
             }
         }
 
+        public void RemoveItem(AnnotationHandlerEventArgs annotation)
+        {
+            AnnotationListItems.Remove(annotation);
+            var annotation1 = CurrentAnnotationLists.FirstOrDefault(x => x.PageIndex == annotation.PageIndex && x.AnnotIndex == annotation.AnnotIndex);
+            CurrentAnnotationLists.Remove(annotation1);
+            //记录是删除了哪些页面的注释,然后更新对应页面的注释即可
+            UpdateAnnotListAfterDelete(annotation.PageIndex, annotation.AnnotIndex);
+            PdfViewer.UndoManager.CanSave = true;
+        }
+
         /// <summary>
         /// 删除之后,更新
         /// </summary>
@@ -302,7 +333,7 @@ namespace PDF_Office.ViewModels.BOTA
                             AnnotationListItems[k].UpdateTime = items[j].UpdateTime;
                             if (items[j].EventType == AnnotArgsType.AnnotFreehand)
                             {
-                                WriteableBitmap bitmap = GetAnnotImage(PdfViewer.Document, items[j].PageIndex, items[j].AnnotIndex);
+                                BitmapImage bitmap = GetAnnotImage(PdfViewer.Document, items[j].PageIndex, items[j].AnnotIndex);
                                 AnnotationListItems[k].WriteableBitmap = bitmap;
                             }
                             AnnotationListItems[k].Content = items[j].Content;
@@ -322,7 +353,7 @@ namespace PDF_Office.ViewModels.BOTA
         /// 导出注释
         /// </summary>
         /// <param name="obj"></param>
-        private void ExportCommentsEvent(object obj)
+        private void ExportCommentsEvent()
         {
             if (ViewContentViewModel.CanSave)
             {
@@ -421,7 +452,7 @@ namespace PDF_Office.ViewModels.BOTA
         /// 刷新列表数据
         /// </summary>
         /// <param name="button"></param>
-        private async void RefreshAnnotationListItems(System.Windows.Controls.Button button)
+        private async void RefreshAnnotationListItems(System.Windows.Controls.Button button = null)
         {
             switch (AnnotationSortOrder)
             {
@@ -1027,10 +1058,12 @@ namespace PDF_Office.ViewModels.BOTA
 
             #endregion BOTA,注释列表,添加在页面上的注释要默认按照页面上的位置排序,从上往下,从左往右排列
 
+            CurrentAnnotationLists = GetDocumentAnnotionList();
+
             AnnotationListItems = new ObservableCollection<AnnotationHandlerEventArgs>();
 
             AnnotationListItems = GetDocumentAnnotionList();
-            CurrentAnnotationLists.AddRange(AnnotationListItems);
+
             AnnotationListItems.CollectionChanged += AnnotationListItems_CollectionChanged;
             //按照PageIndex,分组 排序
             ICollectionView iCollectionView = CollectionViewSource.GetDefaultView(AnnotationListItems);
@@ -1114,6 +1147,16 @@ namespace PDF_Office.ViewModels.BOTA
                     //原型图上,目前对波浪线的类型,在注释列表不显示
                     if (item.EventType != AnnotArgsType.AnnotRedaction && item.EventType != AnnotArgsType.AnnotSquiggly)
                     {
+                        if (item.EventType == AnnotArgsType.AnnotLink)
+                        {
+                            if (item is LinkAnnotArgs link)
+                            {
+                                if (link.LinkType == LINK_TYPE.URI)
+                                {
+                                    continue;
+                                }
+                            }
+                        }
                         AnnotationHandlerEventArgs args = GetAddAnnotEventArgs(item);
                         if (args.AnnotHandlerEventArgs != null)
                         {
@@ -1131,7 +1174,7 @@ namespace PDF_Office.ViewModels.BOTA
             AnnotationHandlerEventArgs args = new AnnotationHandlerEventArgs();
             if (item.EventType == AnnotArgsType.AnnotFreehand)
             {
-                WriteableBitmap bitmap = GetAnnotImage(PdfViewer.Document, item.PageIndex, item.AnnotIndex);
+                BitmapImage bitmap = GetAnnotImage(PdfViewer.Document, item.PageIndex, item.AnnotIndex);
                 args.WriteableBitmap = bitmap;
             }
             args.ClientRect = item.ClientRect;
@@ -1158,7 +1201,7 @@ namespace PDF_Office.ViewModels.BOTA
         /// <param name="pageIndex"></param>
         /// <param name="annotIndex"></param>
         /// <returns></returns>
-        public WriteableBitmap GetAnnotImage(CPDFDocument doc, int pageIndex, int annotIndex)
+        public BitmapImage GetAnnotImage(CPDFDocument doc, int pageIndex, int annotIndex)
         {
             if (doc == null)
             {
@@ -1185,21 +1228,79 @@ namespace PDF_Office.ViewModels.BOTA
 
                     int drawWidth = (int)paintRect.Width;
                     int drawHeight = (int)paintRect.Height;
+                    switch (docPage.Rotation)
+                    {
+                        case 0:
+                        case 2:
+                            drawWidth = (int)paintRect.Width;
+                            drawHeight = (int)paintRect.Height;
+                            break;
+
+                        case 1:
+                        case 3:
+                            drawWidth = (int)paintRect.Height;
+                            drawHeight = (int)paintRect.Width;
+                            break;
+                    }
                     byte[] bitmapArray = new byte[drawWidth * drawHeight * 4];
                     annot.UpdateAp();
                     annot.RenderAnnot(drawWidth, drawHeight, bitmapArray);
 
                     WriteableBitmap wirteBitmap = new WriteableBitmap(drawWidth, drawHeight, 96, 96, PixelFormats.Bgra32, null);
                     wirteBitmap.WritePixels(new Int32Rect(0, 0, drawWidth, drawHeight), bitmapArray, wirteBitmap.BackBufferStride, 0);
+                    BitmapImage bitmapImage = ConvertWriteableBitmapToBitmapImage(wirteBitmap, docPage.Rotation);
 
                     cPDFInk.SetRect(rawRect);
-                    return wirteBitmap;
+
+                    // 测试
+                    //using (FileStream stream = new FileStream(@"C:\Users\oyxh\Desktop\images\1.png", FileMode.Create))
+                    //{
+                    //    PngBitmapEncoder bitmapEncoder = new PngBitmapEncoder();
+                    //    bitmapEncoder.Frames.Add(BitmapFrame.Create(wirteBitmap));
+                    //    bitmapEncoder.Save(stream);
+                    //}
+                    return bitmapImage;
                 }
             }
 
             return null;
         }
 
+        public BitmapImage ConvertWriteableBitmapToBitmapImage(WriteableBitmap wbm, int rotation)
+        {
+            BitmapImage bmImage = new BitmapImage();
+            using (MemoryStream stream = new MemoryStream())
+            {
+                PngBitmapEncoder encoder = new PngBitmapEncoder();
+                encoder.Frames.Add(BitmapFrame.Create(wbm));
+                encoder.Save(stream);
+                bmImage.BeginInit();
+                bmImage.CacheOption = BitmapCacheOption.OnLoad;
+                bmImage.StreamSource = stream;
+                switch (rotation)
+                {
+                    case 0:
+                        bmImage.Rotation = Rotation.Rotate0;
+                        break;
+
+                    case 1:
+                        bmImage.Rotation = Rotation.Rotate90;
+                        break;
+
+                    case 2:
+                        bmImage.Rotation = Rotation.Rotate180;
+                        break;
+
+                    case 3:
+                        bmImage.Rotation = Rotation.Rotate270;
+                        break;
+                }
+                bmImage.EndInit();
+                bmImage.Freeze();
+            }
+            return bmImage;
+        }
+
         /// <summary>
         /// listbox的itemsource发生变化时
         /// </summary>

+ 14 - 0
PDF Office/ViewModels/BOTA/SearchContentViewModel.cs

@@ -121,6 +121,20 @@ namespace PDF_Office.ViewModels.BOTA
             {
                 Completed = Visibility.Visible;
                 SearchCount = e.TotalCount.ToString();
+                List<TextSearchItem> pageTextList = new List<TextSearchItem>();
+                foreach (var item in SearchItemList)
+                {
+                    TextSearchItem textSearchItem = new TextSearchItem()
+                    {
+                        PageIndex = item.TextProperty.PageIndex,
+                        TextRect = item.TextProperty.TextRect,
+                        TextContent = item.TextProperty.TextContent,
+                        PageRotate = item.TextProperty.PageRotate
+                    };
+                    textSearchItem.PaintBrush = new SolidColorBrush(Color.FromArgb(0x99, 0xFF, 0xF7, 0x00));
+                    pageTextList.Add(textSearchItem);
+                }
+                PDFViewer.SetPageSelectText(pageTextList);
             });
         }
 

+ 46 - 5
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs

@@ -123,7 +123,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Count).ToString();
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -176,12 +176,50 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private  void converter()
         {
-            FolderBrowserDialog dlg = new FolderBrowserDialog();
-            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            if (ConverterCSVModel.IsCustomFileName) 
             {
-                ConverterCSVModel.OutputPath = dlg.SelectedPath.Trim();
+                System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+                /*
+                 *设置这个对话框的起始保存路径
+                 */
+                sfd.InitialDirectory = currentViewer.Document.FilePath;
+                /*
+                 *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+                 */
+                sfd.Filter = "PDF|*.csv;";
+                /*
+                 *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+                 */
+                sfd.FileName = currentViewer.Document.FileName + ".csv";
+                /*
+                 * 做一些工作
+                 */
+                if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                {
+                    ConverterCSVModel.OutputPath = sfd.FileName;
+                    try { if (File.Exists(ConverterCSVModel.OutputPath)) File.Delete(ConverterCSVModel.OutputPath); }
+                    catch
+                    {
+                        AlertsMessage alertsMessage = new AlertsMessage();
+                        alertsMessage.ShowDialog("文件已被占用", "请重新选则目标路径", "确定");
+                        return;
+                    }
+
+                }
+                else
+                {
+                    return;
+                }
+            } 
+            else {
+                FolderBrowserDialog dlg = new FolderBrowserDialog();
+                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                {
+                    ConverterCSVModel.OutputPath = dlg.SelectedPath.Trim();
+                }
+                else { return; }
             }
-            else { return; }
+            
             HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterCSVModel.PageRange, PageRangeText, true, CurrentPageIndex);
             if (ConverterCSVModel.PageRange == "")
             {
@@ -222,9 +260,11 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 {
                     case "ForEachPageRadioBtn":
                         ConverterCSVModel.Options.IsMergeCsv = false;
+                        ConverterCSVModel.IsCustomFileName = false;
                         break;
                     case "OnlyTableRadioBtn":
                         ConverterCSVModel.Options.IsMergeCsv = true;
+                        ConverterCSVModel.IsCustomFileName =true;
                         break;
                     default:
                         break;
@@ -257,6 +297,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 ConverterCSVModel.InputPath = pdfViewer.Document.FilePath;
                 FileInfo fileinfo = new FileInfo(ConverterCSVModel.InputPath);
                 ConverterCSVModel.Options.IsMergeCsv = false;
+                ConverterCSVModel.IsCustomFileName=false;
                 ConverterCSVModel.OutputPath = fileinfo.DirectoryName;
             }
         }

+ 27 - 4
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -131,10 +131,33 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void converter()
         {
-            FolderBrowserDialog dlg = new FolderBrowserDialog();
-            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+            /*
+             *设置这个对话框的起始保存路径
+             */
+            sfd.InitialDirectory = currentViewer.Document.FilePath;
+            /*
+             *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+             */
+            sfd.Filter = "PDF|*.xlsx;";
+            /*
+             *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+             */
+            sfd.FileName = currentViewer.Document.FileName + ".xlsx";
+            /*
+             * 做一些工作
+             */
+            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                ConverterExcelModel.OutputPath = dlg.SelectedPath.Trim();
+                ConverterExcelModel.OutputPath = sfd.FileName;
+                try { if (File.Exists(ConverterExcelModel.OutputPath)) File.Delete(ConverterExcelModel.OutputPath); }
+                catch
+                {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.ShowDialog("文件已被占用", "请重新选则目标路径", "确定");
+                    return;
+                }
+
             }
             else
             {
@@ -212,7 +235,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Count).ToString();
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }

+ 30 - 6
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs

@@ -103,15 +103,39 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         private void converter()
         {
 
-            FolderBrowserDialog dlg = new FolderBrowserDialog();
-            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+            /*
+             *设置这个对话框的起始保存路径
+             */
+            sfd.InitialDirectory = currentViewer.Document.FilePath;
+            /*
+             *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+             */
+            sfd.Filter = "PDF|*.html;";
+            /*
+             *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+             */
+            sfd.FileName = currentViewer.Document.FileName + ".html";
+            /*
+             * 做一些工作
+             */
+            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                ConverterHTMLModel.OutputPath = dlg.SelectedPath.Trim();
+                ConverterHTMLModel.OutputPath = sfd.FileName;
+                try { if (File.Exists(ConverterHTMLModel.OutputPath)) File.Delete(ConverterHTMLModel.OutputPath); }
+                catch
+                {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.ShowDialog("文件已被占用", "请重新选则目标路径", "确定");
+                    return;
+                }
+
             }
-            else {
+            else
+            {
                 return;
             }
-         
+
             HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterHTMLModel.PageRange, PageRangeText, true, CurrentPageIndex);
             if (ConverterHTMLModel.PageRange == "")
             {
@@ -184,7 +208,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Count).ToString();
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs

@@ -294,7 +294,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Count).ToString();
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }

+ 27 - 4
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs

@@ -102,10 +102,33 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void converter()
         {
-            FolderBrowserDialog dlg = new FolderBrowserDialog();
-            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+            /*
+             *设置这个对话框的起始保存路径
+             */
+            sfd.InitialDirectory = currentViewer.Document.FilePath;
+            /*
+             *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+             */
+            sfd.Filter = "PDF|*.pptx;";
+            /*
+             *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+             */
+            sfd.FileName = currentViewer.Document.FileName + ".pptx";
+            /*
+             * 做一些工作
+             */
+            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                ConverterPPTModel.OutputPath = dlg.SelectedPath.Trim();
+                ConverterPPTModel.OutputPath = sfd.FileName;
+                try { if (File.Exists(ConverterPPTModel.OutputPath)) File.Delete(ConverterPPTModel.OutputPath); }
+                catch
+                {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.ShowDialog("文件已被占用", "请重新选则目标路径", "确定");
+                    return;
+                }
+
             }
             else
             {
@@ -182,7 +205,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Count).ToString();
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }

+ 27 - 4
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs

@@ -101,10 +101,33 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void converter()
         {
-            FolderBrowserDialog dlg = new FolderBrowserDialog();
-            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+            /*
+             *设置这个对话框的起始保存路径
+             */
+            sfd.InitialDirectory = currentViewer.Document.FilePath;
+            /*
+             *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+             */
+            sfd.Filter = "PDF|*.rtf;";
+            /*
+             *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+             */
+            sfd.FileName = currentViewer.Document.FileName + ".rtf";
+            /*
+             * 做一些工作
+             */
+            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                ConverterRTFModel.OutputPath = dlg.SelectedPath.Trim();
+                ConverterRTFModel.OutputPath = sfd.FileName;
+                try { if (File.Exists(ConverterRTFModel.OutputPath)) File.Delete(ConverterRTFModel.OutputPath); }
+                catch
+                {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.ShowDialog("文件已被占用", "请重新选则目标路径", "确定");
+                    return;
+                }
+
             }
             else
             {
@@ -182,7 +205,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Count).ToString();
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }

+ 27 - 4
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs

@@ -102,10 +102,33 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private  void converter()
         {
-            FolderBrowserDialog dlg = new FolderBrowserDialog();
-            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+            /*
+             *设置这个对话框的起始保存路径
+             */
+            sfd.InitialDirectory = currentViewer.Document.FilePath;
+            /*
+             *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+             */
+            sfd.Filter = "PDF|*.txt;";
+            /*
+             *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+             */
+            sfd.FileName = currentViewer.Document.FileName + ".txt";
+            /*
+             * 做一些工作
+             */
+            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                ConverterTextModel.OutputPath = dlg.SelectedPath.Trim();
+                ConverterTextModel.OutputPath = sfd.FileName;
+                try { if (File.Exists(ConverterTextModel.OutputPath)) File.Delete(ConverterTextModel.OutputPath); }
+                catch
+                {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.ShowDialog("文件已被占用", "请重新选则目标路径", "确定");
+                    return;
+                }
+
             }
             else
             {
@@ -182,7 +205,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Count).ToString();
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }

+ 27 - 4
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs

@@ -1,6 +1,7 @@
 using ComDocumentAIKit;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
+using PDF_Office.EventAggregators;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ConverterDialogs;
@@ -104,10 +105,32 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void converter()
         {
-            FolderBrowserDialog dlg = new FolderBrowserDialog();
-            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+            /*
+             *设置这个对话框的起始保存路径
+             */
+            sfd.InitialDirectory = currentViewer.Document.FilePath;
+            /*
+             *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+             */
+            sfd.Filter = "PDF|*.docx;";
+            /*
+             *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+             */
+            sfd.FileName = currentViewer.Document.FileName + ".docx";
+            /*
+             * 做一些工作
+             */
+            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                ConverterWordModel.OutputPath = dlg.SelectedPath.Trim();
+                ConverterWordModel.OutputPath = sfd.FileName;
+                try {if(File.Exists(ConverterWordModel.OutputPath)) File.Delete(ConverterWordModel.OutputPath); }
+                catch {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.ShowDialog("文件已被占用", "请重新选则目标路径", "确定");
+                    return;
+                }
+               
             }
             else
             {
@@ -184,7 +207,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Count).ToString();
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }

+ 271 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/CreateFromScannerDialogsViewModel.cs

@@ -0,0 +1,271 @@
+using NTwain;
+using NTwain.Data;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Interop;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
+{
+
+    //扫描仪设备
+    public class ScannerItem : BindableBase
+    {
+        public DataSource DataSourceItem { get; set; }
+        public ScannerItem(DataSource dataSource)
+        {
+            DataSourceItem = dataSource;
+            ScannerName = dataSource.Name;
+        }
+        public string ScannerName { get; set; }
+    }
+
+    public class CreateFromScannerDialogsViewModel : BindableBase, IDialogAware
+    {
+
+        private List<ScannerItem> _scanners = new List<ScannerItem>();
+        public List<ScannerItem> Scanners
+        {
+            get { return _scanners; }
+            set => SetProperty(ref _scanners, value);
+        }
+        //图片
+        private ImageSource _img;
+        public ImageSource Img
+        {
+            get { return _img; }
+            set => SetProperty(ref _img, value);
+        }
+
+       //没有检测到扫描仪
+        private bool _isEmptyScanner;
+        public bool IsEmptyScanner
+        {
+            get { return _isEmptyScanner; }
+            set => SetProperty(ref _isEmptyScanner, value);
+        }
+
+        //没有生成图片
+        private bool isEmptyImg;
+        public bool IsEmptyImg
+        {
+            get { return isEmptyImg; }
+            set => SetProperty(ref isEmptyImg, value);
+        }
+
+        public string Title => "";
+        //图片路径
+        public string FilePath { get; private set; }
+        private bool IsScanner = false;
+        public event Action<IDialogResult> RequestClose;
+
+        private TwainSession twain;
+
+
+        public DelegateCommand CancelCommand { get; set; }
+        public DelegateCommand CreateCommand { get; set; }
+        public DelegateCommand<object> SelectedScannerCommand { get; set; }
+
+        public CreateFromScannerDialogsViewModel()
+        {
+            CancelCommand = new DelegateCommand(cancel);
+            CreateCommand = new DelegateCommand(createFile, CanExcuteCreateFile).ObservesProperty(() => Img);
+            SelectedScannerCommand = new DelegateCommand<object>(SelectedScanner);
+
+            SetupTwain();
+
+            if (Scanners.Count > 0)
+                IsEmptyScanner = false;
+            else
+                IsEmptyScanner = true;
+        }
+
+        //选择扫描仪
+        private void SelectedScanner(object obj)
+        {
+            if(obj != null)
+            {
+                if (twain.State == 4)
+                {
+                    twain.CurrentSource.Close();
+                }
+                Img = null;
+                OpenSaveScanner();
+                var result = obj as ScannerItem;
+                if (result.DataSourceItem.Open() != ReturnCode.Success)
+                    MessageBox.Show("连接失败");
+                else
+                {
+                    
+                }
+                Preview();
+            }
+            
+        }
+
+        //启动检测扫描仪
+        private void SetupTwain()
+        {
+            var appId = TWIdentity.CreateFromAssembly(DataGroups.Image, Assembly.GetEntryAssembly());
+            twain = new TwainSession(appId);
+            twain.Open();
+            //Todo:在程序32位时,可正常扫描;
+            //在程序64位时,不能正常获取扫描仪,并崩溃:找不到TWAINDSM.DLL模块。
+
+            foreach (var s in twain.Select(s => new { DS = s }))
+            {
+                var item = new ScannerItem(s.DS);
+                Scanners.Add(item);
+            }
+
+            twain.TransferError += (s, e) =>
+            {
+                CloseSaveScanner();
+               // MessageBox.Show("图片传输错误:" + e.Exception.Message);
+            };
+            twain.DataTransferred += _session_DataTransferred;
+            twain.SourceDisabled += (s, e) =>
+            {
+                //MessageBox.Show("源数据已清除");
+            };
+            twain.TransferReady += (s, e) =>
+            {
+                //MessageBox.Show("数据传输就绪");
+            };
+
+            twain.SynchronizationContext = System.Threading.SynchronizationContext.Current;
+        }
+
+        //生成图片+预览图片
+        private void _session_DataTransferred(object sender, DataTransferredEventArgs e)
+        {
+            if (IsScanner)
+            {
+                string docPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
+                FilePath = docPath + "\\" + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss") + ".png";
+
+                var encoder = new PngBitmapEncoder();
+                encoder.Frames.Add(BitmapFrame.Create(e.GetNativeImageStream().ConvertToWpfBitmap(300, 0)));
+                var test = encoder.Frames[0];
+                FileStream fileStream = new FileStream(FilePath, FileMode.Create, FileAccess.ReadWrite);
+                encoder.Save(fileStream);
+                fileStream.Close();
+                CloseSaveScanner();
+            }
+
+            ImageSource img = GenerateThumbnail(e);
+            if (img != null)
+            {
+                App.Current.Dispatcher.BeginInvoke(new Action(() =>
+                {
+                    Img = img;
+                }));
+            }
+        }
+
+        //图片缩略图
+        private ImageSource GenerateThumbnail(DataTransferredEventArgs e)
+        {
+            BitmapSource img = null;
+
+            switch (e.TransferType)
+            {
+                case XferMech.Native:
+                    using (var stream = e.GetNativeImageStream())
+                    {
+                        if (stream != null)
+                        {
+                            // twain.CurrentSource.Capabilities.ICapYResolution.SetValue();
+                            img = stream.ConvertToWpfBitmap(300, 0);
+                        }
+                    }
+                    break;
+                case XferMech.File:
+                    img = new BitmapImage(new Uri(e.FileDataPath));
+                    if (img.CanFreeze)
+                    {
+                        img.Freeze();
+                    }
+                    break;
+                case XferMech.Memory:
+                    // TODO: build current image from multiple data-xferred event
+                    break;
+            }
+            return img;
+        }
+
+        //预览图片
+        private void Preview()
+        {
+            if (twain.CurrentSource == null) return;
+
+            var windowsPtr = new WindowInteropHelper(Window.GetWindow(App.Current.MainWindow)).Handle;
+            twain.CurrentSource.Enable(SourceEnableMode.NoUI, false, windowsPtr);
+        }
+
+        private void CloseSaveScanner()
+        {
+            IsScanner = false;
+        }
+
+        private void OpenSaveScanner()
+        {
+            IsScanner = true;
+        }
+        /// <summary>
+        /// 是否可以创建
+        /// </summary>
+        /// <returns></returns>
+        private bool CanExcuteCreateFile()
+        {
+            if (Img == null)
+                IsEmptyImg = true;
+            else
+                IsEmptyImg = false;
+
+            return (Img != null);
+        }
+
+        //扫描,创建文件
+        private void createFile()
+        {
+            DialogParameters valuePairs = new DialogParameters();
+            valuePairs.Add(ParameterNames.DataModel, FilePath);
+            RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
+        }
+
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        #region 框架
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+
+        }
+        #endregion
+
+    }
+}

+ 3 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs

@@ -491,6 +491,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             {
                 string file_all = fileName;
                 FileInfo f = new FileInfo(file_all);
+                if (!f.Exists) { continue; }
                 string file_size = (((float)f.Length)/1024).ToString()+" K";
                 imagesdatatable.Rows.Add(f.Name, file_size, ImagesCurrentDataTable.Rows[datatableindex]["FileState"]);
                 datatableindex++;
@@ -608,6 +609,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 topdfdoc.InsertPage(index, width, height, tempFileName);
             }
         }
+
+        public void CloseDialoge() { RequestClose?.Invoke(new DialogResult(ButtonResult.OK));}
         #endregion
 
         #region 构架行为

+ 34 - 19
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs

@@ -47,6 +47,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 
 
         public PrintSettingsInfo PrintSettingsInfo = new PrintSettingsInfo();
+        List<int> PageList = new List<int>();
+
 
         #region 常用字符串
         public string Title => "";
@@ -198,6 +200,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 
         public bool FinishedFrontSideFlag = false;
         public int printCurrentPageIndex;
+        public string PageListString = null;
         public bool isCurrentPage;
 
         /// <summary>
@@ -393,25 +396,25 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
         /// </summary>
         public void SetPaper()
         {
-                PrintSettingsInfo.PrintDocument.PrinterSettings.PrinterName = PrinterName;
-                pageSetupDialog.Document = PrintSettingsInfo.PrintDocument;
-                pageSetupDialog.Document.DefaultPageSettings.Margins = new Margins((int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Left * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Right * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Top * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Bottom * 2.54));
+            PrintSettingsInfo.PrintDocument.PrinterSettings.PrinterName = PrinterName;
+            pageSetupDialog.Document = PrintSettingsInfo.PrintDocument;
+            pageSetupDialog.Document.DefaultPageSettings.Margins = new Margins((int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Left * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Right * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Top * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Bottom * 2.54));
 
-                if (pageSetupDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
-                {
-                    PrintSettingsInfo.IsPaperSizeChanged= true;
-                    PrintSettingsInfo.PrintDocument.DefaultPageSettings = pageSetupDialog.PageSettings;
+            if (pageSetupDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                PrintSettingsInfo.IsPaperSizeChanged = true;
+                PrintSettingsInfo.PrintDocument.DefaultPageSettings = pageSetupDialog.PageSettings;
 
-                    if (!PrintSettingsInfo.PrintDocument.DefaultPageSettings.Landscape)
-                    {
-                        PrintOrientationIndex = 0;
-                    }
-                    else
-                    {
-                        PrintOrientationIndex = 1;
-                    }
-                    this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
-                    PrintSettingsInfo.IsPaperSizeChanged= false;
+                if (!PrintSettingsInfo.PrintDocument.DefaultPageSettings.Landscape)
+                {
+                    PrintOrientationIndex = 0;
+                }
+                else
+                {
+                    PrintOrientationIndex = 1;
+                }
+                this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
+                PrintSettingsInfo.IsPaperSizeChanged = false;
             }
         }
 
@@ -693,7 +696,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
             if (printModInfoWithUnicode.printModInfo.EnumPrintMod == currentHomePagePrinterMod)
             {
                 PrintSettingsInfo.PrintModInfo = printModInfoWithUnicode.printModInfo;
-               this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
+                this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
             }
         }
 
@@ -718,7 +721,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
             param.Add(ParameterNames.PDFViewer, PDFViewer);
             param.Add(ParameterNames.PrintSettingsInfo, PrintSettingsInfo);
             param.Add("Unicode", Unicode);
-           printRegion.RequestNavigate(HomePagePrinterDocumentRegionName, HomePagePrinterDocumentName, param);
+            printRegion.RequestNavigate(HomePagePrinterDocumentRegionName, HomePagePrinterDocumentName, param);
             PageSetupDialog pageSetupDialog = new PageSetupDialog();
             PrintSettingsInfo.PrintDocument.PrinterSettings.PrinterName = PrinterName;
             pageSetupDialog.Document = PrintSettingsInfo.PrintDocument;
@@ -884,6 +887,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 
         public void OnDialogOpened(IDialogParameters parameters)
         {
+
             parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             if (PDFViewer != null && PDFViewer.Document != null)
             {
@@ -899,7 +903,18 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                 {
                     isCurrentPage = false;
                 }
+
+                if (parameters.TryGetValue<List<int>>(ParameterNames.PageList, out PageList))
+                {
+                    PageListString = CommonHelper.GetPageParmFromList(PageList);
+                    if (!string.IsNullOrEmpty(PageListString))
+                    {
+                        PrintSettingsInfo.PageRangeList = PageList;
+                    }
+                }
+
                 System.Windows.Size pageSize = PDFViewer.Document.GetPageSize(0);
+
                 if ((pageSize.Height / pageSize.Width > 1.0 && (double)PrintSettingsInfo.PrintDocument.DefaultPageSettings.PaperSize.Height / PrintSettingsInfo.PrintDocument.DefaultPageSettings.PaperSize.Width < 1.0)
                     || (pageSize.Height / pageSize.Width < 1.0 && (double)PrintSettingsInfo.PrintDocument.DefaultPageSettings.PaperSize.Height / PrintSettingsInfo.PrintDocument.DefaultPageSettings.PaperSize.Width > 1.0))
                 {

+ 34 - 34
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SignatureCreateDialogViewModel.cs

@@ -11,6 +11,7 @@ using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Drawing;
 using System.Drawing.Imaging;
+using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Text;
@@ -214,7 +215,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-        private int thicknessListIndex = 0;
+        private int thicknessListIndex = 3;
 
         public int ThicknessListIndex
         {
@@ -252,7 +253,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             DrawingAttributeObject = new DrawingAttributes();
             StrokesObject = new StrokeCollection();
             FontNameList = new ObservableCollection<string>();
-            ThicknessList = new ObservableCollection<string>() { "1.0pt", "2.0pt", "4.0pt", "6.0pt", "8.0pt" };//改了这里记得去改ThicknessListIndex的Set方法里面的取值
+            ThicknessList = new ObservableCollection<string>() {"0.5pt", "1.0pt", "1.5pt", "2.0pt", "2.5pt", "3.0pt" };//改了这里记得去改ThicknessListIndex的Set方法里面的取值
             CancelCommand = new DelegateCommand(Cancel);
             CreateCommnad = new DelegateCommand(Create);
             CheckedCommnad = new DelegateCommand<object>(Checked);
@@ -442,37 +443,36 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         /// <param name="fontcolor">字体颜色</param>
         /// <param name="backColor">背景颜色</param>
         /// <returns></returns>
-        private Bitmap TextToBitmap(string text, Font font, Rectangle rect, System.Drawing.Color fontcolor, System.Drawing.Color backColor)
+        private Bitmap TextToBitmap(string text, string FontFamily,double size, Rectangle rect, System.Windows.Media.Brush fontcolor, System.Drawing.Color backColor)
         {
-            Graphics g;
-            Bitmap bmp;
-            StringFormat format = new StringFormat(StringFormatFlags.NoClip);
-            if (rect == Rectangle.Empty)
-            {
-                bmp = new Bitmap(1, 1);
-                g = Graphics.FromImage(bmp);
-                //计算绘制文字所需的区域大小(根据宽度计算长度),重新创建矩形区域绘图
-                SizeF sizef = g.MeasureString(text, font, PointF.Empty, format);
+            FormattedText formatText = new FormattedText(text,
+            CultureInfo.CurrentCulture,
+            FlowDirection.LeftToRight,
+            new Typeface(new System.Windows.Media.FontFamily(FontFamily), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal),
+            size,
+            fontcolor, Helper.DpiHelpers.Dpi / 96F);
 
-                int width = (int)(sizef.Width + 1);
-                int height = (int)(sizef.Height + 1);
-                rect = new Rectangle(0, 0, width, height);
-                bmp.Dispose();
+            DrawingVisual drawingVisual = new DrawingVisual();
+            DrawingContext dc = drawingVisual.RenderOpen();
+            dc.DrawText(formatText,new System.Windows.Point(0,0));
+            dc.Close();
 
-                bmp = new Bitmap(width, height);
-            }
-            else
-            {
-                bmp = new Bitmap(rect.Width, rect.Height);
-            }
 
-            g = Graphics.FromImage(bmp);
+            Rect x = drawingVisual.ContentBounds;
+            Rect DrawRect = new Rect(0, 0, x.Width + 2, x.Height + 2);
+
+            RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap((int)DrawRect.Width+2, (int)DrawRect.Height+2, 96F, 96F, PixelFormats.Pbgra32);
+            renderTargetBitmap.Render(drawingVisual);
+
+            MemoryStream stream = new MemoryStream();
+            BitmapEncoder encoder = new PngBitmapEncoder();
+
+            encoder.Frames.Add(BitmapFrame.Create(renderTargetBitmap));
+            encoder.Save(stream);
+
+            Bitmap bitmap = new Bitmap(stream);
 
-            //使用ClearType字体功能
-            g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
-            g.FillRectangle(new SolidBrush(backColor), rect);
-            g.DrawString(text, font, new SolidBrush(fontcolor), rect, format);
-            return bmp;
+            return bitmap;
         }
 
         private void Cancel()
@@ -491,26 +491,26 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             Cancel();
                             return;
                         }
-                        System.Drawing.Color fontcolor = System.Drawing.Color.Black;
+                        System.Windows.Media.Brush fontcolor = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#252629"));
                         switch (RadioButtonIndex)
                         {
                             case 1:
-                                fontcolor = System.Drawing.Color.Black;
+                                fontcolor = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#252629"));
                                 break;
                             case 2:
-                                fontcolor = System.Drawing.Color.Red;
+                                fontcolor = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#F3465B"));
                                 break;
                             case 3:
-                                fontcolor = System.Drawing.Color.Green;
+                                fontcolor = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#273C62"));
                                 break;
                             case 4:
-                                fontcolor = System.Drawing.Color.Blue;
+                                fontcolor = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#94989C"));
                                 break;
                             default:
                                 break;
                         }
 
-                        Bitmap bmp = TextToBitmap(InputText, new Font(FontNameList[fontNameIndex], 48), Rectangle.Empty, fontcolor, System.Drawing.Color.Transparent);
+                        Bitmap bmp = TextToBitmap(InputText, FontNameList[fontNameIndex], 20, Rectangle.Empty, fontcolor, System.Drawing.Color.Transparent);
                         string guid = Guid.NewGuid().ToString();
                         string path = System.IO.Path.Combine(App.CachePath.SignatureStampPath, guid);
                         bmp.Save(path, ImageFormat.Png);

+ 22 - 7
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -60,6 +60,10 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
             if (pdfViewer != null)
             {
                 CurrentFilePath = pdfViewer.Document.FilePath;
+
+                List<string> list = new List<string>();
+                list.Add(CurrentFilePath);
+                AddFiles(list.ToArray());
             }
         }
 
@@ -99,6 +103,16 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                 SetProperty(ref inputHeight, value);
             }
         }
+        private int comboBoxSelectedIndex=0;
+
+        public int ComboBoxSelectedIndex
+        {
+            get { return comboBoxSelectedIndex; }
+            set
+            {
+                SetProperty(ref comboBoxSelectedIndex, value);
+            }
+        }
 
 
         public MergeDialogViewModel(IDialogService dialogService)
@@ -135,21 +149,22 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
             switch (index)
             {
                 case 0:
+                    //打开文件
+                    ComboBoxSelectedIndex = 0;//打开文件弹窗会影响UI更新,所以手动更新
                     AddFiles(OpenFile());
                     break;
                 case 1:
+                    //打开文件夹
+                    ComboBoxSelectedIndex = 1;//打开文件夹弹窗会影响UI更新,所以手动更新
                     AddFiles(OpenFileFolder());
                     break;
                 case 2:
+                    //打开当前文件
                     List<string> list = new List<string>();
 
-                    int Fileindex = App.OpenedFileList.IndexOf(CurrentFilePath);
                     for (int i = 0; i < App.OpenedFileList.Count; i++)
                     {
-                        if (i != Fileindex)
-                        {
-                            list.Add(App.OpenedFileList[i]);
-                        }
+                        list.Add(App.OpenedFileList[i]);
                     }
                     AddFiles(list.ToArray());
                     break;
@@ -396,7 +411,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                     };
 
                     mergeObject.DocName = Path.GetFileName(mergeObject.FilePath);
-                    mergeObject.DocPageCount = 1 + "页";
+                    mergeObject.DocPageCount = 1 + " " + App.MainPageLoader.GetString("Merge_ItemPages");
                     mergeObject.SDKPageCount = 1;
                     mergeObject.DocSize = CommonHelper.GetFileSize(mergeObject.FilePath);
                     mergeObject.DocThumbnail = new BitmapImage(new Uri(mergeObject.FilePath)); ;
@@ -424,7 +439,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                         continue;
                     }
                     mergeObject.DocName = doc.FileName;
-                    mergeObject.DocPageCount = doc.PageCount.ToString() + "页";
+                    mergeObject.DocPageCount = doc.PageCount.ToString() +" "+ App.MainPageLoader.GetString("Merge_ItemPages");
                     mergeObject.SDKPageCount = doc.PageCount;
                     mergeObject.DocSize = CommonHelper.GetFileSize(mergeObject.FilePath);
 

+ 6 - 2
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogViewModel.cs

@@ -19,6 +19,7 @@ using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using ComPDFKitViewer.PdfViewer;
 using Prism.Regions;
 using PDF_Office.Helper;
+using System.Diagnostics;
 
 namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
 {
@@ -401,9 +402,12 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
                 if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     cPDFViewer.Document.Encrypt(openPassword, permissionsPassword, permissionsInfo);
-                    cPDFViewer.Document.WriteToFilePath(sfd.FileName);
+                    cPDFViewer.Document.WriteToFilePath(sfd.FileName);  
+
                     MessageBoxEx.Show("保存成功");
-                    RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
+                    DialogParameters dialogParameters = new DialogParameters();
+                    dialogParameters.Add("FilePath", sfd.FileName);
+                    RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK, dialogParameters));
                 }
                 else
                 {

+ 56 - 1
PDF Office/ViewModels/HomeContentViewModel.cs

@@ -19,6 +19,50 @@ namespace PDF_Office.ViewModels
 {
     public class HomeContentViewModel : BindableBase, INavigationAware
     {
+
+        #region 文案
+
+        private string T_openFiles;
+
+        public string T_OpenFiles
+        {
+            get { return T_openFiles; }
+            set
+            {
+                SetProperty(ref T_openFiles, value);
+            }
+        }
+
+        private string T_createPDF;
+
+        public string T_CreatePDF
+        {
+            get { return T_createPDF; }
+            set
+            {
+                SetProperty(ref T_createPDF, value);
+            }
+        }
+
+        private string T_createPDFToNew;
+
+        public string T_CreatePDFToNew
+        {
+            get { return T_createPDFToNew; }
+            set
+            {
+                SetProperty(ref T_createPDFToNew, value);
+            }
+        }
+        private void InitString()
+        {
+            T_OpenFiles= App.MainPageLoader.GetString("Home_OpenFiles");
+            T_CreatePDF = App.MainPageLoader.GetString("Home_CreatePDF");
+            T_CreatePDFToNew = App.MainPageLoader.GetString("Home_CreateToNew");
+        }
+
+        #endregion
+
         private string fileName = "Home";
         public string FileName
         {
@@ -78,6 +122,8 @@ namespace PDF_Office.ViewModels
             CreateFromOtherFile = new DelegateCommand(createFromOtherFile);
             CreateFromHtmlCommnd = new DelegateCommand(createFormHtml);
             CreateFromScanner = new DelegateCommand(createFromScanner);
+
+            InitString();
         }
 
         /// <summary>
@@ -167,7 +213,16 @@ namespace PDF_Office.ViewModels
         /// </summary>
         private void createFromScanner()
         {
-
+            dialog.ShowDialog(DialogNames.CreateFromScannerDialogs, async e => {
+                if (e.Result == ButtonResult.OK)
+                {
+                    IsLoading = Visibility.Visible;
+                    var model = e.Parameters.GetValue<string>(ParameterNames.DataModel);
+                    mainContentViewModel.CreateFile(model);
+                    IsLoading = Visibility.Collapsed;
+                    
+                }
+            });
         }
 
         /// <summary>

File diff suppressed because it is too large
+ 16 - 5
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs


+ 70 - 0
PDF Office/ViewModels/HomePanel/RecentFiles/RecentFilesContentViewModel.cs

@@ -22,6 +22,75 @@ namespace PDF_Office.ViewModels.HomePanel.RecentFiles
 {
     public class RecentFilesContentViewModel: BindableBase
     {
+        #region 文案
+
+        private string T_title;
+
+        public string T_Title
+        {
+            get { return T_title; }
+            set
+            {
+                SetProperty(ref T_title, value);
+            }
+        }
+
+        private string T_menuShow;
+
+        public string T_MenuShow
+        {
+            get { return T_menuShow; }
+            set
+            {
+                SetProperty(ref T_menuShow, value);
+            }
+        }
+
+        private string T_menuRemove;
+
+        public string T_MenuRemove
+        {
+            get { return T_menuRemove; }
+            set
+            {
+                SetProperty(ref T_menuRemove, value);
+            }
+        }
+        
+        private string T_noFilesTitle;
+
+        public string T_NoFilesTitle
+        {
+            get { return T_noFilesTitle; }
+            set
+            {
+                SetProperty(ref T_noFilesTitle, value);
+            }
+        }
+        
+        private string T_noFilesContent;
+
+        public string T_NoFilesContent
+        {
+            get { return T_noFilesContent; }
+            set
+            {
+                SetProperty(ref T_noFilesContent, value);
+            }
+        }
+
+
+        private void InitString()
+        {
+            T_Title = App.MainPageLoader.GetString("HomeList_Title");
+            T_MenuShow = App.MainPageLoader.GetString("HomeList_MenuShow");
+            T_MenuRemove = App.MainPageLoader.GetString("HomeList_MenuRemove");
+            T_NoFilesTitle = App.MainPageLoader.GetString("HomeList_NoFilesTitle");
+            T_NoFilesContent = App.MainPageLoader.GetString("HomeList_NoFilesContent");
+        }
+
+        #endregion
+
         #region 属性
 
         private ObservableCollection<OpenFileInfo> _recentFilesGroup = new ObservableCollection<OpenFileInfo>();
@@ -84,6 +153,7 @@ namespace PDF_Office.ViewModels.HomePanel.RecentFiles
             InitVariables();
             InitCommands();
             InitEvents();
+            InitString();
         }
 
         #region 初始化

+ 62 - 1
PDF Office/ViewModels/MainContentViewModel.cs

@@ -25,11 +25,69 @@ using System.IO;
 using System.Drawing.Imaging;
 using ComPDFKit.PDFDocument;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
+using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
 
 namespace PDF_Office.ViewModels
 {
     public class MainContentViewModel : BindableBase, INavigationAware
     {
+        #region 文案
+
+        private string T_rename;
+
+        public string T_Rename
+        {
+            get { return T_rename; }
+            set
+            {
+                SetProperty(ref T_rename, value);
+            }
+        }
+
+        private string T_floder;
+
+        public string T_Floder
+        {
+            get { return T_floder; }
+            set
+            {
+                SetProperty(ref T_floder, value);
+            }
+        }
+
+        private string T_close;
+
+        public string T_Close
+        {
+            get { return T_close; }
+            set
+            {
+                SetProperty(ref T_close, value);
+            }
+        }
+
+        private string T_closeAll;
+
+        public string T_CloseAll
+        {
+            get { return T_closeAll; }
+            set
+            {
+                SetProperty(ref T_closeAll, value);
+            }
+        }
+
+        private void InitString()
+        {
+            FileName = App.MainPageLoader.GetString("MultipleTabs_Default");
+            T_Rename = App.MainPageLoader.GetString("MultipleTabs_Rename");
+            T_Floder = App.MainPageLoader.GetString("MultipleTabs_ Folder");
+            T_Close = App.MainPageLoader.GetString("MultipleTabs_ Close");
+            T_CloseAll = App.MainPageLoader.GetString("MultipleTabs_ CloseAll");
+        }
+
+
+        #endregion
         /// <summary>
         /// 是否处于阅读模式
         /// </summary>
@@ -159,12 +217,14 @@ namespace PDF_Office.ViewModels
             UnLoaded = new DelegateCommand(unload);
 
             MainContentRegionName = Guid.NewGuid().ToString();
+
+            InitString();
         }
 
         //关闭页签
         private void unload()
         {
-            if(PDFViewer!=null)
+            if (PDFViewer != null)
             {
                 PDFViewer.CloseDocument();
             }
@@ -316,6 +376,7 @@ namespace PDF_Office.ViewModels
         {
             PDFViewer = new CPDFViewer();
             PDFViewer.CreateDocument();
+
             PDFViewer.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
             if (PDFViewer.Document == null)
             {

+ 39 - 11
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -186,6 +186,10 @@ namespace PDF_Office.ViewModels.PageEdit
             set
             {
                 SetProperty(ref tbPageRange, value);
+                if(string.IsNullOrEmpty(TbPageRange))
+                {
+                    TbPageRange = "请输入范围";
+                }
             }
         }
 
@@ -307,6 +311,18 @@ namespace PDF_Office.ViewModels.PageEdit
             }
         }
 
+        /// <summary>
+        /// 页面缩放的范围
+        /// </summary>
+        private List<Size> ItemSizes = new List<Size>() { 
+            new Size(104,142),
+            new Size(208, 294),
+            new Size(312,441)
+        };
+
+        //选中的页面集合
+        private List<int> selectedPageList = new List<int>();
+
 
         #endregion
 
@@ -792,8 +808,8 @@ namespace PDF_Office.ViewModels.PageEdit
         /// </summary>
         private void ZoomInCommandEvent()
         {
-            ChangeItemSize(new Size(PageEditItems[0].ItemSize.Width *2, PageEditItems[0].ItemSize.Height *2));
             ZoomIndex++;
+            ChangeItemSize(ItemSizes[ZoomIndex+1]);
 
             NotifyUIToRefresh();
         }
@@ -803,8 +819,8 @@ namespace PDF_Office.ViewModels.PageEdit
         /// </summary>
         private void ZoomOutCommandEvent()
         {
-            ChangeItemSize(new Size(PageEditItems[0].ItemSize.Width / 2, PageEditItems[0].ItemSize.Height / 2));
             ZoomIndex--;
+            ChangeItemSize(ItemSizes[ZoomIndex+1]);
             NotifyUIToRefresh();
         }
 
@@ -871,12 +887,12 @@ namespace PDF_Office.ViewModels.PageEdit
 
             if (TbPageRangeVisibility == Visibility.Visible && args != null)
             {
-                List<int> pagelist = new List<int>();
+                selectedPageList = new List<int>();
                 for (int i = 0; i < listbox.SelectedItems.Count; i++)
                 {
-                    if (!pagelist.Contains((listbox.SelectedItems[i] as PageEditItem).PageNumber))
+                    if (!selectedPageList.Contains((listbox.SelectedItems[i] as PageEditItem).PageNumber))
                     {
-                        pagelist.Add((listbox.SelectedItems[i] as PageEditItem).PageNumber);
+                        selectedPageList.Add((listbox.SelectedItems[i] as PageEditItem).PageNumber);
                     }
                 }
 
@@ -886,9 +902,16 @@ namespace PDF_Office.ViewModels.PageEdit
                 //    ComboxSelectIndex = 0;
                 //    return;
                 //}
-
-                string pageparm = CommonHelper.GetPageParmFromList(pagelist);
-                TbPageRange = pageparm;
+                //只选中单个页面是,listselectedIndex 更准确
+                if (selectedPageList.Count == 1)
+                {
+                    TbPageRange = (listSelecedIndex + 1).ToString();
+                }
+                else
+                {
+                    string pageparm = CommonHelper.GetPageParmFromList(selectedPageList);
+                    TbPageRange = pageparm;
+                }
             }
 
             //Ctrl+A时让所有item选中
@@ -927,7 +950,7 @@ namespace PDF_Office.ViewModels.PageEdit
                 return;
             }
 
-            if (args.Key != Key.Enter && args.Key != Key.Back && args.Key != Key.OemComma && args.Key != Key.Subtract && !((args.Key >= Key.D0 && args.Key <= Key.D9) || (args.Key >= Key.NumPad0 && args.Key <= Key.NumPad9)))
+            if (args.Key != Key.Enter && args.Key != Key.Back && args.Key != Key.OemComma && args.Key!=Key.OemMinus && args.Key != Key.Subtract && !((args.Key >= Key.D0 && args.Key <= Key.D9) || (args.Key >= Key.NumPad0 && args.Key <= Key.NumPad9)))
             {
                 args.Handled = true;
             }
@@ -975,10 +998,12 @@ namespace PDF_Office.ViewModels.PageEdit
 
         private void print()
         {
+            PDFViewer.GoToPage(listSelecedIndex);
             DialogParameters printValue = new DialogParameters();
             printValue.Add(ParameterNames.PDFViewer, PDFViewer);
             printValue.Add(ParameterNames.FilePath, PDFViewer.Document.FileName);
             printValue.Add(ParameterNames.PrintCurrentPage, PDFViewer.CurrentIndex);
+            printValue.Add(ParameterNames.PageList,selectedPageList);
             dialogs.ShowDialog(DialogNames.HomePagePrinterDialog, printValue, e => { });
         }
 
@@ -1064,7 +1089,7 @@ namespace PDF_Office.ViewModels.PageEdit
             //    return;
             //}
             IsLoading = Visibility.Visible;
-            int insertindex = maxSelectedIndex;
+            int insertindex = maxSelectedIndex > listSelecedIndex ? maxSelectedIndex : listSelecedIndex;
             insertindex++;
             int pagecount = CacheFilePath.Instance.CopyDoc.PageCount;
             bool result = PDFViewer.Document.ImportPagesAtIndex(CacheFilePath.Instance.CopyDoc, "1-" + pagecount, insertindex);
@@ -1871,6 +1896,9 @@ namespace PDF_Office.ViewModels.PageEdit
                 }
             }
 
+            //旋转页面后取消选中
+            PDFViewer.ClearSelectPDFEdit(true);
+
             //如果是undo,Redo里调用的方法,则不记录到栈里
             if (!isFromUndoRedo)
             {
@@ -2076,7 +2104,7 @@ namespace PDF_Office.ViewModels.PageEdit
         {
             for (int i = startIndex; i <= endIndex; i++)
             {
-                if (i <= PDFViewer.Document.PageCount - 1 && i >= 0 && PageEditItems.Count > 0)
+                if (i <= PageEditItems.Count- 1 && i >= 0 && PageEditItems.Count > 0)
                 {
                     //宽高为样式中图片控件宽高
                     if (PageEditItems[i].isVertical)

+ 20 - 3
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -68,6 +68,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set => SetProperty(ref _erasethicknessLine, value);
         }
 
+        private DoubleCollection _strokeDashArray = new DoubleCollection();
+        public DoubleCollection StrokeDashArray
+        {
+            get { return _strokeDashArray; }
+            set => SetProperty(ref _strokeDashArray, value);
+        }
+
         #endregion 属性
 
         public AnnotAttribEvent AnnotEvent { get; set; }
@@ -134,7 +141,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         private void InitColorItems()
         {
-            BasicVm.ColorItems = AnnotColorList.GetBorderColorList();
+            BasicVm.ColorItems = AnnotColorList.GetColorList(ColorSelectorType.Border);
         }
 
         //设置颜色
@@ -187,13 +194,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 var tag = ((string)obj);
                 DashStyle newDash = new DashStyle();
+                StrokeDashArray = new DoubleCollection();
                 switch (tag)
                 {
                     case "Dashed":
                         newDash.Dashes.Add(2);
                         newDash.Dashes.Add(2);
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.LineStyle, newDash);
-                        
+
+                        StrokeDashArray.Add(1);
+                        StrokeDashArray.Add(1);
                         break;
 
                     case "Solid":
@@ -201,7 +211,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                         break;
 
                 }
-               
+                
                 AnnotEvent?.UpdateAnnot();
             }
         }
@@ -375,6 +385,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 else
                 {
                     BasicVm.SetStrDashStyle("None");
+
                 }
             }
         }
@@ -412,6 +423,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     var isSolid = isSolidStyle(annot);
                     BasicVm.SetStrDashStyle(isSolid ? "Solid" : "Dash");
                     IsPen = true;
+                    StrokeDashArray = new DoubleCollection();
+                    if (isSolid == false)
+                    {
+                        StrokeDashArray.Add(1);
+                        StrokeDashArray.Add(1);
+                    }
                 }
             }
 

+ 52 - 21
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -57,6 +57,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set => SetProperty(ref _currrentDateFormat, value);
         }
 
+
         public List<ComboDataItem> DateFormatItems { get; private set; }
 
         public AnnotAttribEvent AnnotEvent { get; set; }
@@ -135,7 +136,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         private void InitFillColorItems()
         {
-            BasicVm.FillColorItems = AnnotColorList.GetFillColorList();
+            BasicVm.FillColorItems = AnnotColorList.GetColorList(ColorSelectorType.Fill);
         }
 
         private void UpdateDateFormatLists()
@@ -167,22 +168,26 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 switch ((string)obj)
                 {
                     case "AlignLeft":
+                        GetAnnotAlign(TextAlignment.Left);
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Left);
                         break;
 
                     case "AlignCenter":
+                        GetAnnotAlign(TextAlignment.Center);
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Center);
                         break;
 
                     case "AlignRight":
+                        GetAnnotAlign(TextAlignment.Right);
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Right);
                         break;
 
                     case "Justify":
+                        GetAnnotAlign(TextAlignment.Justify);
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Justify);
                         break;
                 }
-
+                
             }
         }
 
@@ -217,7 +222,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 if (item != null)
                 {
                     FontVm.GetCurrentFontSize(item.mFontSize);
-                    FontVm.GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
+
+                    if (item.mFontFamily != null)
+                        FontVm.GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
+
                     FontVm.GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
 
                     Dictionary<AnnotAttrib, object> AnnotAttribDir = new Dictionary<AnnotAttrib, object>();
@@ -271,6 +279,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             if (FontVm.CurrentFontSize != null)
             {
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontSize, FontVm.CurrentFontSize.Value);
+                if (BasicVm.IsMultiSelected == false)
+                    PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
             }
         }
 
@@ -461,7 +471,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-       
+       /// <summary>
+       /// 多选的注释
+       /// </summary>
         private List<FreeTextAnnotArgs> ConvertLists()
         {
             List<FreeTextAnnotArgs> FreeTextLists = new List<FreeTextAnnotArgs>();
@@ -491,12 +503,20 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 isNoEqualsDir.Add("FontStyleFontWeight", false);
                 isNoEqualsDir.Add("FontColor", false);
                 isNoEqualsDir.Add("FillColor", false);
+                isNoEqualsDir.Add("TextAglin", false);
 
                 foreach (var item in list)
                 {
                     if (item == list[0])
                         continue;
 
+                    if (temp.Align != item.Align)
+                    {
+                        isNoEqualsDir["TextAglin"] = true;
+                        FontVm.StrTextAlign = "None";
+                    }
+
+
                     if (temp.FontFamily != item.FontFamily)
                     {
                         isNoEqualsDir["FontFamily"] = true;
@@ -542,6 +562,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 }
 
                 ////以下是多选注释的属性相等时
+                if (isNoEqualsDir["TextAglin"] == false)
+                {
+                    GetAnnotAlign(temp.Align);
+                }
 
                 if (isNoEqualsDir["FontFamily"] == false)
                 {
@@ -585,24 +609,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             FontVm.GetFontWeights_Style(Annot.FontStyle, Annot.FontWeight);
 
             GetTimeFormat();
-
-
-                string str = "";
-            if (Annot.Align == TextAlignment.Left)
-                str = "AlignLeft";
-            else if (Annot.Align == TextAlignment.Center)
-                str = "AlignCenter";
-            else if (Annot.Align == TextAlignment.Right)
-                str = "AlignRight";
-            else if(Annot.Align == TextAlignment.Justify)
-                str = "AlignJustify";
-            else
-                str = "None";
-
-            BasicVm.SetStrDashStyle(str);
-
+            GetAnnotAlign(Annot.Align);
         }
 
+        //填写与签名
         private void GetTimeFormat()
         {
             if (IsFillFreeTextAnnot == false)
@@ -660,6 +670,27 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             IsCheckedTime = isTime;
         }
 
-
+        //文本内容对齐
+        private void GetAnnotAlign(TextAlignment align)
+        {
+            switch (align)
+            {
+                case TextAlignment.Left:
+                    FontVm.StrTextAlign = "Left";
+                    break;
+                case TextAlignment.Center:
+                    FontVm.StrTextAlign = "Center";
+                    break;
+                case TextAlignment.Right:
+                    FontVm.StrTextAlign = "Right";
+                    break;
+                case TextAlignment.Justify:
+                    FontVm.StrTextAlign = "Justify";
+                    break;
+                default:
+                    FontVm.StrTextAlign = "None";
+                    break;
+            }
+        }
     }
 }

+ 145 - 77
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -430,7 +430,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         private bool isLoaded = false;
         private bool isMail = false;
         private bool isSelected = false;
-
+        private bool IsAnnotSelect = true;
         private string historyBtnGOorBackTag = string.Empty;
         private int totalPage = 0;
         private int backPageIndex = 0;
@@ -590,11 +590,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 }
                 else
                 {
+                    BtnLocationIsEnabled = true;
                     ImagePreviewVisibility = Visibility.Collapsed;
                     BtnGOorBackVisibility = Visibility.Collapsed;
                     isSelected = false;
                 }
             }
+            else
+            {
+                BtnLocationIsEnabled = true;
+            }
         }
 
         /// <summary>
@@ -686,6 +691,18 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         /// <param name="obj"></param>
         private void LocationPage(object obj)
         {
+            //没有选择注释工具、也不是右键添加注释
+            //在阅读页,选择注释后,点击按钮
+            //需要设置相关参数
+            if (AnnotAttribEvent.IsAnnotCreateReset == false && propertyPanel.IsAddLink == false)
+            {
+                propertyPanel.IsLocationLink = true;
+
+                pdfViewer.SetMouseMode(MouseModes.AnnotCreate);
+
+                pdfViewer.SetToolParam(LinkAnnotArgs);
+            }
+
             pdfViewer.EnableDrawSelectArea(true);
             historyPageIndex = pdfViewer.CurrentIndex;
             PageNumTextIsEnabled = false;
@@ -708,8 +725,90 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 region.RequestNavigate(viewContentViewModel.TipContentRegionName, "LinkAnnotTip");
             }
-            //if(string.IsNullOrEmpty(PageNumTextContent))
+
             viewContentViewModel.ShowTip(true);
+            //AnnotAttribEvent.IsAnnotCreateReset = true;
+        }
+
+        /// <summary>
+        /// 定位目标范围完成时,触发
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private async void PDFViewer_CustomNotifyHandler(object sender, CustomNotityData e)
+        {
+            if (e.NotifyType == CustomNotifyType.LinkAreaLocate)
+            {
+                if (e.NotifyData is AreaLocate areaInfo)
+                {
+                    if (pdfViewer.ToolManager.CurrentAnnotArgs == null)
+                    {
+                        CleanLocationState();
+
+                        return;
+                    }
+                    if (pdfViewer.ToolManager.CurrentAnnotArgs.EventType == AnnotArgsType.AnnotLink && pdfViewer.MouseMode == MouseModes.AnnotCreate)
+                    {
+                        LinkAnnotArgs linkArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
+                        System.Windows.Size pageSize = pdfViewer.Document.GetPageSize(areaInfo.PageIndex);
+                        linkArgs.IsPositionSet = true;
+                        linkArgs.DestIndex = areaInfo.PageIndex;
+                        linkArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
+
+                        historyPageIndex = linkArgs.PageIndex;
+                        LinkAnnotArgs = linkArgs;
+
+                        AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
+                        AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
+                        AnnotAttribEvent?.UpdateAnnot();
+
+                        LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
+
+                        PageNumTextContent = (areaInfo.PageIndex + 1).ToString();
+                        SetImagePreview(areaInfo.PageIndex);
+
+                        //viewContentViewModel.LinkAnnotTipVisibility = Visibility.Collapsed;
+                        viewContentViewModel.TipVisible = Visibility.Collapsed;
+
+                       
+                        //没有选择注释工具、也不是右键添加注释
+                        //在阅读页,选择注释后,点击按钮
+                        //需要设置相关参数
+                        if (propertyPanel.IsLocationLink)
+                        {
+                            pdfViewer.SetMouseMode(MouseModes.PanTool);
+                            propertyPanel.IsLocationLink = false;
+                        }
+                        await System.Threading.Tasks.Task.Delay(5);
+                        pdfViewer.GoToPage(historyPageIndex);
+
+                        //await System.Threading.Tasks.Task.Delay(5);
+                        SelectAnnotation();
+
+                        BtnLocationIsChecked = false;
+                        //}
+                        //else
+                        //{
+                        //    CleanLocationState();
+                        //    return;
+                        //}
+                    }
+                }
+            }
+        }
+
+        private void CleanLocationState()
+        {
+            viewContentViewModel.TipVisible = Visibility.Collapsed;
+            BtnLocationIsChecked = false;
+            propertyPanel.IsLocationLink = false;
+            //没有选择注释工具、也不是右键添加注释
+            //在阅读页,选择注释后,点击按钮
+            //需要设置相关参数
+            if (propertyPanel.IsAddLink == false)
+            {
+                pdfViewer.SetMouseMode(MouseModes.PanTool);
+            }
         }
 
         /// <summary>
@@ -824,9 +923,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         /// </summary>
         private void SelectAnnotation()
         {
-            if (linkAnnotArgs != null && !isSelected && linkAnnotArgs.AnnotIndex >= 0)
+            if (LinkAnnotArgs != null && !isSelected && LinkAnnotArgs.AnnotIndex >= 0)
             {
-                pdfViewer.SelectAnnotation(linkAnnotArgs.PageIndex, linkAnnotArgs.AnnotIndex);
+                pdfViewer.SelectAnnotation(LinkAnnotArgs.PageIndex, LinkAnnotArgs.AnnotIndex);
                 isSelected = true;
             }
             else
@@ -1049,6 +1148,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 }
                 if (AnnotAttribEvent.IsAnnotCreateReset == false)
                 {
+                    //根据选择的,链接,获取对应的信息
                     GetAnnotAttribute();
                 }
 
@@ -1082,49 +1182,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-        /// <summary>
-        /// 定位目标范围完成时,触发
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private async void PDFViewer_CustomNotifyHandler(object sender, CustomNotityData e)
-        {
-            if (e.NotifyType == CustomNotifyType.LinkAreaLocate)
-            {
-                if (e.NotifyData is AreaLocate areaInfo)
-                {
-                    if (pdfViewer.ToolManager.CurrentAnnotArgs.EventType == AnnotArgsType.AnnotLink && pdfViewer.MouseMode == MouseModes.AnnotCreate)
-                    {
-                        LinkAnnotArgs linkArgs = pdfViewer.ToolManager.CurrentAnnotArgs as LinkAnnotArgs;
-                        System.Windows.Size pageSize = pdfViewer.Document.GetPageSize(areaInfo.PageIndex);
-                        linkArgs.IsPositionSet = true;
-                        linkArgs.DestIndex = areaInfo.PageIndex;
-                        linkArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
-
-                        LinkAnnotArgs = linkArgs;
-                        LinkAnnotArgs.PageIndex = historyPageIndex;
-
-                        AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
-                        AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
-                        AnnotAttribEvent?.UpdateAnnot();
-
-                        LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
-
-                        PageNumTextContent = (areaInfo.PageIndex + 1).ToString();
-                        SetImagePreview(areaInfo.PageIndex);
-
-                        await System.Threading.Tasks.Task.Delay(2);
-                        SelectAnnotation();
-
-                        pdfViewer.GoToPage(historyPageIndex);
-                        //viewContentViewModel.LinkAnnotTipVisibility = Visibility.Collapsed;
-                        viewContentViewModel.TipVisible = Visibility.Collapsed;
-                        BtnLocationIsChecked = false;
-                    }
-                }
-            }
-        }
-
         /// <summary>
         /// 选择链接后,显示参数
         /// </summary>
@@ -1132,6 +1189,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         {
             if (AnnotAttribEvent.Attribs.ContainsKey(AnnotAttrib.LinkType))
             {
+                //设置显示的链接模块
                 SetLinkType((LINK_TYPE)AnnotAttribEvent.Attribs[AnnotAttrib.LinkType]);
             }
             if (AnnotAttribEvent.Attribs.ContainsKey(AnnotAttrib.LinkDestIndx) && !AnnotAttribEvent.IsAnnotCreateReset)
@@ -1146,36 +1204,38 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     LinkAnnotArgs.PageIndex = pdfViewer.CurrentIndex;
                 }
             }
-            if (AnnotAttribEvent.Attribs.ContainsKey(AnnotAttrib.LinkUri))
-            {
-                string linkUrl = (string)AnnotAttribEvent.Attribs[AnnotAttrib.LinkUri];
-                if (!string.IsNullOrEmpty(linkUrl))
-                {
-                    if (linkUrl.StartsWith("mailto:", StringComparison.OrdinalIgnoreCase))
-                    {
-                        SetLinkType(LINK_TYPE.URI, true);
-                        if (AnnotAttribEvent.IsAnnotCreateReset)
-                        {
-                            SetLinkEmail("");
-                        }
-                        else
-                        {
-                            SetLinkEmail(linkUrl.ToLower().TrimStart("mailto:".ToCharArray()));
-                        }
-                    }
-                    else
-                    {
-                        if (AnnotAttribEvent.IsAnnotCreateReset)
-                        {
-                            SetLinkUrl("");
-                        }
-                        else
-                        {
-                            SetLinkUrl(linkUrl);
-                        }
-                    }
-                }
-            }
+            //暂定 第一版 不显示邮箱、web链接模块
+
+            //if (AnnotAttribEvent.Attribs.ContainsKey(AnnotAttrib.LinkUri))
+            //{
+            //    string linkUrl = (string)AnnotAttribEvent.Attribs[AnnotAttrib.LinkUri];
+            //    if (!string.IsNullOrEmpty(linkUrl))
+            //    {
+            //        if (linkUrl.StartsWith("mailto:", StringComparison.OrdinalIgnoreCase))
+            //        {
+            //            SetLinkType(LINK_TYPE.URI, true);
+            //            if (AnnotAttribEvent.IsAnnotCreateReset)
+            //            {
+            //                SetLinkEmail("");
+            //            }
+            //            else
+            //            {
+            //                SetLinkEmail(linkUrl.ToLower().TrimStart("mailto:".ToCharArray()));
+            //            }
+            //        }
+            //        else
+            //        {
+            //            if (AnnotAttribEvent.IsAnnotCreateReset)
+            //            {
+            //                SetLinkUrl("");
+            //            }
+            //            else
+            //            {
+            //                SetLinkUrl(linkUrl);
+            //            }
+            //        }
+            //    }
+            //}
         }
 
         private void SetLinkUrl(string url)
@@ -1222,6 +1282,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             BtnLinkPageIsChecked = false;
             BtnLinkMailIsChecked = false;
             BtnLinkWebIsChecked = false;
+            //暂定 第一版 不显示邮箱、web链接模块
+            if (linkType == LINK_TYPE.URI)
+            {
+                BtnLinkPageIsChecked = true;
+                BtnGOorBackVisibility = Visibility.Collapsed;
+                viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                return;
+            }
             switch (linkType)
             {
                 case LINK_TYPE.GOTO:

+ 17 - 4
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -5,6 +5,7 @@ using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
+using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
@@ -146,12 +147,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         private void InitColorItems()
         {
-            BasicVm.ColorItems = AnnotColorList.GetBorderColorList();
+            BasicVm.ColorItems = AnnotColorList.GetColorList(ColorSelectorType.Border);
         }
 
         private void InitFillColorItems()
         {
-            BasicVm.FillColorItems = AnnotColorList.GetFillColorList();
+            BasicVm.FillColorItems = AnnotColorList.GetColorList(ColorSelectorType.Fill);
         }
 
         private void ThicknessChanged_Command(object obj)
@@ -257,6 +258,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     Dash = dashAnnot;
                     PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.LineStyle, dash);
                 }
+
+                if (BasicVm.IsMultiSelected == false)
+                    PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
             }
         }
 
@@ -272,6 +276,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     BasicVm.FillColor = new SolidColorBrush(colorValue);
                     BasicVm.FillColor.Opacity = BasicVm.FillOpacity;
                     PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FillColor, colorValue);
+
+                    if (BasicVm.IsMultiSelected == false)
+                        PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
                 }
             }
 
@@ -286,7 +293,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 BasicVm.FillColor.Opacity = BasicVm.FillOpacity;
 
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity);
-                PropertyPanel.InvokeToMyTools(AnnotArgsType.AnnotFreehand, BasicVm.FillOpacity);
+                PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, BasicVm.FillOpacity);
 
             }
 
@@ -300,7 +307,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 BasicVm.FillColor.Opacity = BasicVm.FillOpacity;
 
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity);
-                PropertyPanel.InvokeToMyTools(AnnotArgsType.AnnotFreehand, BasicVm.FillOpacity);
+                PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, BasicVm.FillOpacity);
             }
 
         }
@@ -318,6 +325,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     BasicVm.BorderColor = new SolidColorBrush(colorValue);
                     BasicVm.BorderColor.Opacity = BasicVm.BorderOpacity;
                     PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, colorValue);
+
+                    if (BasicVm.IsMultiSelected == false)
+                        PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
                 }
             }
 
@@ -330,6 +340,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 var tran = (double)obj;
                 BasicVm.AnnotThickness = tran;
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, tran);
+
+                if (BasicVm.IsMultiSelected == false)
+                    PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
             }
         }
 

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs

@@ -105,7 +105,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 PDFViewer?.CropPage(0, rect, cropPageList);
                 PDFViewer.GoToPage(CurrentIndex);
 
-                //PDFViewer.UndoManager.CanSave = true;
+                PDFViewer.UndoManager.CanSave = true;
                 PDFViewer.SetMouseMode(MouseModes.PanTool);
                 if (SnapToolEvent != null)
                 {

+ 2 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -4,6 +4,7 @@ using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
+using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
@@ -96,7 +97,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         private void InitColorItems()
         {
-            ColorItems = AnnotColorList.GetStyleColorList();
+            ColorItems = AnnotColorList.GetColorList(ColorSelectorType.Sticky);
         }
 
         private void SelectedValueChanged_Command(object obj)

+ 13 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs

@@ -5,6 +5,7 @@ using PDF_Office.Model;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Properties;
 using PDF_Office.ViewModels.Tools;
+using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
@@ -72,6 +73,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set => SetProperty(ref _basicVm, value);
         }
 
+        private ColorSelectorType _colorType = ColorSelectorType.Highlight;
+        public ColorSelectorType ColorType
+        {
+            get { return _colorType; }
+            set => SetProperty(ref _colorType, value);
+        }
+
         public List<ColorItem> HighlightItems { get; set; }
         public List<ColorItem> UnderLineItems { get; set; }
 
@@ -94,12 +102,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         private void InitHighlightItems()
         {
-            HighlightItems = AnnotColorList.GetHighlightColorList();
+            HighlightItems = AnnotColorList.GetColorList(ColorSelectorType.Highlight);
         }
 
         private void InitUnderLinetItems()
         {
-            UnderLineItems = AnnotColorList.GetBorderColorList(); 
+            UnderLineItems = AnnotColorList.GetColorList(ColorSelectorType.Border); 
         }
 
 
@@ -187,6 +195,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 if (BasicVm.IsMultiSelected)
                 {
                     BasicVm.ColorItems = HighlightItems;
+                    ColorType = ColorSelectorType.Highlight;
                     var annotate = Settings.Default.AppProperties.Annotate;
                     if (annotate != null)
                     {
@@ -212,10 +221,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             if(BasicVm.AnnotType == AnnotArgsType.AnnotHighlight)
             {
                 BasicVm.ColorItems = HighlightItems;
+                ColorType = ColorSelectorType.Highlight;
             }
             else
             {
                 BasicVm.ColorItems = UnderLineItems;
+                ColorType = ColorSelectorType.Border;
             }
         }
 

+ 0 - 1
PDF Office/ViewModels/TipContent/FileRestrictedTipViewModel.cs

@@ -18,7 +18,6 @@ namespace PDF_Office.ViewModels.TipContent
         public IDialogService DialogService;
 
         private CPDFViewer PDFViewer;
-
         public DelegateCommand CloseTipCommand { get; set; }
         public DelegateCommand RestrictCommand { get; set; }
         public FileRestrictedTipViewModel(IEventAggregator eventAggregator, IDialogService dialogService)

+ 347 - 161
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -23,6 +23,8 @@ using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
 using System.Windows.Media;
 using System.Diagnostics;
+using PDF_Office.Model.AnnotPanel;
+using System.Windows.Input;
 
 namespace PDF_Office.ViewModels.Tools
 {
@@ -131,160 +133,9 @@ namespace PDF_Office.ViewModels.Tools
 
         #endregion 事件绑定和解绑
 
-        #region PDFViewer事件
-
-        //选中和非选中注释
-        private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
-        {
-            if (e != null)
-            {
-                var annot = e.AnnotItemsList[0];
-                if (annot != null)
-                {
-                    if (e.AnnotItemsList.Count == 1)
-                    {
-                        //IsAnnotCreateReset:是否为创建注释的状态
-                        if (e.IsAnnotCreateReset == false)
-                        {
-                            GetSelectedAnnots(e);
-                        }
-                        else
-                        {
-                            switch (annot.EventType)
-                            {
-                                case AnnotArgsType.AnnotLink:
-                                    //viewContentViewModel.IsCreateLink = false;
-                                    GetLink(e.AnnotItemsList, e);
-                                    PDFViewer.SetToolParam(annot);
-                                    break;
-                            }
-                            //TODO: 设计已重新调整为(仅限高亮注释):修改注释后,会作用到之后添加的注释中。因此先把此逻辑“创建注释后,会自动回到默认值”注释掉
-                            if (annot.EventType != AnnotArgsType.AnnotStrikeout &&
-                            annot.EventType != AnnotArgsType.AnnotUnderline &&
-                            annot.EventType != AnnotArgsType.AnnotHighlight &&
-                            annot.EventType != AnnotArgsType.AnnotSquiggly &&
-                            annot.EventType != AnnotArgsType.AnnotLink &&
-                            annot.EventType != AnnotArgsType.AnnotFreehand &&
-                            annot.EventType != AnnotArgsType.AnnotSticky
-                            )
-                            {
-                                if (ToolExpandDict.ContainsValue(e.AnnotItemsList[0].EventType))
-                                {
-                                    var strLineAnnotTag = "";
-                                    if(e.AnnotItemsList[0] is LineAnnotArgs)
-                                    {
-                                        var lineAnnot = e.AnnotItemsList[0] as LineAnnotArgs;
-                                        if (lineAnnot.HeadLineType == C_LINE_TYPE.LINETYPE_NONE && lineAnnot.TailLineType == C_LINE_TYPE.LINETYPE_NONE)
-                                        {
-                                            strLineAnnotTag = "Line";
-                                        }
-                                        else
-                                        {
-                                            strLineAnnotTag = "Arrow";
-                                        }
-                                    }
-
-                                    foreach (var item in ToolExpandDict)
-                                    {
-                                        if (item.Value == e.AnnotItemsList[0].EventType)
-                                        {
-                                            annot = null;//新建注释时,回到默认值
-                                            if(string.IsNullOrEmpty(strLineAnnotTag))
-                                            {
-                                                FindAnnotTypeKey(item.Key, ref annot);
-                                                break;
-                                            }
-                                            else
-                                            {
-                                                if(strLineAnnotTag == item.Key)
-                                                {
-                                                    FindAnnotTypeKey(item.Key, ref annot);
-                                                    break;
-                                                }
-                                                    
-                                            }
-                                           
-                                        }
-                                    }
-                                }
-                            }
-                            //else
-                            PDFViewer.SetToolParam(annot);
-                            #region TO DO
-
-                            //设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
-                            //if (isRightMenuAddAnnot && annot.EventType!=AnnotArgsType.AnnotLink)
-                            //{
-                            //    ShowPropertyPanel(false);
-                            //}
-                            //else
-                            //{
-                            //    ShowPropertyPanel();
-                            //}
-
-                            #endregion TO DO
-                        }
-                    }
-                    else
-                    {
-                        bool isDifferentAnnotTyle = false;
-                        var lastAnnot = annot;
-                        foreach (var item in e.AnnotItemsList)
-                        {
-                            if (lastAnnot.EventType != item.EventType)
-                            {
-                                if ((isShapAnnot(annot) == true && isShapAnnot(item) == true) || (isHightAnnot(annot) == true && isHightAnnot(item) == true))
-                                {
-                                    lastAnnot = item;
-                                    continue;
-                                }
-
-                                lastAnnot = item;
-                                isDifferentAnnotTyle = true;
-                                break;
-                            }
-                        }
-
-                        if (isDifferentAnnotTyle)
-                            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-                        else
-                            GetSelectedAnnots(e);
-                    }
-                }
-
-                //注释列表同步选中
-                var list = e.GetPageAnnotsIndex();
-                bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
-
-                if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true && bOTAContent.TabItemAnnotation.IsSelected == true && list != null && list.Count > 0)
-                {
-                    if (list.Keys.Count == 0)
-                    {
-                        return;
-                    }
-                    var pageindex = new List<int>(list.Keys);
-                    List<int> annotes = new List<int>();
-                    list.TryGetValue(pageindex[0], out annotes);
-                    int annoteindex = annotes[0];
-                    AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
-
-                    if (viewModel != null)
-                    {
-                        viewModel.ScrollToAnnot(pageindex[0], annoteindex, annotation.AnnotationList);
-                    }
-                }
-            }
-            else
-            {
-                if (BtnLinkIsChecked == false)
-                {
-                    if (PDFViewer.MouseMode != MouseModes.AnnotCreate && PDFViewer.MouseMode != MouseModes.PanTool)
-                        viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-                }
-
-            }
-        }
+        #region 与触发事件调用相关的函数
 
+        //是否为形状注释
         private bool isShapAnnot(AnnotHandlerEventArgs annot)
         {
             if (annot.EventType == AnnotArgsType.AnnotCircle ||
@@ -300,6 +151,7 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        //是否为高亮注释
         private bool isHightAnnot(AnnotHandlerEventArgs annot)
         {
             if (annot.EventType == AnnotArgsType.AnnotUnderline ||
@@ -379,8 +231,9 @@ namespace PDF_Office.ViewModels.Tools
 
                 case AnnotArgsType.AnnotLink:
                     //viewContentViewModel.IsCreateLink = false;
+                    //e.IsAnnotCreateReset= true;
+                    propertyPanel.IsAddLink = false;
                     GetLink(e.AnnotItemsList, e);
-
                     break;
 
                 case AnnotArgsType.AnnotSticky:
@@ -395,12 +248,173 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        #endregion 与触发事件调用相关的函数
+
+        #region PDFViewer事件
+
+        //选中和非选中注释
+        private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
+        {
+            if (e != null)
+            {
+                var annot = e.AnnotItemsList[0];
+                if (annot != null)
+                {
+                    if (e.AnnotItemsList.Count == 1)
+                    {
+                        //IsAnnotCreateReset:是否为创建注释的状态
+                        if (e.IsAnnotCreateReset == false)
+                        {
+                            GetSelectedAnnots(e);
+                        }
+                        else
+                        {
+                            switch (annot.EventType)
+                            {
+                                case AnnotArgsType.AnnotLink:
+                                    //viewContentViewModel.IsCreateLink = false;
+                                    GetLink(e.AnnotItemsList, e);
+                                    PDFViewer.SetToolParam(annot);
+                                    break;
+                            }
+
+                            //TODO: 修改注释后,会作用到之后添加的注释中。因此先把此逻辑“创建注释后,会自动回到默认值”注释掉
+                            //注释代码原因:设计已经重新调整逻辑:所有注释创建后,编辑属性,所有属性会作用于下次创建的注释中。
+                            //if (annot.EventType != AnnotArgsType.AnnotStrikeout &&
+                            //annot.EventType != AnnotArgsType.AnnotUnderline &&
+                            //annot.EventType != AnnotArgsType.AnnotHighlight &&
+                            //annot.EventType != AnnotArgsType.AnnotSquiggly &&
+                            //annot.EventType != AnnotArgsType.AnnotLink &&
+                            //annot.EventType != AnnotArgsType.AnnotFreehand &&
+                            //annot.EventType != AnnotArgsType.AnnotSticky &&
+                            //)
+                            //{
+                            //    if (ToolExpandDict.ContainsValue(e.AnnotItemsList[0].EventType))
+                            //    {
+                            //        var strLineAnnotTag = "";
+                            //        if (e.AnnotItemsList[0] is LineAnnotArgs)
+                            //        {
+                            //            var lineAnnot = e.AnnotItemsList[0] as LineAnnotArgs;
+                            //            if (lineAnnot.HeadLineType == C_LINE_TYPE.LINETYPE_NONE && lineAnnot.TailLineType == C_LINE_TYPE.LINETYPE_NONE)
+                            //            {
+                            //                strLineAnnotTag = "Line";
+                            //            }
+                            //            else
+                            //            {
+                            //                strLineAnnotTag = "Arrow";
+                            //            }
+                            //        }
+
+                            //        foreach (var item in ToolExpandDict)
+                            //        {
+                            //            if (item.Value == e.AnnotItemsList[0].EventType)
+                            //            {
+                            //                annot = null;//新建注释时,回到默认值
+                            //                if (string.IsNullOrEmpty(strLineAnnotTag))
+                            //                {
+                            //                    FindAnnotTypeKey(item.Key, ref annot);
+                            //                    break;
+                            //                }
+                            //                else
+                            //                {
+                            //                    if (strLineAnnotTag == item.Key)
+                            //                    {
+                            //                        FindAnnotTypeKey(item.Key, ref annot);
+                            //                        break;
+                            //                    }
+                            //                }
+                            //            }
+                            //        }
+
+                            //        PDFViewer.SetToolParam(annot);
+                            //    }
+                            //}
+
+                            #region TO DO
+
+                            //设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
+                            //if (isRightMenuAddAnnot && annot.EventType!=AnnotArgsType.AnnotLink)
+                            //{
+                            //    ShowPropertyPanel(false);
+                            //}
+                            //else
+                            //{
+                            //    ShowPropertyPanel();
+                            //}
+
+                            #endregion TO DO
+                        }
+                    }
+                    else
+                    {
+                        bool isDifferentAnnotTyle = false;
+                        var lastAnnot = annot;
+                        foreach (var item in e.AnnotItemsList)
+                        {
+                            if (lastAnnot.EventType != item.EventType)
+                            {
+                                if ((isShapAnnot(annot) == true && isShapAnnot(item) == true) || (isHightAnnot(annot) == true && isHightAnnot(item) == true))
+                                {
+                                    lastAnnot = item;
+                                    continue;
+                                }
+
+                                lastAnnot = item;
+                                isDifferentAnnotTyle = true;
+                                break;
+                            }
+                        }
+
+                        if (isDifferentAnnotTyle)
+                            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                        else
+                            GetSelectedAnnots(e);
+                    }
+                }
+
+                //注释列表同步选中
+                var list = e.GetPageAnnotsIndex();
+                bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
+
+                if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true && bOTAContent.TabItemAnnotation.IsSelected == true && list != null && list.Count > 0)
+                {
+                    if (list.Keys.Count == 0)
+                    {
+                        return;
+                    }
+                    var pageindex = new List<int>(list.Keys);
+                    List<int> annotes = new List<int>();
+                    list.TryGetValue(pageindex[0], out annotes);
+                    int annoteindex = annotes[0];
+                    AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
+
+                    if (viewModel != null)
+                    {
+                        viewModel.ScrollToAnnot(pageindex[0], annoteindex, annotation.AnnotationList);
+                    }
+                }
+            }
+            else
+            {
+                if (BtnLinkIsChecked == false)
+                {
+                    if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
+                    {
+                        if (PDFViewer.MouseMode == MouseModes.PanTool && propertyPanel.IsAddLink == false && propertyPanel.IsLocationLink == false)
+                        {
+                            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                        }
+                    }
+                }
+            }
+        }
+
         //在注释工具的状态下,右键菜单
         private void PDFViewer_AnnotCommandHandler(object sender, AnnotCommandArgs e)
         {
             if (e.AnnotEventArgsList == null || (PDFViewer != null && PDFViewer.MouseMode == MouseModes.FormEditTool))
                 return;
-            
+
             switch (e.CommandType)
             {
                 case CommandType.Context:
@@ -416,12 +430,25 @@ namespace PDF_Office.ViewModels.Tools
                             if (e.AnnotEventArgsList.Count == 1)
                             {
                                 var selectedAnnot = e.AnnotEventArgsList[0];
+                                PopMenuCheckedLineDash(selectedAnnot);
+                                PopMenuCheckedFontFamily(selectedAnnot);
+                                PopMenuCheckedTextAglin(selectedAnnot);
+
                                 switch (selectedAnnot.EventType)
                                 {
                                     case AnnotArgsType.AnnotHighlight:
                                     case AnnotArgsType.AnnotUnderline:
                                     case AnnotArgsType.AnnotStrikeout:
                                     case AnnotArgsType.AnnotSquiggly:
+                                        if (selectedAnnot.EventType == AnnotArgsType.AnnotHighlight)
+                                        {
+                                            colorContent.ItemSource = AnnotColorList.GetColorList(ColorSelectorType.Highlight);
+                                        }
+                                        else
+                                        {
+                                            colorContent.ItemSource = AnnotColorList.GetColorList(ColorSelectorType.Border);
+                                        }
+
                                         e.PopupMenu = HightAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
 
@@ -440,10 +467,12 @@ namespace PDF_Office.ViewModels.Tools
                                     case AnnotArgsType.AnnotSquare:
                                     case AnnotArgsType.AnnotCircle:
                                         ShapeAnnotPopMenu.SetVisual("ShapeDirect", false);
+                                        ShapeAnnotPopMenu.SetVisual("ShapeFillColor", true);
                                         e.PopupMenu = ShapeAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
 
                                     case AnnotArgsType.AnnotLine:
+                                        ShapeAnnotPopMenu.SetVisual("ShapeFillColor", false);
                                         ShapeAnnotPopMenu.SetVisual("ShapeDirect", true);
                                         e.PopupMenu = ShapeAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
@@ -483,7 +512,7 @@ namespace PDF_Office.ViewModels.Tools
                     {
                         if (e.PressOnSelectedText || e.CommandTarget == TargetType.ImageSelection)
                         {
-                            e.PopupMenu = NoneSelectAnnotContextMenu(sender, e);
+                            e.PopupMenu = SelectedTextOrImageContextMenu(sender, e);
                             if (e.PopupMenu != null)
                             {
                                 e.Handle = true;
@@ -503,6 +532,89 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        //右键菜单,选中字体样式按钮状态
+        private void PopMenuCheckedFontFamily(AnnotHandlerEventArgs annot)
+        {
+            if (annot != null)
+            {
+                if (annot.EventType == AnnotArgsType.AnnotFreeText)
+                {
+                    var freeText = annot as FreeTextAnnotArgs;
+                    FreeTextAnnotPopMenu.SetIsChecked(freeText.FontFamily.ToString(), true);
+                }
+            }
+        }
+
+        //右键菜单,选中文本内容对齐按钮状态
+        private void PopMenuCheckedTextAglin(AnnotHandlerEventArgs annot)
+        {
+            if (annot != null)
+            {
+                if (annot.EventType == AnnotArgsType.AnnotFreeText)
+                {
+                    var freeText = annot as FreeTextAnnotArgs;
+                    switch (freeText.Align)
+                    {
+                        case TextAlignment.Left:
+                            FreeTextAnnotPopMenu.SetIsChecked("FreeTextAglinLeft", true);
+                            break;
+
+                        case TextAlignment.Center:
+                            FreeTextAnnotPopMenu.SetIsChecked("FreeTextAglinCenter", true);
+                            break;
+
+                        case TextAlignment.Right:
+                            FreeTextAnnotPopMenu.SetIsChecked("FreeTextAglinRight", true);
+                            break;
+
+                        case TextAlignment.Justify:
+                            FreeTextAnnotPopMenu.SetIsChecked("FreeTextAglinJustify", true);
+                            break;
+
+                        default:
+                            FreeTextAnnotPopMenu.SetIsChecked("FreeTextAglinLeft", false);
+                            FreeTextAnnotPopMenu.SetIsChecked("FreeTextAglinCenter", false);
+                            FreeTextAnnotPopMenu.SetIsChecked("FreeTextAglinRight", false);
+                            FreeTextAnnotPopMenu.SetIsChecked("FreeTextAglinJustify", false);
+                            break;
+                    }
+                }
+            }
+        }
+
+        //右键菜单,选中虚实线按钮状态
+        private void PopMenuCheckedLineDash(AnnotHandlerEventArgs annot)
+        {
+            if (annot != null)
+            {
+                bool isSolidLineDash = true;
+                if (annot.EventType == AnnotArgsType.AnnotFreehand)
+                {
+                    var freeHand = annot as FreehandAnnotArgs;
+                    isSolidLineDash = AnnotPropertyPanel.IsSolidStyle(freeHand.LineDash);
+                    FreeHandAnnotPopMenu.SetIsChecked(isSolidLineDash ? "FreeHandSolid" : "FreeHandDash", true);
+                }
+                else if (annot.EventType == AnnotArgsType.AnnotSquare)
+                {
+                    var square = annot as SquareAnnotArgs;
+                    isSolidLineDash = AnnotPropertyPanel.IsSolidStyle(square.LineDash);
+                    ShapeAnnotPopMenu.SetIsChecked(isSolidLineDash ? "ShapeSolid" : "ShapeDash", true);
+                }
+                else if (annot.EventType == AnnotArgsType.AnnotCircle)
+                {
+                    var circle = annot as CircleAnnotArgs;
+                    isSolidLineDash = AnnotPropertyPanel.IsSolidStyle(circle.LineDash);
+                    ShapeAnnotPopMenu.SetIsChecked(isSolidLineDash ? "ShapeSolid" : "ShapeDash", true);
+                }
+                else if (annot.EventType == AnnotArgsType.AnnotLine)
+                {
+                    var line = annot as LineAnnotArgs;
+                    isSolidLineDash = AnnotPropertyPanel.IsSolidStyle(line.LineDash);
+                    ShapeAnnotPopMenu.SetIsChecked(isSolidLineDash ? "ShapeSolid" : "ShapeDash", true);
+                }
+            }
+        }
+
         /// <summary>
         /// 内容选择工具
         /// </summary>
@@ -653,7 +765,6 @@ namespace PDF_Office.ViewModels.Tools
                                 PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
                             }
 
-
                             break;
 
                         case ActionType.Del:
@@ -712,6 +823,68 @@ namespace PDF_Office.ViewModels.Tools
                 Pen hoverPen = new Pen(new SolidColorBrush(Color.FromArgb(0xff, 0x11, 0x8A, 0xff)), 1);
                 hoverPen.DashStyle = DashStyles.Dash;
                 e.DrawContext?.DrawRectangle(null, hoverPen, hoverRect);
+
+                //Todo:目前ComPDFKit.Viewer没有e.Annot参数
+                //便签,显示ToolTip内容
+                //if (e.Annot != null && e.Annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_TEXT)
+                //{
+                //    if (PDFViewer.ToolTip == null)
+                //    {
+                //        var content = e.Annot.GetContent();
+                //        if (string.IsNullOrEmpty(content) == false)
+                //        {
+                //            ToolTip TipChild = new ToolTip();
+                //            TipChild.Style = App.Current.Resources["FlowToolTip"] as Style;
+                //            TipChild.MaxWidth = 246;
+                //            TipChild.Content = content;
+                //            TipChild.Visibility = Visibility.Visible;
+                //            TipChild.IsOpen = true;
+                //            TipChild.Placement = PlacementMode.Right;
+                //            var rec = e.Annot.GetRect();
+                //            TipChild.PlacementRectangle = new Rect(rec.left, rec.top, rec.right, rec.bottom);
+                //            TipChild.PlacementTarget = PDFViewer.Parent as ContentControl;
+                //            TipChild.Placement = PlacementMode.MousePoint;
+                //            PDFViewer.ToolTip = TipChild;
+                //            oldRect = hoverRect;
+                //            PDFViewer.MouseMove -= PDFViewer_MouseMove;
+                //            PDFViewer.MouseMove += PDFViewer_MouseMove;
+                //            return;
+                //        }
+
+                //    }
+
+                //}
+            }
+
+            CloseAnnotToolTip();
+        }
+
+        private Rect oldRect = new Rect(0, 0, 0, 0);
+
+        private void CloseAnnotToolTip()
+        {
+            if (PDFViewer.ToolTip != null && PDFViewer.ToolTip is ToolTip)
+            {
+                ToolTip oldTips = (ToolTip)PDFViewer.ToolTip;
+                oldTips.IsOpen = false;
+                oldTips.Visibility = Visibility.Collapsed;
+                PDFViewer.ToolTip = null;
+                PDFViewer.MouseMove -= PDFViewer_MouseMove;
+                oldRect = new Rect(0, 0, 0, 0);
+            }
+        }
+
+        private void PDFViewer_MouseMove(object sender, MouseEventArgs e)
+        {
+            if (sender != null && PDFViewer.ToolTip != null && PDFViewer.Parent != null)
+            {
+                var newPoint = e.GetPosition(PDFViewer.Parent as ContentControl);
+                var isOutw = newPoint.X > (oldRect.X + oldRect.Width + 4);
+                var isOuth = newPoint.Y > (oldRect.Y + oldRect.Height + 4);
+                if (newPoint.X < oldRect.X || newPoint.Y < oldRect.Y || isOutw || isOuth)
+                {
+                    CloseAnnotToolTip();
+                }
             }
         }
 
@@ -723,6 +896,7 @@ namespace PDF_Office.ViewModels.Tools
         {
         }
 
+        //同一属性面板,不同的注释类型
         private void AnnotPropertyPanel_AnnotTypeChanged(object sender, Dictionary<AnnotArgsType, object> e)
         {
             if (e != null)
@@ -809,8 +983,8 @@ namespace PDF_Office.ViewModels.Tools
                             break;
 
                         case AnnotArgsType.AnnotFreehand:
-            
-                            if(e[argsType] is FreehandAnnotArgs)
+
+                            if (e[argsType] is FreehandAnnotArgs)
                             {
                                 var annot = e[argsType] as FreehandAnnotArgs;
                                 if (annot != null)
@@ -825,8 +999,8 @@ namespace PDF_Office.ViewModels.Tools
                                         propertyPanel.AnnotEvents = AnnotEvents;
                                         propertyPanel.annot = annot;
                                         //手绘注释工具按钮的属性
-                                       // FreehandPath.Opacity = annot.Transparency;
-                                       // FreehandPath.Fill = new SolidColorBrush(annot.InkColor);
+                                        // FreehandPath.Opacity = annot.Transparency;
+                                        // FreehandPath.Fill = new SolidColorBrush(annot.InkColor);
                                     }
                                     PDFViewer.SetToolParam(annot);
                                 }
@@ -870,6 +1044,18 @@ namespace PDF_Office.ViewModels.Tools
                                 }
                             }
                             break;
+
+                        case AnnotArgsType.AnnotSquare:
+                        case AnnotArgsType.AnnotCircle:
+                        case AnnotArgsType.AnnotLine:
+                        case AnnotArgsType.AnnotFreeText:
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
+
+                            break;
                     }
                 }
             }

+ 477 - 82
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -122,7 +122,8 @@ namespace PDF_Office.ViewModels.Tools
         }
 
         //在xaml里引用
-        public Dictionary<string, string> GetToolTipDict { get { return ToolTipDict; } }
+        public Dictionary<string, string> GetToolTipDict
+        { get { return ToolTipDict; } }
 
         //用来记录选中、创建注释的标识
         private void InitToolDict()
@@ -142,7 +143,6 @@ namespace PDF_Office.ViewModels.Tools
             ToolExpandDict.Add("Link", AnnotArgsType.AnnotLink);
         }
 
-
         //注释工具按钮悬浮文案
         private void InitToolTipDict()
         {
@@ -167,18 +167,16 @@ namespace PDF_Office.ViewModels.Tools
             ToolTipDict.Add("ShowAnnot", "显示/隐藏注释");
         }
 
-
         //便签批注弹窗
         private void LoaedStickyNotePopup()
         {
             if (PDFViewer == null) return;
 
-            if(customStickyPopup == null)
+            if (customStickyPopup == null)
             {
                 customStickyPopup = new StickyNotePopup();
                 PDFViewer.SetStickyNotePop(customStickyPopup);
             }
-           
         }
 
         #endregion 初始化数据
@@ -251,15 +249,14 @@ namespace PDF_Office.ViewModels.Tools
                     break;
 
                 case "Link"://链接
+                    propertyPanel.IsAddLink = true;
                     viewContentViewModel.IsRightMenuCreateLink = isRightMenuAdd;
                     annotArgs = GetLink();
                     break;
             }
 
-            if(annotArgs != null)
-            annotArgs.Author = Settings.Default.AppProperties.Description.Author;
-
-
+            if (annotArgs != null)
+                annotArgs.Author = Settings.Default.AppProperties.Description.Author;
         }
 
         /// <summary>
@@ -275,11 +272,20 @@ namespace PDF_Office.ViewModels.Tools
                 highlightArgs.Transparency = highLightOpacity;
                 highlightArgs.Color = (highLightColor as SolidColorBrush).Color;
 
-                if (highlightArgs != null)
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(highlightArgs.EventType);
+                if (defaultAnnot == null)
                 {
-                    selectedArgs = new List<AnnotHandlerEventArgs>();
-                    selectedArgs.Add(highlightArgs);
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = highlightArgs.EventType;
+                    defaultAnnot.ForgoundColor = (highLightColor as SolidColorBrush).Color;
+                    defaultAnnot.Opacity = 1;
+                    Settings.Default.Save();
                 }
+
+                highLightOpacity = highlightArgs.Transparency = defaultAnnot.Opacity;
+
+                selectedArgs = new List<AnnotHandlerEventArgs>();
+                selectedArgs.Add(highlightArgs);
             }
             else
             {
@@ -313,7 +319,6 @@ namespace PDF_Office.ViewModels.Tools
                     selectedArgs.Add(linkArgs);
                 }
             }
-
             AddToPropertyPanel("LinkAnnotProperty", "Link", selectedArgs, annotAttribEvent);
             return linkArgs;
         }
@@ -332,11 +337,20 @@ namespace PDF_Office.ViewModels.Tools
                 underlineArgs.Transparency = UnderLineOpacity;
                 underlineArgs.Color = (UnderLineColor as SolidColorBrush).Color;
 
-                if (underlineArgs != null)
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(underlineArgs.EventType);
+                if (defaultAnnot == null)
                 {
-                    selectedArgs = new List<AnnotHandlerEventArgs>();
-                    selectedArgs.Add(underlineArgs);
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = underlineArgs.EventType;
+                    defaultAnnot.ForgoundColor = (UnderLineColor as SolidColorBrush).Color;
+                    defaultAnnot.Opacity = 1;
+                    Settings.Default.Save();
                 }
+
+                UnderLineOpacity = underlineArgs.Transparency = defaultAnnot.Opacity;
+
+                selectedArgs = new List<AnnotHandlerEventArgs>();
+                selectedArgs.Add(underlineArgs);
             }
             else
             {
@@ -362,11 +376,20 @@ namespace PDF_Office.ViewModels.Tools
                 squigglyArgs.Transparency = SquigglyOpacity;
                 squigglyArgs.Color = (squigglyColor as SolidColorBrush).Color;
 
-                if (squigglyArgs != null)
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(squigglyArgs.EventType);
+                if (defaultAnnot == null)
                 {
-                    selectedArgs = new List<AnnotHandlerEventArgs>();
-                    selectedArgs.Add(squigglyArgs);
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = squigglyArgs.EventType;
+                    defaultAnnot.ForgoundColor = (squigglyColor as SolidColorBrush).Color;
+                    defaultAnnot.Opacity = 1;
+                    Settings.Default.Save();
                 }
+
+                SquigglyOpacity = squigglyArgs.Transparency = defaultAnnot.Opacity;
+
+                selectedArgs = new List<AnnotHandlerEventArgs>();
+                selectedArgs.Add(squigglyArgs);
             }
             else
             {
@@ -392,11 +415,20 @@ namespace PDF_Office.ViewModels.Tools
                 strikeoutArgs.Transparency = strikeoutOpacity;
                 strikeoutArgs.Color = (strikeoutColor as SolidColorBrush).Color;
 
-                if (strikeoutArgs != null)
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(strikeoutArgs.EventType);
+                if (defaultAnnot == null)
                 {
-                    selectedArgs = new List<AnnotHandlerEventArgs>();
-                    selectedArgs.Add(strikeoutArgs);
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = strikeoutArgs.EventType;
+                    defaultAnnot.ForgoundColor = (strikeoutColor as SolidColorBrush).Color;
+                    defaultAnnot.Opacity = 1;
+                    Settings.Default.Save();
                 }
+
+                strikeoutArgs.Transparency = defaultAnnot.Opacity;
+
+                selectedArgs = new List<AnnotHandlerEventArgs>();
+                selectedArgs.Add(strikeoutArgs);
             }
             else
             {
@@ -429,14 +461,39 @@ namespace PDF_Office.ViewModels.Tools
                     freehandArgs.InkColor = Color.FromRgb(0x38, 0xE0, 0x2E);
                 }
 
-                freehandArgs.Transparency = 1;
-                freehandArgs.LineWidth = 2;
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(freehandArgs.EventType);
+                if (defaultAnnot == null)
+                {
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = freehandArgs.EventType;
+                    defaultAnnot.ForgoundColor = annotate.FreeHandColor;
+                    defaultAnnot.Opacity = 1;
+                    Settings.Default.Save();
+                }
+
+                freehandArgs.Transparency = defaultAnnot.Opacity;
+                freehandArgs.LineWidth = defaultAnnot.Thickness;
 
-                if (freehandArgs != null)
+                if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
                 {
-                    selectedArgs = new List<AnnotHandlerEventArgs>();
-                    selectedArgs.Add(freehandArgs);
+                    freehandArgs.LineDash = DashStyles.Solid;
                 }
+                else
+                {
+                    var collect = new DoubleCollection();
+                    foreach (var item in defaultAnnot.DashArray)
+                    {
+                        collect.Add(item);
+                    }
+
+                    if (freehandArgs.LineDash == null)
+                        freehandArgs.LineDash = new DashStyle();
+
+                    freehandArgs.LineDash.Dashes = collect;
+                }
+
+                selectedArgs = new List<AnnotHandlerEventArgs>();
+                selectedArgs.Add(freehandArgs);
             }
             else
             {
@@ -471,15 +528,33 @@ namespace PDF_Office.ViewModels.Tools
                     freetextArgs.FontColor = Colors.Black;
                 }
 
-                freetextArgs.Align = TextAlignment.Left;
-                freetextArgs.BgColor = Colors.Transparent;
-                freetextArgs.FontFamily = new FontFamily(Settings.Default.AppProperties.Annotate.TextFontFamaily);
-                freetextArgs.FontColor = Colors.Black;
-                freetextArgs.FontSize = 14;
-                freetextArgs.Transparency = 1;
-                freetextArgs.LineColor = Colors.Black;
-                freetextArgs.LineWidth = 0;
-                freetextArgs.TextContent = string.Empty;
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(freetextArgs.EventType);
+                if (defaultAnnot == null)
+                {
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = freetextArgs.EventType;
+                    defaultAnnot.ForgoundColor = freetextArgs.FontColor;
+                    defaultAnnot.BorderColor = Colors.Transparent;
+                    defaultAnnot.BackgroundColor = Colors.Transparent;
+                    defaultAnnot.Opacity = 1;
+                    defaultAnnot.FontFamily = Settings.Default.AppProperties.Annotate.TextFontFamaily;
+                    defaultAnnot.FontSize = 14;
+                    defaultAnnot.TextAlign = TextAlignment.Left;
+                    defaultAnnot.Thickness = 0;
+                    defaultAnnot.NoteText = string.Empty;
+
+                    Settings.Default.Save();
+                }
+
+                freetextArgs.FontColor = defaultAnnot.ForgoundColor;
+                freetextArgs.LineColor = defaultAnnot.BorderColor;
+                freetextArgs.BgColor = defaultAnnot.BackgroundColor;
+                freetextArgs.Transparency = defaultAnnot.Opacity;
+                freetextArgs.FontFamily = new FontFamily(defaultAnnot.FontFamily);
+                freetextArgs.FontSize = defaultAnnot.FontSize;
+                freetextArgs.FontWeight = defaultAnnot.FontWeight;
+                freetextArgs.FontStyle = defaultAnnot.FontStyle;
+                freetextArgs.LineWidth = defaultAnnot.Thickness;
 
                 int align = (int)Settings.Default.AppProperties.Annotate.TextAlign;
 
@@ -490,6 +565,8 @@ namespace PDF_Office.ViewModels.Tools
                 else
                     textAlignment = TextAlignment.Right;
 
+                freetextArgs.Align = textAlignment;
+
                 if (freetextArgs != null)
                 {
                     selectedArgs = new List<AnnotHandlerEventArgs>();
@@ -526,8 +603,18 @@ namespace PDF_Office.ViewModels.Tools
                 {
                     stickyAnnotArgs.Color = Color.FromRgb(0xFF, 0x81, 0x33);
                 }
-                stickyAnnotArgs.StickyNote = string.Empty;
-                stickyAnnotArgs.Transparency = 1;
+
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(stickyAnnotArgs.EventType);
+                if (defaultAnnot == null)
+                {
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = stickyAnnotArgs.EventType;
+                    defaultAnnot.NoteText = string.Empty;
+                    defaultAnnot.Opacity = 1;
+                    Settings.Default.Save();
+                }
+
+                stickyAnnotArgs.Transparency = defaultAnnot.Opacity;
 
                 if (stickyAnnotArgs != null)
                 {
@@ -572,10 +659,36 @@ namespace PDF_Office.ViewModels.Tools
                     squareArgs.BgColor = Colors.Red;
                 }
 
-                squareArgs.LineWidth = 1;
-                squareArgs.Transparency = 1;
-                squareArgs.LineDash = DashStyles.Solid;
-                squareArgs.Content = string.Empty;
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(squareArgs.EventType);
+                if (defaultAnnot == null)
+                {
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = squareArgs.EventType;
+                    defaultAnnot.Thickness = 1;
+                    defaultAnnot.Opacity = 1;
+                    Settings.Default.Save();
+                }
+
+                squareArgs.LineWidth = defaultAnnot.Thickness;
+                squareArgs.Transparency = defaultAnnot.Opacity;
+
+                if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
+                {
+                    squareArgs.LineDash = DashStyles.Solid;
+                }
+                else
+                {
+                    var collect = new DoubleCollection();
+                    foreach (var item in defaultAnnot.DashArray)
+                    {
+                        collect.Add(item);
+                    }
+
+                    if (squareArgs.LineDash == null)
+                        squareArgs.LineDash = new DashStyle();
+
+                    squareArgs.LineDash.Dashes = collect;
+                }
 
                 if (squareArgs != null)
                 {
@@ -616,10 +729,38 @@ namespace PDF_Office.ViewModels.Tools
                     circleAnnotArgs.BgColor = Colors.Red;
                 }
 
-                circleAnnotArgs.LineWidth = 1;
-                circleAnnotArgs.Transparency = 1;
-                circleAnnotArgs.LineDash = DashStyles.Solid;
-                circleAnnotArgs.Content = string.Empty;
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(circleAnnotArgs.EventType);
+                if (defaultAnnot == null)
+                {
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = circleAnnotArgs.EventType;
+                    defaultAnnot.Thickness = 1;
+                    defaultAnnot.Opacity = 1;
+                    defaultAnnot.NoteText = string.Empty;
+                    defaultAnnot.DashArray = null;
+                    Settings.Default.Save();
+                }
+
+                circleAnnotArgs.LineWidth = defaultAnnot.Thickness;
+                circleAnnotArgs.Transparency = defaultAnnot.Opacity;
+
+                if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
+                {
+                    circleAnnotArgs.LineDash = DashStyles.Solid;
+                }
+                else
+                {
+                    var collect = new DoubleCollection();
+                    foreach (var item in defaultAnnot.DashArray)
+                    {
+                        collect.Add(item);
+                    }
+
+                    if (circleAnnotArgs.LineDash == null)
+                        circleAnnotArgs.LineDash = new DashStyle();
+
+                    circleAnnotArgs.LineDash.Dashes = collect;
+                }
 
                 if (circleAnnotArgs != null)
                 {
@@ -667,10 +808,40 @@ namespace PDF_Office.ViewModels.Tools
                 {
                     lineArgs.TailLineType = C_LINE_TYPE.LINETYPE_ARROW;
                 }
+
+                var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(lineArgs.EventType);
+                if (defaultAnnot == null)
+                {
+                    defaultAnnot = new DefaultAnnotProperty();
+                    defaultAnnot.AnnotToolType = lineArgs.EventType;
+                    defaultAnnot.Thickness = 1;
+                    defaultAnnot.Opacity = 1;
+                    defaultAnnot.NoteText = string.Empty;
+                    defaultAnnot.DashArray = null;
+                    Settings.Default.Save();
+                }
+
                 lineArgs.LineDash = DashStyles.Solid;
-                lineArgs.LineWidth = 1;
-                lineArgs.Transparency = 1;
-                lineArgs.Content = string.Empty;
+                lineArgs.LineWidth = defaultAnnot.Thickness;
+                lineArgs.Transparency = defaultAnnot.Opacity;
+
+                if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
+                {
+                    lineArgs.LineDash = DashStyles.Solid;
+                }
+                else
+                {
+                    var collect = new DoubleCollection();
+                    foreach (var item in defaultAnnot.DashArray)
+                    {
+                        collect.Add(item);
+                    }
+
+                    if (lineArgs.LineDash == null)
+                        lineArgs.LineDash = new DashStyle();
+
+                    lineArgs.LineDash.Dashes = collect;
+                }
 
                 if (lineArgs != null)
                 {
@@ -832,6 +1003,7 @@ namespace PDF_Office.ViewModels.Tools
                     case "StickyNote"://便签
                         StickyAnnotArgs stickyAnnotArgs = (StickyAnnotArgs)GetStickyNote();
                         stickyAnnotArgs.ClientRect = annotCommand.TextRect;
+                        stickyAnnotArgs.StickyNote = annotCommand.Text;
                         PDFViewer.CreatePageAnnot(annotCommand.PageIndex, stickyAnnotArgs);
                         break;
 
@@ -865,6 +1037,8 @@ namespace PDF_Office.ViewModels.Tools
                         BtnLinkIsChecked = true;
                         List<AnnotHandlerEventArgs> lists = new List<AnnotHandlerEventArgs>();
                         lists.Add(linkArgs);
+                        propertyPanel.IsAddLink = true;
+
                         AnnotHandlerEventArgs annotArgs = GetLink(lists);
                         PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                         PDFViewer.SetToolParam(annotArgs);
@@ -889,19 +1063,23 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 str = annotCommand.Text;
                             }
-                            OutlineNode outline = outLineControl.AddOutlineNode(str);
-                            CPDFOutline result = outline.Outline;
-                            if (result != null)
-                            {
-                                outLineControlViewModel.SetTitle(result, str);
-                                outLineControlViewModel.Updata(false);
-
-                                //outLineControl.IsReName = true;
-                                //if (outLineControl.OutlineView.SelectedItem is OutlineNode selectOutLine)
-                                //{
-                                //    outLineControl.ReNameOutlineNode = outline;
-                                //}
-                            }
+                            //App.Current.Dispatcher.BeginInvoke((System.Action)(() =>
+                            //{
+                            //    OutlineNode outline = outLineControl.AddOutlineNode(str);
+                            //}));
+                            App.Current.Dispatcher.Invoke(() => outLineControl.AddOutlineNode(str));
+                            //CPDFOutline result = outline.Outline;
+                            //if (result != null)
+                            //{
+                            //    outLineControlViewModel.SetTitle(result, str);
+                            //    outLineControlViewModel.Updata(false);
+
+                            //    //outLineControl.IsReName = true;
+                            //    //if (outLineControl.OutlineView.SelectedItem is OutlineNode selectOutLine)
+                            //    //{
+                            //    //    outLineControl.ReNameOutlineNode = outline;
+                            //    //}
+                            //}
                         }
 
                         break;
@@ -1016,25 +1194,66 @@ namespace PDF_Office.ViewModels.Tools
                     if (annot is TextHighlightAnnotArgs)
                     {
                         var color = (annot as TextHighlightAnnotArgs).Color;
-                        Settings.Default.AppProperties.Annotate.HighLightColor = color;
                         HighLightColor = new SolidColorBrush(color);
+
+                        Settings.Default.AppProperties.Annotate.HighLightColor = color;
+
+                        var hightlight = GetAnnotDefault(AnnotArgsType.AnnotHighlight);
+                        hightlight.ForgoundColor = color;
+                        hightlight.Opacity = (annot as TextHighlightAnnotArgs).Transparency;
+                        SettingHelper.SetAnnotDefaultProperty(hightlight);
                     }
                     else if (annot is TextUnderlineAnnotArgs)
                     {
-                        var color = (annot as TextHighlightAnnotArgs).Color;
-                        Settings.Default.AppProperties.Annotate.UnderLineColor = color;
+                        var color = (annot as TextUnderlineAnnotArgs).Color;
                         UnderLineColor = new SolidColorBrush(color);
+
+                        Settings.Default.AppProperties.Annotate.UnderLineColor = color;
+
+                        var Underline = GetAnnotDefault(AnnotArgsType.AnnotUnderline);
+                        Underline.ForgoundColor = color;
+                        Underline.Opacity = (annot as TextUnderlineAnnotArgs).Transparency;
+                        SettingHelper.SetAnnotDefaultProperty(Underline);
                     }
                     else if (annot is TextStrikeoutAnnotArgs)
                     {
-                        var color = (annot as TextHighlightAnnotArgs).Color;
-                        Settings.Default.AppProperties.Annotate.StrikethroughColor = color;
+                        var color = (annot as TextStrikeoutAnnotArgs).Color;
                         StrikeoutColor = new SolidColorBrush(color);
+
+                        Settings.Default.AppProperties.Annotate.StrikethroughColor = color;
+
+                        var Strikeout = GetAnnotDefault(AnnotArgsType.AnnotStrikeout);
+                        Strikeout.ForgoundColor = color;
+                        Strikeout.Opacity = (annot as TextStrikeoutAnnotArgs).Transparency;
+                        SettingHelper.SetAnnotDefaultProperty(Strikeout);
                     }
                     else if (annot is FreehandAnnotArgs)
                     {
-                        var color = (annot as FreehandAnnotArgs).InkColor;
+                        var freeHand = annot as FreehandAnnotArgs;
+                        var color = freeHand.InkColor;
+
                         Settings.Default.AppProperties.Annotate.FreeHandColor = color;
+
+                        var FreehandDefault = GetAnnotDefault(AnnotArgsType.AnnotFreehand);
+                        FreehandDefault.ForgoundColor = color;
+                        FreehandDefault.Opacity = freeHand.Transparency;
+                        FreehandDefault.Thickness = freeHand.LineWidth;
+
+                        var isSolid = AnnotPropertyPanel.IsSolidStyle(freeHand.LineDash);
+                        if (isSolid)
+                        {
+                            FreehandDefault.DashArray = null;
+                        }
+                        else
+                        {
+                            FreehandDefault.DashArray = new List<double>();
+                            foreach (var item in freeHand.LineDash.Dashes)
+                            {
+                                FreehandDefault.DashArray.Add(item);
+                            }
+                        }
+
+                        SettingHelper.SetAnnotDefaultProperty(FreehandDefault);
                     }
                     else if (annot is FreeTextAnnotArgs)
                     {
@@ -1042,30 +1261,113 @@ namespace PDF_Office.ViewModels.Tools
                         Settings.Default.AppProperties.Annotate.TextAnnoteColor = freeText.FontColor;
                         Settings.Default.AppProperties.Annotate.TextFontFamaily = freeText.FontFamily.ToString();
                         Settings.Default.AppProperties.Annotate.TextAlign = freeText.Align;
+
+                        var FreeTextDefalut = GetAnnotDefault(AnnotArgsType.AnnotFreeText);
+                        FreeTextDefalut.ForgoundColor = freeText.FontColor;
+                        FreeTextDefalut.FontFamily = freeText.FontFamily.ToString();
+                        FreeTextDefalut.TextAlign = freeText.Align;
+                        FreeTextDefalut.FontSize = freeText.FontSize;
+                        FreeTextDefalut.FontWeight = freeText.FontWeight;
+                        FreeTextDefalut.FontStyle = freeText.FontStyle;
+                        FreeTextDefalut.BackgroundColor = freeText.BgColor;
+                        FreeTextDefalut.Opacity = (annot as FreeTextAnnotArgs).Transparency;
+                        SettingHelper.SetAnnotDefaultProperty(FreeTextDefalut);
                     }
                     else if (annot is StickyAnnotArgs)
                     {
                         var color = (annot as StickyAnnotArgs).Color;
                         Settings.Default.AppProperties.Annotate.NoteAnnoteColor = color;
+                        var StickyDefalut = GetAnnotDefault(AnnotArgsType.AnnotSticky);
+                        StickyDefalut.ForgoundColor = color;
+
+                        SettingHelper.SetAnnotDefaultProperty(StickyDefalut);
                     }
                     else if (annot is SquareAnnotArgs)
                     {
-                        var bgColor = (annot as SquareAnnotArgs).BgColor;
+                        var square = annot as SquareAnnotArgs;
+                        var bgColor = square.BgColor;
                         Settings.Default.AppProperties.Annotate.RectangleFillColor = bgColor;
-                        var borderColor = (annot as SquareAnnotArgs).LineColor;
+                        var borderColor = square.LineColor;
                         Settings.Default.AppProperties.Annotate.RectangleBorderColor = borderColor;
+
+                        var SquareDefalut = GetAnnotDefault(AnnotArgsType.AnnotSquare);
+                        SquareDefalut.BorderColor = borderColor;
+                        SquareDefalut.BackgroundColor = bgColor;
+                        SquareDefalut.Opacity = square.Transparency;
+                        SquareDefalut.Thickness = square.LineWidth;
+
+                        var isSolid = AnnotPropertyPanel.IsSolidStyle(square.LineDash);
+                        if (isSolid)
+                        {
+                            SquareDefalut.DashArray = null;
+                        }
+                        else
+                        {
+                            SquareDefalut.DashArray = new List<double>();
+                            foreach (var item in square.LineDash.Dashes)
+                            {
+                                SquareDefalut.DashArray.Add(item);
+                            }
+                        }
+
+                        SettingHelper.SetAnnotDefaultProperty(SquareDefalut);
                     }
                     else if (annot is CircleAnnotArgs)
                     {
-                        var bgColor = (annot as CircleAnnotArgs).BgColor;
+                        var circle = annot as CircleAnnotArgs;
+                        var bgColor = circle.BgColor;
                         Settings.Default.AppProperties.Annotate.CircleFillColor = bgColor;
-                        var borderColor = (annot as CircleAnnotArgs).LineColor;
+                        var borderColor = circle.LineColor;
                         Settings.Default.AppProperties.Annotate.CircleBorderColor = borderColor;
+
+                        var CircleDefalut = GetAnnotDefault(AnnotArgsType.AnnotCircle);
+                        CircleDefalut.BorderColor = borderColor;
+                        CircleDefalut.BackgroundColor = bgColor;
+                        CircleDefalut.Opacity = circle.Transparency;
+                        CircleDefalut.Thickness = circle.LineWidth;
+
+                        var isSolid = AnnotPropertyPanel.IsSolidStyle(circle.LineDash);
+                        if (isSolid)
+                        {
+                            CircleDefalut.DashArray = null;
+                        }
+                        else
+                        {
+                            CircleDefalut.DashArray = new List<double>();
+                            foreach (var item in circle.LineDash.Dashes)
+                            {
+                                CircleDefalut.DashArray.Add(item);
+                            }
+                        }
+
+                        SettingHelper.SetAnnotDefaultProperty(CircleDefalut);
                     }
                     else if (annot is LineAnnotArgs)
                     {
+                        var line = (annot as LineAnnotArgs);
                         var color = (annot as LineAnnotArgs).LineColor;
                         Settings.Default.AppProperties.Annotate.LineColor = color;
+
+                        var lineDefalut = GetAnnotDefault(AnnotArgsType.AnnotLine);
+                        lineDefalut.BorderColor = color;
+                        lineDefalut.Opacity = (annot as LineAnnotArgs).Transparency;
+                        lineDefalut.Thickness = (annot as LineAnnotArgs).LineWidth;
+
+                        var isSolid = AnnotPropertyPanel.IsSolidStyle(line.LineDash);
+                        if (isSolid)
+                        {
+                            lineDefalut.DashArray = null;
+                        }
+                        else
+                        {
+                            lineDefalut.DashArray = new List<double>();
+                            foreach (var item in line.LineDash.Dashes)
+                            {
+                                lineDefalut.DashArray.Add(item);
+                            }
+                        }
+
+                        SettingHelper.SetAnnotDefaultProperty(lineDefalut);
                     }
 
                     Settings.Default.Save();
@@ -1073,8 +1375,21 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        private DefaultAnnotProperty GetAnnotDefault(AnnotArgsType annotArgsType)
+        {
+            var Annot = SettingHelper.GetAnnotDefaultProperty(annotArgsType);
+            if (Annot == null)
+            {
+                Annot = new DefaultAnnotProperty();
+                Annot.AnnotToolType = annotArgsType;
+            }
+            return Annot;
+        }
+
+        private System.Windows.Controls.Primitives.Popup popup = null;
+
         //更改颜色
-        private void AnnotColorPalette_Menu(object obj)
+        private async void AnnotColorPalette_Menu(object obj)
         {
             if (obj as CusMenuItem != null)
             {
@@ -1083,15 +1398,49 @@ namespace PDF_Office.ViewModels.Tools
                 if (annot != null)
                 {
                     var item = new ColorDropBoxPop();
-                    item.DataContext = annot;
+                    item.DataContext = menu;
                     item.ColorSelected -= AnnotMenu_ColorSelected;
                     item.ColorSelected += AnnotMenu_ColorSelected;
-                    
-                    System.Windows.Controls.Primitives.Popup popup = new System.Windows.Controls.Primitives.Popup();
+
+                    if (popup == null)
+                        popup = new System.Windows.Controls.Primitives.Popup();
+
+                    ContentControl window = null;
+                    if (PDFViewer.Parent as ContentControl != null)
+                        window = PDFViewer.Parent as ContentControl;
+                    else
+                        window = App.Current.MainWindow;
+
                     popup.Child = item;
-                    popup.PlacementRectangle = new Rect(Mouse.GetPosition(App.Current.MainWindow), new Size(item.Width, item.Height));
-                    popup.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
+                    popup.PlacementRectangle = new Rect(Mouse.GetPosition(window), new Size(item.Width, item.Height));
+                    popup.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
+                    popup.PlacementTarget = window;
                     popup.IsOpen = true;
+
+                    Window parentWnd = Window.GetWindow(App.Current.MainWindow);
+                    if (parentWnd != null)
+                    {
+                        parentWnd.MouseDown -= parentWnd_MouseDown;
+                        parentWnd.MouseDown += parentWnd_MouseDown;
+                    }
+
+                    while (popup.IsOpen)
+                        await Task.Delay(20);
+
+                    parentWnd.MouseDown -= parentWnd_MouseDown;
+                    popup = null;
+                }
+            }
+        }
+
+        private void parentWnd_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            var ui = Mouse.DirectlyOver as FrameworkElement;
+            if (ui != null)
+            {
+                if (popup != null)
+                {
+                    popup.IsOpen = false;
                 }
             }
         }
@@ -1100,7 +1449,10 @@ namespace PDF_Office.ViewModels.Tools
         {
             if (sender != null)
             {
-                var annot = (sender as FrameworkElement).DataContext as AnnotHandlerEventArgs;
+                var menu = (sender as FrameworkElement).DataContext as CusMenuItem;
+                if (menu == null) return;
+
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
                 if (annot != null)
                 {
                     if (annot is FreehandAnnotArgs || annot is StickyAnnotArgs || annot is LineAnnotArgs)
@@ -1112,13 +1464,27 @@ namespace PDF_Office.ViewModels.Tools
                     else if (annot is FreeTextAnnotArgs)
                     {
                         var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.FontColor, e);
+                        if (menu.tag.ToString() == "FontColor")
+                            AnnotEvent?.UpdateAttrib(AnnotAttrib.FontColor, e);
+                        else
+                            AnnotEvent?.UpdateAttrib(AnnotAttrib.FillColor, e);
+
                         AnnotEvent?.UpdateAnnot();
                     }
                     else if (annot is SquareAnnotArgs || annot is CircleAnnotArgs)
                     {
                         var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.FillColor, e);
+                        if (menu.tag.ToString() == "FillColor")
+                            AnnotEvent?.UpdateAttrib(AnnotAttrib.FillColor, e);
+                        else
+                            AnnotEvent?.UpdateAttrib(AnnotAttrib.Color, e);
+
+                        AnnotEvent?.UpdateAnnot();
+                    }
+                    else if (annot is TextHighlightAnnotArgs || annot is TextUnderlineAnnotArgs || annot is TextStrikeoutAnnotArgs)
+                    {
+                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.Color, e);
                         AnnotEvent?.UpdateAnnot();
                     }
                 }
@@ -1232,6 +1598,11 @@ namespace PDF_Office.ViewModels.Tools
                     {
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Right);
                     }
+                    else if (strTag == "Justify")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Justify);
+                    }
+
                     AnnotEvent?.UpdateAnnot();
                 }
             }
@@ -1302,7 +1673,7 @@ namespace PDF_Office.ViewModels.Tools
                 {
                     var strTag = tag.ToString();
                     var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
-                    if (strTag == "ver")
+                    if (strTag == "Ver")
                     {
                         annot.SetLineVertical();
                     }
@@ -1314,6 +1685,30 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        private void Link_Menu(object obj)
+        {
+            if (obj is CusMenuItem menuItem)
+            {
+                if (menuItem.Parameter is LinkAnnotArgs linkAnnotArgs)
+                {
+                    var result = PDFViewer.RemovePageAnnot(linkAnnotArgs.PageIndex, linkAnnotArgs.AnnotIndex);
+                    if (result)
+                    {
+                        viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                        bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
+                        if (isTabItemAnnotation)
+                        {
+                            AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
+                            if (viewModel != null)
+                            {
+                                viewModel.UpdateModifiedAnnot(linkAnnotArgs.PageIndex, linkAnnotArgs.AnnotIndex, true);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
         //图章
         private void StampExportPicture_Menu(object obj)
         {

+ 182 - 54
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs

@@ -1,12 +1,16 @@
 using ComPDFKit.PDFDocument;
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Helper;
+using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -14,6 +18,9 @@ using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Media;
+using System.Windows.Shapes;
+using static Dropbox.Api.TeamLog.AdminAlertSeverityEnum;
+using MenuItem = System.Windows.Controls.MenuItem;
 
 namespace PDF_Office.ViewModels.Tools
 {
@@ -65,7 +72,6 @@ namespace PDF_Office.ViewModels.Tools
                 }
             }
 
-
             propertyPanel.SetIsTextFill(false);
 
             if (string.IsNullOrEmpty(viewContent) == false)
@@ -150,7 +156,7 @@ namespace PDF_Office.ViewModels.Tools
                                 menuItem1.Click -= HiddenAnnot_Click;
 
                                 menuItem1.Click += HiddenAnnot_Click;
-                                SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", isHiddenAnnot);
+                                SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", BtnShowAnnotIsChecked);
 
                                 break;
 
@@ -158,7 +164,7 @@ namespace PDF_Office.ViewModels.Tools
 
                                 menuItem1.Click -= DisplayAnnot_Click;
                                 menuItem1.Click += DisplayAnnot_Click;
-                                SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", isHiddenAnnot);
+                                SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", BtnShowAnnotIsChecked);
                                 break;
 
                             case "AddBookMark":
@@ -216,12 +222,48 @@ namespace PDF_Office.ViewModels.Tools
                             case "Print":
                                 menuItem1.Command = viewContentViewModel.PrintCommand;
                                 break;
+
+                            case "HighlightLinks":
+                                if (OpenFileInfo != null)
+                                {
+                                    menuItem1.IsChecked = OpenFileInfo.ShowHighLightLink;
+                                }
+                                menuItem1.Click -= HighlightLinks_Click;
+                                menuItem1.Click += HighlightLinks_Click;
+                                break;
                         }
                     }
                 }
             }
         }
 
+        private void HighlightLinks_Click(object sender, RoutedEventArgs e)
+        {
+            if (sender is MenuItem menuItem)
+            {
+                //if (OpenFileInfo != null)
+                //{
+                //    menuItem.IsChecked = OpenFileInfo.ShowHighLightLink;
+                //}
+                if (menuItem.IsChecked)
+                {
+                    PDFViewer.SetShowLink(true);
+                }
+                else
+                {
+                    PDFViewer.SetShowLink(false);
+                }
+                if (OpenFileInfo != null)
+                {
+                    OpenFileInfo.ShowHighLightLink = menuItem.IsChecked;
+                }
+                //if (menuItem.IsChecked == true)
+                //{
+                //    menuItem.IsChecked = false;
+                //}
+            }
+        }
+
         private void SetMenuItemVisibility(MenuItem menuItem1, string right, string deny, bool flag)
         {
             if (menuItem1.Tag.ToString() == right && flag)
@@ -242,7 +284,13 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        private ContextMenu NoneSelectAnnotContextMenu(object sender, AnnotCommandArgs annotCommand)
+        /// <summary>
+        /// 选择文本或者图像的右键菜单
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="annotCommand"></param>
+        /// <returns></returns>
+        private ContextMenu SelectedTextOrImageContextMenu(object sender, AnnotCommandArgs annotCommand)
         {
             ContextMenu popMenu = new ContextMenu();
             popMenu.FontSize = 14;
@@ -340,6 +388,8 @@ namespace PDF_Office.ViewModels.Tools
 
         #region 注释-右键菜单
 
+        private ColorMenuItem colorContent;
+
         /// <summary>
         /// 高亮注释,右键菜单
         /// </summary>
@@ -347,21 +397,23 @@ namespace PDF_Office.ViewModels.Tools
         {
             var popMenu = new ContextMenu();
             PopMenu pop = new PopMenu(popMenu);
-            ColorContent colorContent = new ColorContent();
+            colorContent = new ColorMenuItem();
             colorContent.Name = "hightcolor";
-            colorContent.SelectedColorHandler -= colorContent_SelectedColorHandler;
-            colorContent.SelectedColorHandler += colorContent_SelectedColorHandler;
+            colorContent.ColorChanged -= colorContent_SelectedColorHandler;
+            colorContent.ColorChanged += colorContent_SelectedColorHandler;
             colorContent.VerticalAlignment = VerticalAlignment.Top;
-            colorContent.Height = 60;
+            colorContent.Margin = new Thickness(0, 0, 0, -15);
+
             var menuItem = new MenuItem();
             menuItem.Name = "hightColor";
-            menuItem.Height = colorContent.Height;
+            menuItem.Height = 20 + 15;
             menuItem.Header = colorContent;
+
             var hightColorStyle = App.Current.FindResource("UIElementMenuItem") as Style;
             if (hightColorStyle != null)
                 menuItem.Style = hightColorStyle;
 
-            pop.AddItem(menuItem);
+            colorContent.DataContext = pop.AddItem(menuItem);
 
             pop.AddItem(GetSeparator());
 
@@ -398,20 +450,59 @@ namespace PDF_Office.ViewModels.Tools
             return separator;
         }
 
-        private void colorContent_SelectedColorHandler(object sender, Color e)
+        private async void colorContent_SelectedColorHandler(object sender, Color e)
         {
             if (e == null) return;
 
-            var annot = (sender as FrameworkElement).DataContext as AnnotHandlerEventArgs;
-            if (annot != null)
+            if (sender is Ellipse)
             {
-                var test = annot as TextHighlightAnnotArgs;
-                if (test != null)
+                var item = new ColorDropBoxPop();
+                item.DataContext = (sender as Ellipse).DataContext;
+                item.ColorSelected -= AnnotMenu_ColorSelected;
+                item.ColorSelected += AnnotMenu_ColorSelected;
+
+                if (popup == null)
+                    popup = new System.Windows.Controls.Primitives.Popup();
+
+                ContentControl window = null;
+                if (PDFViewer.Parent as ContentControl != null)
+                    window = PDFViewer.Parent as ContentControl;
+                else
+                    window = App.Current.MainWindow;
+
+                popup.Child = item;
+                popup.PlacementRectangle = new Rect(Mouse.GetPosition(window), new Size(item.Width, item.Height));
+                popup.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
+                popup.PlacementTarget = window;
+                popup.IsOpen = true;
+
+                Window parentWnd = Window.GetWindow(App.Current.MainWindow);
+                if (parentWnd != null)
                 {
-                    var anvent = AnnotAttribEvent.GetAnnotAttribEvent(test, test.GetAnnotAttrib());
-                    anvent.UpdateAttrib(AnnotAttrib.Color, e);
-                    anvent.UpdateAnnot();
+                    parentWnd.MouseDown -= parentWnd_MouseDown;
+                    parentWnd.MouseDown += parentWnd_MouseDown;
                 }
+
+                while (popup.IsOpen)
+                    await Task.Delay(20);
+
+                parentWnd.MouseDown -= parentWnd_MouseDown;
+                popup = null;
+            }
+            else
+            {
+                var cusMenuItem = (sender as FrameworkElement).DataContext as CusMenuItem;
+                if (cusMenuItem != null && cusMenuItem.Parameter != null)
+                {
+                    var test = cusMenuItem.Parameter as TextHighlightAnnotArgs;
+                    if (test != null)
+                    {
+                        var anvent = AnnotAttribEvent.GetAnnotAttribEvent(test, test.GetAnnotAttrib());
+                        anvent.UpdateAttrib(AnnotAttrib.Color, e);
+                        anvent.UpdateAnnot();
+                    }
+                }
+
             }
         }
 
@@ -446,7 +537,8 @@ namespace PDF_Office.ViewModels.Tools
 
             menuItem = new MenuItem();
             menuItem.Name = "FreeHandColor";
-            menuItem.Header = "颜色...";
+            menuItem.Header = "边框颜色";
+            menuItem.Tag = "Color";
             pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
 
             menuItem = new MenuItem();
@@ -455,6 +547,8 @@ namespace PDF_Office.ViewModels.Tools
             pop.AddItem(menuItem);
 
             RadioButton radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
             radioButton.Name = "FreeHandSolid";
             radioButton.Content = "实线";
             radioButton.GroupName = "LineStyle";
@@ -462,6 +556,8 @@ namespace PDF_Office.ViewModels.Tools
             pop.BindingEvent(pop.AddChild("FreeHandLineStyle", radioButton), FreeHandLineStyle_MenuCommand);
 
             radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
             radioButton.Name = "FreeHandDash";
             radioButton.Content = "虚线";
             radioButton.GroupName = "LineStyle";
@@ -511,7 +607,14 @@ namespace PDF_Office.ViewModels.Tools
 
             menuItem = new MenuItem();
             menuItem.Name = "FreeTextColor";
-            menuItem.Header = "颜色...";
+            menuItem.Header = "字体颜色";
+            menuItem.Tag = "FontColor";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextColor";
+            menuItem.Header = "填充颜色";
+            menuItem.Tag = "FillColor";
             pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
 
             menuItem = new MenuItem();
@@ -519,46 +622,60 @@ namespace PDF_Office.ViewModels.Tools
             menuItem.Header = "字体";
             pop.AddItem(menuItem);
 
-            menuItem = new MenuItem();
-            menuItem.Name = "FreeTextArial";
-            menuItem.Header = "楷体";
-            menuItem.Tag = "Arial";
-            pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
-
-            menuItem = new MenuItem();
-            menuItem.Name = "FreeTextCourier";
-            menuItem.Header = "Courier";
-            menuItem.Tag = "Courier";
-            pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
+            var family = TextFont.GetFamily();
 
-            menuItem = new MenuItem();
-            menuItem.Name = "FreeTextTimesRoman";
-            menuItem.Header = "Times New Roman";
-            menuItem.Tag = /*"Times New Roman"*/"Times";
-            pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
+            foreach (var item in family)
+            {
+                RadioButton familyRdioBtn = new RadioButton();
+                familyRdioBtn.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+                familyRdioBtn.Background = new SolidColorBrush(Colors.Transparent);
+                familyRdioBtn.Name = item.ValueStr;
+                familyRdioBtn.Tag = item.ValueStr;
+                familyRdioBtn.GroupName = "FontFamily";
+                familyRdioBtn.Content = item.Content;
+                pop.BindingEvent(pop.AddChild("FreeTextFontFamily", familyRdioBtn), FreeTextFontFamily_MenuCommand);
+            }
 
             menuItem = new MenuItem();
             menuItem.Name = "FreeTextAglin";
             menuItem.Header = "文本对齐";
             pop.AddItem(menuItem);
 
-            menuItem = new MenuItem();
-            menuItem.Name = "FreeTextAglinLeft";
-            menuItem.Header = "左对齐";
-            menuItem.Tag = "Left";
-            pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
+            var radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
+            radioButton.Name = "FreeTextAglinLeft";
+            radioButton.Tag = "Left";
+            radioButton.GroupName = "Aglin";
+            radioButton.Content = "左对齐";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", radioButton), FreeTextAglin_MenuCommand);
 
-            menuItem = new MenuItem();
-            menuItem.Name = "FreeTextAglinCenter";
-            menuItem.Header = "居中对齐";
-            menuItem.Tag = "Center";
-            pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
+            radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
+            radioButton.Name = "FreeTextAglinCenter";
+            radioButton.Tag = "Center";
+            radioButton.GroupName = "Aglin";
+            radioButton.Content = "居中对齐";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", radioButton), FreeTextAglin_MenuCommand);
 
-            menuItem = new MenuItem();
-            menuItem.Name = "FreeTextAglinRight";
-            menuItem.Header = "右对齐";
-            menuItem.Tag = "Right";
-            pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
+            radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
+            radioButton.Name = "FreeTextAglinRight";
+            radioButton.Tag = "Right";
+            radioButton.GroupName = "Aglin";
+            radioButton.Content = "右对齐";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", radioButton), FreeTextAglin_MenuCommand);
+
+            radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
+            radioButton.Name = "FreeTextAglinJustify";
+            radioButton.Tag = "Justify";
+            radioButton.GroupName = "Aglin";
+            radioButton.Content = "两端对齐";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", radioButton), FreeTextAglin_MenuCommand);
 
             menuItem = new MenuItem();
             menuItem.Name = "FreeHandDefault";
@@ -598,7 +715,7 @@ namespace PDF_Office.ViewModels.Tools
 
             menuItem = new MenuItem();
             menuItem.Name = "StrickNoteColor";
-            menuItem.Header = "颜色...";
+            menuItem.Header = "颜色";
             pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
 
             menuItem = new MenuItem();
@@ -643,7 +760,14 @@ namespace PDF_Office.ViewModels.Tools
 
             menuItem = new MenuItem();
             menuItem.Name = "ShapeColor";
-            menuItem.Header = "颜色...";
+            menuItem.Header = "边框颜色";
+            menuItem.Tag = "Color";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeFillColor";
+            menuItem.Header = "填充颜色";
+            menuItem.Tag = "FillColor";
             pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
 
             menuItem = new MenuItem();
@@ -652,6 +776,8 @@ namespace PDF_Office.ViewModels.Tools
             pop.AddItem(menuItem);
 
             RadioButton radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
             radioButton.Name = "ShapeSolid";
             radioButton.Content = "实线";
             radioButton.GroupName = "LineStyle";
@@ -659,6 +785,8 @@ namespace PDF_Office.ViewModels.Tools
             pop.BindingEvent(pop.AddChild("ShapeLineStyle", radioButton), ShapeLineStyle_MenuCommand);
 
             radioButton = new RadioButton();
+            radioButton.Style = App.Current.Resources["MenuRadioBtnStyle"] as Style;
+            radioButton.Background = new SolidColorBrush(Colors.Transparent);
             radioButton.Name = "ShapeDash";
             radioButton.Content = "虚线";
             radioButton.GroupName = "LineStyle";
@@ -719,7 +847,7 @@ namespace PDF_Office.ViewModels.Tools
             menuItem = new MenuItem();
             menuItem.Name = "LinkDelete";
             menuItem.Header = "删除";
-            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+            pop.BindingEvent(pop.AddItem(menuItem), Link_MenuCommand);
             LinkAnnotPopMenu = pop;
         }
 

+ 12 - 4
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -5,15 +5,13 @@ using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
+using PDFSettings.Settings;
 using Prism.Commands;
 using Prism.Events;
 using Prism.Regions;
 using Prism.Services.Dialogs;
 using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows.Media;
 
 namespace PDF_Office.ViewModels.Tools
@@ -23,6 +21,8 @@ namespace PDF_Office.ViewModels.Tools
     /// </summary>
     public class AnnotPropertyPanel
     {
+        public bool IsAddLink = false;
+        public bool IsLocationLink = false;
         public AnnotAttribEvent AnnotEvent { get; set; }
         public List<AnnotAttribEvent> AnnotEvents = new List<AnnotAttribEvent>();
 
@@ -240,6 +240,7 @@ namespace PDF_Office.ViewModels.Tools
                 SetProperty(ref btnHandIsChecked, value);
             }
         }
+
         private bool btnShowAnnotIsChecked = true;
 
         public bool BtnShowAnnotIsChecked
@@ -260,14 +261,17 @@ namespace PDF_Office.ViewModels.Tools
         public IDialogService dialogs;
         public IRegionManager region;
 
+        public OpenFileInfo OpenFileInfo = null;
         public CPDFViewer PDFViewer;
         private ViewContentViewModel viewContentViewModel;
         private AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         private Dictionary<string, string> ToolTipDict = new Dictionary<string, string>();
         private StickyNotePopup customStickyPopup;
-        private bool isHiddenAnnot = true;
+
+        //private bool isHiddenAnnot = true;
         private bool isAddBookMark = true;
+
         private bool isRightMenuAddAnnot = false;
 
         private PopMenu HightAnnotPopMenu;
@@ -289,6 +293,7 @@ namespace PDF_Office.ViewModels.Tools
         public DelegateCommand AddBookMarkCommand { get; set; }
 
         public DelegateCommand<object> HandCommand { get; set; }
+
         #region 注释 - 右键菜单
 
         //公共
@@ -322,6 +327,9 @@ namespace PDF_Office.ViewModels.Tools
         //ESC
         public DelegateCommand EscCommand { get; set; }
 
+        //链接
+        public DelegateCommand<object> Link_MenuCommand { get; set; }
+
         #endregion 注释 - 右键菜单
 
         #endregion 事件

+ 50 - 6
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -17,6 +17,7 @@ using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
 using PDF_Office.Views.BOTA;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDFSettings;
+using PDFSettings.Settings;
 using Prism.Commands;
 using Prism.Events;
 using Prism.Mvvm;
@@ -76,6 +77,7 @@ namespace PDF_Office.ViewModels.Tools
             HandCommand = new DelegateCommand<object>(Hand_Click);
             //ESC
             EscCommand = new DelegateCommand(Esc_KeyDown);
+
             #region 注释 - 右键菜单
 
             //公共command
@@ -96,6 +98,8 @@ namespace PDF_Office.ViewModels.Tools
             ShapeLineDirect_MenuCommand = new DelegateCommand<object>(ShapeLineDirect_Menu);
             //图章
             StampExportPicture_MenuCommand = new DelegateCommand<object>(StampExportPicture_Menu);
+            //链接
+            Link_MenuCommand = new DelegateCommand<object>(Link_Menu);
 
             #endregion 注释 - 右键菜单
         }
@@ -103,7 +107,6 @@ namespace PDF_Office.ViewModels.Tools
         private void Esc_KeyDown()
         {
             PDFViewer.SetMouseMode(MouseModes.None);
-
         }
 
         private void Hand_Click(object obj)
@@ -170,6 +173,17 @@ namespace PDF_Office.ViewModels.Tools
                     PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                     PDFViewer.SetToolParam(annotArgs);
 
+                    if (tag == "Rect" || tag == "Circle" || tag == "Arrow" || tag == "Line")
+                    {
+                        PDFViewer.ToolManager.EnableClickCreate = true;
+                        PDFViewer.ToolManager.ClickCreateWidth = 140;
+                        PDFViewer.ToolManager.ClickCreateHeight = 140;
+                    }
+                    else
+                    {
+                        PDFViewer.ToolManager.EnableClickCreate = false;
+                    }
+
                     #region 设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
 
                     //isRightMenuAddAnnot = false;
@@ -177,6 +191,12 @@ namespace PDF_Office.ViewModels.Tools
                     #endregion 设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
                 }
             }
+            else
+            {
+                propertyPanel.IsAddLink = false;
+                propertyPanel.IsLocationLink = false;
+                PDFViewer.ToolManager.EnableClickCreate = false;
+            }
 
             //当不是注释模板,且无创建注释时,属性面板显示为空内容
             if (isTemplateAnnot == false && annotArgs == null)
@@ -209,6 +229,8 @@ namespace PDF_Office.ViewModels.Tools
                 AnnotHandlerEventArgs annotHandler = null;
                 string str = menuItem.Tag.ToString();
                 viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                propertyPanel.IsAddLink = false;
+                propertyPanel.IsLocationLink = false;
                 if (str == AddAnnotType.AnnotFreehand.ToString())
                 {
                     annotHandler = GetFreehand();
@@ -239,6 +261,7 @@ namespace PDF_Office.ViewModels.Tools
                 }
                 if (str == AddAnnotType.AnnotLink.ToString())
                 {
+                    propertyPanel.IsAddLink = true;
                     annotHandler = GetLink();
                 }
                 if (str == AddAnnotType.AnnotStamp.ToString())
@@ -473,14 +496,14 @@ namespace PDF_Office.ViewModels.Tools
                 switch (menuItem.Tag.ToString())
                 {
                     case "default":
-                        PDFViewer.SetMouseMode(MouseModes.PanTool);
+                        PDFViewer.SetMouseMode(MouseModes.Default);
                         //viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-                        BtnHandIsChecked = true;
+                        BtnHandIsChecked = false;
                         ShowPropertyPanel(false);
                         break;
 
                     case "roll":
-                        PDFViewer.SetMouseMode(MouseModes.None);
+                        PDFViewer.SetMouseMode(MouseModes.PanTool);
                         //viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
                         BtnHandIsChecked = true;
                         ShowPropertyPanel(false);
@@ -606,13 +629,29 @@ namespace PDF_Office.ViewModels.Tools
         private void DisplayAnnot_Click(object sender, RoutedEventArgs e)
         {
             PDFViewer.SetDrawAnnot(true);
-            isHiddenAnnot = true;
+            BtnShowAnnotIsChecked = true;
+
+            bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
+
+            if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
+            {
+                AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
+                viewModel.DisplayAnnot();
+            }
         }
 
         private void HiddenAnnot_Click(object sender, RoutedEventArgs e)
         {
             PDFViewer.SetDrawAnnot(false);
-            isHiddenAnnot = false;
+            BtnShowAnnotIsChecked = false;
+
+            bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
+
+            if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
+            {
+                AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
+                viewModel.HiddenAnnot();
+            }
         }
 
         private void SetAddAnnotation(ItemCollection items)
@@ -652,6 +691,11 @@ namespace PDF_Office.ViewModels.Tools
         {
             navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
+
+            if (viewContentViewModel != null)
+            {
+                OpenFileInfo = viewContentViewModel.OpenFileInfo;
+            }
             BindingPDFViewerHandler();
             BindingEvent();
             LoaedStickyNotePopup();

+ 82 - 22
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -21,6 +21,7 @@ using System.Threading.Tasks;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 using Task = System.Threading.Tasks.Task;
 using PDF_Office.Model.Dialog.ToolsDialogs;
+using ComPDFKitViewer;
 
 namespace PDF_Office.ViewModels.Tools
 {
@@ -31,13 +32,13 @@ namespace PDF_Office.ViewModels.Tools
         private ViewContentViewModel viewContentViewModel;
 
         public IDialogService dialogs;
-
+        public CropPageUndoManager UndoManager = new CropPageUndoManager();
         public IEventAggregator eventAggregator;
+        List<int> cropCurrentPageList = new List<int>();
 
-       
 
         private CPDFDocument.GetPageIndexDelegate indexDelegate = null;
-    
+
 
         public string unicode = null;
 
@@ -60,8 +61,8 @@ namespace PDF_Office.ViewModels.Tools
         //        App.mainWindowViewModel.Value = int.Parse(PageIndex);
         //    }
         //}
-    //private CPDFDocument tempDocument;
-    //private IntPtr compressingIntpr = IntPtr.Zero;
+        //private CPDFDocument tempDocument;
+        //private IntPtr compressingIntpr = IntPtr.Zero;
         //private string _pageNumber = "";
         ///// <value>
         ///// 总页数
@@ -81,7 +82,8 @@ namespace PDF_Office.ViewModels.Tools
         public DelegateCommand CancelPasswordCommand { get; set; }
         public DelegateCommand<object> SetEditToolsCommand { get; set; }
         public DelegateCommand SetWatermarkCommand { get; set; }
-
+        public DelegateCommand CropCurrentPageWMCommand { get; set; }
+        public DelegateCommand CropAllPagesWMCommand { get; set; }
         public ToolsBarContentViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
         {
             dialogs = dialogService;
@@ -92,6 +94,8 @@ namespace PDF_Office.ViewModels.Tools
             SetPasswordCommand = new DelegateCommand(OpenSetPasswordDialog);
             CancelPasswordCommand = new DelegateCommand(OpenCancelPasswordDialog);
             SetEditToolsCommand = new DelegateCommand<object>(SetEditTools);
+            CropCurrentPageWMCommand = new DelegateCommand(CropCurrentPageWM);
+            CropAllPagesWMCommand = new DelegateCommand(CropAllPagesWM);
         }
 
         private void SetEditTools(object e)
@@ -112,7 +116,7 @@ namespace PDF_Office.ViewModels.Tools
             {
                 CompressDialogModel compressDialogModel = new CompressDialogModel();
                 compressDialogModel.OnOpened((Prism.Services.Dialogs.DialogResult)e);
-               // OnOpened((Prism.Services.Dialogs.DialogResult)e);
+                // OnOpened((Prism.Services.Dialogs.DialogResult)e);
             });
         }
 
@@ -169,31 +173,34 @@ namespace PDF_Office.ViewModels.Tools
                 VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
                 if (result.IsDiscryptied)
                 {
+
                     if (result.Password != null)
                     {
                         string filePath = PDFViewer.Document.FilePath;
                         PDFViewer.Document.Release();
                         PDFViewer.InitDocument(filePath);
+                        PDFViewer.Load();
                         PDFViewer.Document.UnlockWithPassword(result.Password);
                     }
-                }
-            }
 
-            DialogParameters value = new DialogParameters();
-            value.Add(ParameterNames.PDFViewer, this.PDFViewer);
-            value.Add(ParameterNames.ViewContentViewModel, this.viewContentViewModel);
-            dialogs.ShowDialog(DialogNames.SetPasswordDialog, value, e =>
-            {
-                if (e.Result == ButtonResult.OK)
-                {
-                    SecurityHelper.IsPasswordChanged = true;
-                    if (viewContentViewModel.SecurityInfo.IsPasswordChanged)
+
+                    DialogParameters value = new DialogParameters();
+                    value.Add(ParameterNames.PDFViewer, this.PDFViewer);
+                    value.Add(ParameterNames.ViewContentViewModel, this.viewContentViewModel);
+                    dialogs.ShowDialog(DialogNames.SetPasswordDialog, value, e =>
                     {
-                        viewContentViewModel.PDFViewer.UndoManager.CanSave = true;
-                    }
-                    this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusSetPasswordSuccessfully, Unicode = unicode });
+                        if (e.Result == ButtonResult.OK)
+                        {
+                            SecurityHelper.IsPasswordChanged = true;
+                            if (viewContentViewModel.SecurityInfo.IsPasswordChanged)
+                            {
+                                viewContentViewModel.PDFViewer.UndoManager.CanSave = true;
+                            }
+                            this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusSetPasswordSuccessfully, Unicode = unicode });
+                        }
+                    });
                 }
-            });
+            }
         }
 
         private void OpenCancelPasswordDialog()
@@ -221,6 +228,57 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        private async void CropCurrentPageWM()
+        {
+            viewContentViewModel.IsLoading = Visibility.Visible;
+            await WaitCropCurrentPageWM();
+            viewContentViewModel.IsLoading = Visibility.Collapsed;
+        }
+        private async void CropAllPagesWM()
+        {
+            viewContentViewModel.IsLoading = Visibility.Visible;
+            await WaitCropAllPagesWM();
+            viewContentViewModel.IsLoading = Visibility.Collapsed;
+
+            //PDFViewer.UndoManager.AddHistory();
+        }
+
+        private async Task WaitCropCurrentPageWM()
+        {
+            await Task.Run(() =>
+            {
+                if (PDFViewer.CurrentIndex > 0)
+                {
+                    UndoManager.cropPageList.Add(PDFViewer.CurrentIndex);
+                }
+                UndoManager.ADDCropCurrentPageWM();
+                PDFViewer?.SetCropMode(true, UndoManager.cropPageList);
+                PDFViewer.UndoManager.AddHistory(UndoManager);
+                PDFViewer.UndoManager.CanSave = true;
+            });
+
+        }
+
+        private async Task WaitCropAllPagesWM()
+        {
+            await Task.Run(() =>
+            {
+                List<int> cropPagesList = new List<int>();
+                for (int i = 0; i < PDFViewer.Document.PageCount; i++)
+                {
+                    cropPagesList.Add(i);
+                }
+
+                UndoManager.cropPageList.AddRange(cropPagesList);
+                UndoManager.ADDCropAllPagesWM();
+                PDFViewer?.SetCropMode(true, UndoManager.cropPageList);
+                PDFViewer.UndoManager.AddHistory(UndoManager);
+                PDFViewer.UndoManager.CanSave = true;
+            });
+        }
+
+
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -236,6 +294,8 @@ namespace PDF_Office.ViewModels.Tools
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             if (PDFViewer != null)
             {
+                UndoManager.setPDFViewer(PDFViewer);
+                //DFViewer.UndoManager.AddHistory(UndoManager);
                 isFirstLoad = false;
             }
         }

+ 259 - 18
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -27,11 +27,162 @@ using PDF_Office.Model.Dialog.ConverterDialogs;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using System.Linq;
+using System.Text;
 
 namespace PDF_Office.ViewModels
 {
     public class ViewContentViewModel : BindableBase, INavigationAware
     {
+        #region 文案
+
+        private string T_file;
+
+        public string T_File
+        {
+            get { return T_file; }
+            set
+            {
+                SetProperty(ref T_file, value);
+            }
+        }
+
+        private string T_save;
+
+        public string T_Save
+        {
+            get { return T_save; }
+            set
+            {
+                SetProperty(ref T_save, value);
+            }
+        }
+
+        private string T_undo;
+
+        public string T_Undo
+        {
+            get { return T_undo; }
+            set
+            {
+                SetProperty(ref T_undo, value);
+            }
+        }
+
+        private string T_redo;
+
+        public string T_Redo
+        {
+            get { return T_redo; }
+            set
+            {
+                SetProperty(ref T_redo, value);
+            }
+        }
+
+        private string T_annotation;
+
+        public string T_Annotation
+        {
+            get { return T_annotation; }
+            set
+            {
+                SetProperty(ref T_annotation, value);
+            }
+        }
+
+        private string T_pageEdit;
+
+        public string T_PageEdit
+        {
+            get { return T_pageEdit; }
+            set
+            {
+                SetProperty(ref T_pageEdit, value);
+            }
+        }
+
+        private string T_converter;
+
+        public string T_Converter
+        {
+            get { return T_converter; }
+            set
+            {
+                SetProperty(ref T_converter, value);
+            }
+        }
+
+        private string T_fillSign;
+
+        public string T_FillSign
+        {
+            get { return T_fillSign; }
+            set
+            {
+                SetProperty(ref T_fillSign, value);
+            }
+        }
+
+        private string T_tools;
+
+        public string T_Tools
+        {
+            get { return T_tools; }
+            set
+            {
+                SetProperty(ref T_tools, value);
+            }
+        }
+
+        private string T_print;
+
+        public string T_Print
+        {
+            get { return T_print; }
+            set
+            {
+                SetProperty(ref T_print, value);
+            }
+        }
+
+        private string T_share;
+
+        public string T_Share
+        {
+            get { return T_share; }
+            set
+            {
+                SetProperty(ref T_share, value);
+            }
+        }
+        private string T_properties;
+
+        public string T_Properties
+        {
+            get { return T_properties; }
+            set
+            {
+                SetProperty(ref T_properties, value);
+            }
+        }
+
+
+        private void InitStirng()
+        {
+            T_File = App.MainPageLoader.GetString("ViewTopToolbar_File");
+            T_Save = App.MainPageLoader.GetString("ViewTopToolbar_Save");
+            T_Undo = App.MainPageLoader.GetString("ViewTopToolbar_Undo");
+            T_Redo = App.MainPageLoader.GetString("ViewTopToolbar_Redo");
+            T_Annotation = App.MainPageLoader.GetString("ViewTopToolbar_Annotation");
+            T_PageEdit = App.MainPageLoader.GetString("ViewTopToolbar_PageEdit");
+            T_Converter = App.MainPageLoader.GetString("ViewTopToolbar_Converter");
+            T_FillSign = App.MainPageLoader.GetString("ViewTopToolbar_Fill&Sign");
+            T_Tools = App.MainPageLoader.GetString("ViewTopToolbar_Tools");
+            T_Print = App.MainPageLoader.GetString("ViewTopToolbar_Print");
+            T_Share = App.MainPageLoader.GetString("ViewTopToolbar_Share");
+            T_Properties = App.MainPageLoader.GetString("ViewTopToolbar_Properties");
+        }
+        #endregion
         #region 属性、变量
 
         public OpenFileInfo OpenFileInfo = null;
@@ -529,10 +680,15 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand OpenFileCommand { get; set; }
 
+        public DelegateCommand<string> HelpCommand { get; set; }
+
+
+        public DelegateCommand CreateBlankFileCommand { get; set; }
         #endregion 命令
 
         public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
         {
+            InitStirng();
             region = regionManager;
             dialogs = dialogService;
             events = eventAggregator;
@@ -555,6 +711,8 @@ namespace PDF_Office.ViewModels
             ConvertCommand = new DelegateCommand<string>(convert);
             CloseWindowCommand = new DelegateCommand(closeWindow);
             OpenFileCommand = new DelegateCommand(openfile);
+            HelpCommand = new DelegateCommand<string>(help);
+            CreateBlankFileCommand = new DelegateCommand(createBlankFile);
 
             ViwerRegionName = RegionNames.ViwerRegionName;
             SplitViewerRegionName = RegionNames.Viewer_SplitRegionName;
@@ -599,6 +757,60 @@ namespace PDF_Office.ViewModels
             EnterSelectedBar("TabItemAnnotation");
         }
 
+        /// <summary>
+        ///创建空白文档
+        /// </summary>
+        private async void createBlankFile()
+        {
+            App.mainWindowViewModel.AddTab.Execute();
+            await Task.Delay(30);
+            (App.mainWindowViewModel.SelectedItem.DataContext as MainContentViewModel).CreateFile();
+        }
+
+        private void help(string args)
+        {
+            string url = "";
+            switch (args)
+            {
+                case "Guid":
+                    //TODO 打开内嵌文档
+                    break;
+                case "Online":
+                    url = @"https://www.pdfreaderpro.com/windows/help";
+                    break;
+                case "More":
+                    url = @"https://www.pdfreaderpro.com/product?utm_source=MacApp&utm_campaign=ProductLink&utm_medium=PdfProduct";
+                    break;
+                case "Template":
+                    url = @"https://www.pdfreaderpro.com/templates?utm_source=MacApp&utm_campaign=TemplatesLink&utm_medium=PdfTemplates";
+                    break;
+                case "Blog":
+                    //TODO:显示订阅电子报弹窗
+                    break;
+                case "ComPDF":
+                    url = @"https://www.compdf.com/?utm_source=macapp&utm_medium=pdfmac&utm_campaign=compdfkit-promp";
+                    break;
+                case "FeedBack":
+                    //调用邮箱 发送邮件
+                    StringBuilder sr = new StringBuilder();
+                    sr.AppendFormat("{0} - {1};{2};{3} - {4}", App.Name, App.Version, "Propose a New Feature", ServiceHelper.ComputerInfo, ServiceHelper.SystemInfo);
+
+                    System.Diagnostics.Process.Start(string.Format("mailto:support@pdfreaderpro.com?subject={0}", sr));
+                    break;
+                default:
+                    break;
+            }
+
+            if (!string.IsNullOrEmpty(url))
+            {
+                //需要跳转网页的情况
+                System.Diagnostics.Process.Start(url);
+            }
+        }
+
+        /// <summary>
+        /// 打开文件,跟首页的打开文件有区别,需要新开一个页签
+        /// </summary>
         private void openfile()
         {
             OpenFileDialog openFileDialog = new OpenFileDialog();
@@ -1480,6 +1692,12 @@ namespace PDF_Office.ViewModels
                         return false;
                 }
 
+                //Security Fixed:
+                //修改密码后原文档保存的步骤:
+                //在设置密码窗口传出“已修改”信号,并允许延迟保存
+                //延迟保存方式:
+                //
+                //
                 if (SecurityInfo.IsPasswordChanged)
                 {
                     string currentFilePath = PDFViewer.Document.FilePath;
@@ -1497,36 +1715,58 @@ namespace PDF_Office.ViewModels
                         permissionsPassword = SecurityInfo.PermissionsPassword;
                         cPDFPermissionsInfo = SecurityInfo.CPDFPermissionsInfo;
                     }
-                    //方案一
-                    if (true)
-                    {
-                        PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
-                        AlertsMessage alertsMessage = new AlertsMessage();
-                        alertsMessage.ShowDialog("", "文件安全设置已修改,需要另存为", "Cancel", "OK");
-                        if (alertsMessage.result == ContentResult.Ok)
-                            return saveAsFile();
-                        else
-                            return false;
-                    }
-                    else
+
+                    try
                     {
-                        //方案二
                         string currentPath = PDFViewer.Document.FilePath;
                         string tempPath = PDFViewer.Document.FilePath + ".temp.pdf";
                         PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
+
                         PDFViewer.Document.WriteToFilePath(tempPath);
+                        PDFViewer.CloseDocument();
                         PDFViewer.InitDocument(tempPath);
-                        //PDFViewer.Document.UnlockWithPassword(permissionsPassword);
-                        //PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
+                        if (!string.IsNullOrEmpty(permissionsPassword))
+                        {
+                            PDFViewer.Document.UnlockWithPassword(permissionsPassword);
+                        }
+                        else if (!string.IsNullOrEmpty(openPassword))
+                        {
+                            PDFViewer.Document.UnlockWithPassword(openPassword);
+                        }
+                        PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
+
                         PDFViewer.Document.WriteToFilePath(currentPath);
-                        System.IO.File.Delete(tempPath);
                         PDFViewer.CloseDocument();
                         PDFViewer.InitDocument(currentPath);
-                        PDFViewer.Document.UnlockWithPassword(permissionsPassword);
+                        //System.IO.File.Delete(tempPath);
+
+                        if (!string.IsNullOrEmpty(permissionsPassword))
+                        {
+                            PDFViewer.Document.UnlockWithPassword(permissionsPassword);
+                        }
+                        else if (!string.IsNullOrEmpty(openPassword))
+                        {
+                            PDFViewer.Document.UnlockWithPassword(openPassword);
+                        }
+                        try
+                        {
+                            PDFViewer.Load();
+                        }
+                        catch
+                        {
+
+                        }
+                        PDFViewer.UndoManager.CanSave = false;
+                        SecurityInfo.IsPasswordChanged = false;
+                        return true;
+                    }
+                    catch
+                    {
+                        return false;
                     }
                 }
 
-                bool result = PDFViewer.Document.WriteToLoadedPath();
+                bool  result = PDFViewer.Document.WriteToLoadedPath();
                 if (result)
                 {
                     PDFViewer.UndoManager.CanSave = false;
@@ -1573,6 +1813,7 @@ namespace PDF_Office.ViewModels
                                           SettingHelper.SetFileInfo(info);
                                       }
                                   });
+                    PDFViewer.ReloadDocument();
                 }
                 else
                 {

+ 2 - 2
PDF Office/Views/BOTA/AnnotationContent.xaml

@@ -68,7 +68,7 @@
                 ItemsSource="{Binding AnnotationListItems}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 SelectionChanged="AnnotationList_SelectionChanged"
-                SelectionMode="Extended">
+                SelectionMode="Extended" KeyDown="AnnotationList_KeyDown">
                 <ListBox.ItemContainerStyle>
                     <Style TargetType="ListBoxItem">
                         <Setter Property="HorizontalContentAlignment" Value="Stretch" />
@@ -256,7 +256,7 @@
                                     Name="MenuCollapseAll"
                                     Click="MenuCollapseAll_Click"
                                     Header="全部折叠" />
-                                <MenuItem Name="MenuSort">
+                                <MenuItem Name="MenuSort" Visibility="Collapsed">
                                     <MenuItem.Header>
                                         <TextBlock Name="MenuSortText" Text="排序" />
                                     </MenuItem.Header>

+ 13 - 1
PDF Office/Views/BOTA/AnnotationContent.xaml.cs

@@ -235,7 +235,7 @@ namespace PDF_Office.Views.BOTA
                         }
 
                         System.Windows.Clipboard.SetText(Copystr.ToString());
-                        CustomControl.MessageBoxEx.Show("数据复制成功");
+                        //CustomControl.MessageBoxEx.Show("数据复制成功");
                     }
                 }
             }
@@ -324,5 +324,17 @@ namespace PDF_Office.Views.BOTA
                 viewModel.ListBoxItemPreviewMouseLeftButtonDown.Execute((sender as ListBox).SelectedItems[0]);
             }
         }
+
+        private void AnnotationList_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
+        {
+            if (AnnotationList.SelectedItems == null)
+            {
+                return;
+            }
+            if (e.Key == Key.Escape)
+            {
+                AnnotationList.SelectedItems.Clear();
+            }
+        }
     }
 }

+ 9 - 1
PDF Office/Views/BOTA/AnnotationListItem.xaml

@@ -352,7 +352,15 @@
             <Image
                 Name="ImageContext"
                 Grid.Row="1"
-                Source="{Binding WriteableBitmap}" />
+                Source="{Binding WriteableBitmap}">
+                <Image.RenderTransform>
+                    <TransformGroup>
+                        <TranslateTransform />
+                        <ScaleTransform />
+                        <RotateTransform />
+                    </TransformGroup>
+                </Image.RenderTransform>
+            </Image>
 
             <StackPanel Grid.Row="2" Margin="0,2">
                 <!--  附注  -->

+ 69 - 0
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -236,6 +236,75 @@ namespace PDF_Office.Views.BOTA
             double width = args.WriteableBitmap.Width;
             double height = args.WriteableBitmap.Height;
 
+            #region 方案一
+
+            CPDFDocument doc = args.Document;
+            CPDFPage docPage = doc.PageAtIndex(args.PageIndex, false);
+            if (docPage != null)
+            {
+                //BitmapImage bitmapImage = new BitmapImage();
+                //bitmapImage.BeginInit();
+                //bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
+                //bitmapImage.StreamSource = args.WriteableBitmap.StreamSource;
+
+                //switch (docPage.Rotation)
+                //{
+                //    case 0:
+                //        bitmapImage.Rotation = Rotation.Rotate0;
+                //        break;
+
+                //    case 1:
+                //        bitmapImage.Rotation = Rotation.Rotate90;
+                //        break;
+
+                //    case 2:
+                //        bitmapImage.Rotation = Rotation.Rotate180;
+                //        break;
+
+                //    case 3:
+                //        bitmapImage.Rotation = Rotation.Rotate270;
+                //        break;
+                //}
+                //bitmapImage.EndInit();
+                //ImageContext.Source = bitmapImage;
+
+                //switch (rotate)
+                //{
+                //    case 0:
+                //        RotateTransform rotateTransform = new RotateTransform(0);
+                //        ImageContext.RenderTransform = rotateTransform;
+                //        break;
+
+                //    case 1:
+                //        //rotateTransform = new RotateTransform(90);//90度
+                //        //ImageContext.RenderTransform = rotateTransform;
+                //        TransformGroup tg = ImageContext.RenderTransform as TransformGroup;
+                //        var tgnew = tg.CloneCurrentValue();
+                //        if (tgnew != null)
+                //        {
+                //            RotateTransform rt = tgnew.Children[2] as RotateTransform;
+                //            ImageContext.RenderTransformOrigin = new Point(0.5, 0.5);
+                //            rt.Angle = 90;
+                //        }
+
+                //        // 重新给图像赋值Transform变换属性
+                //        ImageContext.RenderTransform = tgnew;
+                //        break;
+
+                //    case 2:
+                //        rotateTransform = new RotateTransform(180);
+                //        ImageContext.RenderTransform = rotateTransform;
+                //        break;
+
+                //    case 3:
+                //        rotateTransform = new RotateTransform(270);
+                //        ImageContext.RenderTransform = rotateTransform;
+                //        break;
+                //}
+            }
+
+            #endregion 方案一
+
             if (width > 180)
             {
                 ImageContext.Stretch = Stretch.Uniform;

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

@@ -149,7 +149,7 @@
                 VirtualizingPanel.CacheLength="1"
                 VirtualizingPanel.CacheLengthUnit="Page"
                 VirtualizingPanel.IsVirtualizing="True"
-                VirtualizingPanel.ScrollUnit="Pixel">
+                VirtualizingPanel.ScrollUnit="Pixel" KeyDown="BookMarkListView_KeyDown" PreviewMouseDown="BookMarkListView_PreviewMouseDown">
                 <ListView.ItemsPanel>
                     <ItemsPanelTemplate>
                         <VirtualizingStackPanel Margin="-5,0,0,0" Background="Transparent" />

+ 29 - 2
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -271,10 +271,15 @@ namespace PDF_Office.Views.BOTA
                     }
                     else
                     {
-                        listBoxItem.Focus();
+                        TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
+                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
+                        if (textBox.IsFocused == false)
+                        {
+                            listBoxItem.Focus();
+                        }
                     }
                 }
-                BookMarkListView.Focus();
+                //BookMarkListView.Focus();
             }
         }
 
@@ -346,5 +351,27 @@ namespace PDF_Office.Views.BOTA
                 }
             }
         }
+
+        private void BookMarkListView_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (BookMarkListView.SelectedItems == null)
+            {
+                return;
+            }
+            if (e.Key == Key.Escape)
+            {
+                BookMarkListView.SelectedItems.Clear();
+            }
+            if (e.Key == Key.Delete)
+            {
+                if (BookMarkListView.SelectedItems.Count > 0)
+                {
+                    //全选删除
+                    if (BookMarkListView.SelectedItems.Count == BookMarkListView.Items.Count)
+                    {
+                    }
+                }
+            }
+        }
     }
 }

+ 17 - 19
PDF Office/Views/BOTA/OutLineControl.xaml

@@ -8,8 +8,9 @@
     xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:model="clr-namespace:PDF_Office.Model.BOTA"
-    x:Name="ttt"
+    xmlns:mainPageLoader="clr-namespace:PDF_Office.Strings.MainPage"
     d:DataContext="{d:DesignInstance Type=bota:OutLineControlViewModel}"
+    Loaded="UserControl_Loaded"
     mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
@@ -32,8 +33,7 @@
                     VerticalAlignment="Center"
                     FontFamily="Segoe UI"
                     FontSize="14"
-                    FontWeight="SemiBold"
-                    Text="Outline" />
+                    FontWeight="SemiBold"/>
                 <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                     <customcontrol:PathButton
                         x:Name="BtnAdd"
@@ -79,20 +79,17 @@
                                         <Setter Property="VerticalContentAlignment" Value="Center" />
                                     </Style>
                                 </ContextMenu.ItemContainerStyle>
-                                <MenuItem
-                                    Name="MenuDeleteAll"
-                                    Command="{Binding DeleteAllCommand}"
-                                    Header="Delete All Outline" />
                                 <MenuItem
                                     Name="MenuExpandAll"
                                     Command="{Binding ExpandAllCommand}"
-                                    CommandParameter="{Binding Outlinelist}"
-                                    Header="一键展开" />
+                                    CommandParameter="{Binding Outlinelist}" />
                                 <MenuItem
                                     Name="MenuCollapseAll"
                                     Command="{Binding CollapseAllCommand}"
-                                    CommandParameter="{Binding Outlinelist}"
-                                    Header="一键折叠" />
+                                    CommandParameter="{Binding Outlinelist}"/>
+                                <MenuItem
+                                    Name="MenuDeleteAll"
+                                    Command="{Binding DeleteAllCommand}" />
                             </ContextMenu>
                         </customcontrol:PathButton.ContextMenu>
                     </customcontrol:PathButton>
@@ -172,40 +169,40 @@
                                     <MenuItem
                                         x:Name="AddMenu"
                                         Click="AddMenu_Click"
-                                        Header="添加条目" />
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Add}" />
                                     <MenuItem
                                         x:Name="AddChlidMenu"
                                         Click="AddChlidMenu_Click"
-                                        Header="添加子条目" />
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_AddSub}" />
                                     <MenuItem
                                         x:Name="AddParentMenu"
                                         Click="AddParentMenu_Click"
-                                        Header="添加上一级条目"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_AddLevel}"
                                         IsEnabled="{Binding CanAddParent}" />
 
                                     <MenuItem
                                         x:Name="DeleteMenu"
                                         Click="DeleteMenu_Click"
-                                        Header="删除" />
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Delete}" />
 
                                     <MenuItem
                                         x:Name="RenameMenu"
                                         Click="RenameMenu_Click"
-                                        Header="重命名" />
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Rename}" />
                                     <MenuItem
                                         x:Name="ChangeDestinationMenu"
                                         Click="ChangeDestinationMenu_Click"
-                                        Header="更改目标位置" />
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Change}" />
 
                                     <MenuItem
                                         x:Name="UpgradeMenu"
                                         Click="UpgradeMenu_Click"
-                                        Header="升级"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Up}"
                                         IsEnabled="{Binding CanUp}" />
                                     <MenuItem
                                         x:Name="DowngradeMenu"
                                         Click="DowngradeMenu_Click"
-                                        Header="降级"
+                                        Header="{x:Static mainPageLoader:MainPage.Outline_Down}"
                                         IsEnabled="{Binding CanDown}" />
                                 </ContextMenu>
                             </Grid.ContextMenu>
@@ -274,6 +271,7 @@
                                     HorizontalAlignment="Left"
                                     VerticalAlignment="Center"
                                     IsVisibleChanged="ReName_IsVisibleChanged"
+                                    KeyDown="ReName_KeyDown"
                                     Style="{StaticResource TextBoxStyleRadius}" />
                             </Grid>
                         </Grid>

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

@@ -56,6 +56,10 @@ namespace PDF_Office.Views.BOTA
             InitializeComponent();
         }
 
+        private void LoadedLangText()
+        {
+        }
+
         private void BtnMore_Click(object sender, RoutedEventArgs e)
         {
             MenuMore.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
@@ -79,9 +83,9 @@ namespace PDF_Office.Views.BOTA
                     return;
                 }
                 DataObject dataObj = new DataObject(treeViewItem);
-         
-                    DragDrop.DoDragDrop(OutlineView, dataObj, DragDropEffects.Move);
-               
+
+                DragDrop.DoDragDrop(OutlineView, dataObj, DragDropEffects.Move);
+
                 return;
             }
         }
@@ -399,7 +403,7 @@ namespace PDF_Office.Views.BOTA
         private void ChangeDestinationMenu_Click(object sender, RoutedEventArgs e)
         {
             AlertsMessage alertsMessage = new AlertsMessage();
-            alertsMessage.ShowDialog("提示", "确定要将选定大纲的目标位置设置为当前位置吗?", "Cancel", "OK");
+            alertsMessage.ShowDialog("", App.MainPageLoader.GetString("Outline_DialogContent"), App.MainPageLoader.GetString("Outline_DialogNO"), App.MainPageLoader.GetString("Outline_DialogYes"));
             if (alertsMessage.result == ContentResult.Ok)
             {
                 (DataContext as OutLineControlViewModel).ChangeOutLineDestination((sender as MenuItem).DataContext as OutlineNode);
@@ -416,15 +420,19 @@ namespace PDF_Office.Views.BOTA
             int ItemIndex = (DataContext as OutLineControlViewModel).AddOutLine(OutlineView.SelectedItem as OutlineNode);
             OutlineView.UpdateLayout();
             OutlineNode node = (DataContext as OutLineControlViewModel).FindOutlineFromList((DataContext as OutLineControlViewModel).Outlinelist, OutlineView.SelectedItem as OutlineNode, ItemIndex);
-            //if (!string.IsNullOrEmpty(str))
-            //{
-            //    CPDFOutline result = node.Outline;
-            //    (DataContext as OutLineControlViewModel).SetTitle(result, str);
-            //    (DataContext as OutLineControlViewModel).Updata(false);
-            //}
+            if (!string.IsNullOrEmpty(str))
+            {
+                CPDFOutline result = node.Outline;
+                (DataContext as OutLineControlViewModel).SetTitle(result, str);
+                (DataContext as OutLineControlViewModel).Updata(false);
+            }
+
             node.IsSelected = true;
             ReNameOutlineNode = node;
             node.IsReName = Visibility.Collapsed;
+            //    });
+            //});
+
             return node;
         }
 
@@ -466,5 +474,21 @@ namespace PDF_Office.Views.BOTA
         {
             onDrop = false;
         }
+
+        private void ReName_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Enter)
+            {
+                OutlineView.Focus();
+            }
+        }
+
+        private void UserControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            TxtTitle.Text = App.MainPageLoader.GetString("Outline_Title");
+            MenuExpandAll.Header = App.MainPageLoader.GetString("Outline_Expand");
+            MenuCollapseAll.Header = App.MainPageLoader.GetString("Outline_Collapse");
+            MenuDeleteAll.Header = App.MainPageLoader.GetString("Outline_RemoveAll");
+        }
     }
 }

+ 9 - 9
PDF Office/Views/BOTA/SearchContent.xaml.cs

@@ -34,10 +34,10 @@ namespace PDF_Office.Views.BOTA
         const int MaxHistoryCount = 10;
         private void TextBox_KeyDown(object sender, KeyEventArgs e)
         {
-            if (e.Key==Key.Enter)
+            if (e.Key == Key.Enter)
             {
                 TextBox text = e.Source as TextBox;
-                if (text==null)
+                if (text == null)
                 {
                     return;
                 }
@@ -46,12 +46,12 @@ namespace PDF_Office.Views.BOTA
                     return;
                 }
                 (DataContext as SearchContentViewModel).SearchText(text.Text);
-                 HistorySearchText.Remove(text.Text);
+                HistorySearchText.Remove(text.Text);
                 if (HistorySearchText.Count >= MaxHistoryCount)
                 {
-                    HistorySearchText.RemoveAt(0);
+                    HistorySearchText.RemoveAt(HistorySearchText.Count - 1);
                 }
-                HistorySearchText.Add(text.Text);
+                HistorySearchText.Insert(0, text.Text);
             }
         }
 
@@ -70,7 +70,7 @@ namespace PDF_Office.Views.BOTA
                 foreach (object item2 in item.Items)
                 {
                     SearchItem searchItem = item2 as SearchItem;
-                    if (searchItem.TextProperty.ItemVisibility==Visibility.Visible)
+                    if (searchItem.TextProperty.ItemVisibility == Visibility.Visible)
                     {
                         searchItem.TextProperty.ItemVisibility = Visibility.Collapsed;
                     }
@@ -84,8 +84,8 @@ namespace PDF_Office.Views.BOTA
 
         private void Create_Click(object sender, RoutedEventArgs e)
         {
-            MenuItem menuItem= sender as MenuItem;
-            if (menuItem==null)
+            MenuItem menuItem = sender as MenuItem;
+            if (menuItem == null)
             {
                 return;
             }
@@ -139,7 +139,7 @@ namespace PDF_Office.Views.BOTA
                 ContextSearchText.Items.Add(Searchitem);
             }
 
-            if (HistorySearchText.Count>0)
+            if (HistorySearchText.Count > 0)
             {
                 ContextSearchText.Items.Add(ClearSeparator);
                 ContextSearchText.Items.Add(ClearItem);

+ 4 - 2
PDF Office/Views/Dialog/BOTA/ScreenAnnotationDialog.xaml

@@ -34,6 +34,7 @@
                         Name="EllipseColor"
                         Width="20"
                         Height="20"
+                        StrokeThickness="1" Stroke="{StaticResource color.sys.layout.divider}"
                         Fill="{Binding Color}" />
                 </Border>
             </DataTemplate>
@@ -46,7 +47,7 @@
                     FontSize="12"
                     Text="{Binding Name}" />
             </DataTemplate>
-            <Style x:Key="ListboxItemStyle" TargetType="{x:Type ListBoxItem}">
+            <Style x:Key="ListColorItemStyle" TargetType="{x:Type ListBoxItem}">
                 <Setter Property="HorizontalAlignment" Value="Center" />
                 <Setter Property="Height" Value="40" />
                 <Setter Property="Width" Value="40" />
@@ -60,6 +61,7 @@
                                 Width="40"
                                 Height="40"
                                 HorizontalAlignment="Center"
+
                                 Background="{TemplateBinding Background}"
                                 CornerRadius="4">
                                 <ContentPresenter />
@@ -472,7 +474,7 @@
                     Margin="15,0"
                     Background="Transparent"
                     BorderThickness="0"
-                    ItemContainerStyle="{StaticResource ListboxItemStyle}"
+                    ItemContainerStyle="{StaticResource ListColorItemStyle}"
                     ItemTemplate="{StaticResource ListColorData}"
                     ItemsSource="{Binding AnnotationColors}"
                     ScrollViewer.HorizontalScrollBarVisibility="Disabled"

+ 200 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/CreateFromScannerDialogs.xaml

@@ -0,0 +1,200 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.CreateFromScannerDialogs"
+             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:i="http://schemas.microsoft.com/xaml/behaviors"
+             xmlns:prism="http://prismlibrary.com/" 
+             xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert"
+             xmlns:local="clr-namespace:PDF_Office.Views.Dialog.HomePageToolsDialogs"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <dataconvert:BoolToVisible x:Key="BoolToVisible"/>
+        <dataconvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
+        <Style x:Key="ScannerListViewItemStyle" TargetType="{x:Type ListViewItem}">
+            <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
+            <Setter Property="Panel.Background" Value="#00FFFFFF" />
+            <Setter Property="Border.BorderBrush" Value="#00FFFFFF" />
+            <Setter Property="Border.BorderThickness" Value="1" />
+            <Setter Property="FrameworkElement.FocusVisualStyle">
+                <Setter.Value>
+                    <Style TargetType="{x:Type IFrameworkInputElement}">
+                        <Setter Property="Control.Template">
+                            <Setter.Value>
+                                <ControlTemplate>
+                                    <Rectangle
+                                    Margin="2"
+                                    SnapsToDevicePixels="True"
+                                    Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+                                    StrokeDashArray="1 2"
+                                    StrokeThickness="1" />
+                                </ControlTemplate>
+                            </Setter.Value>
+                        </Setter>
+                    </Style>
+                </Setter.Value>
+            </Setter>
+            <Setter Property="Control.Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type ListViewItem}">
+                        <Border
+                        Name="Bd"
+                        Padding="{TemplateBinding Control.Padding}"
+                        Background="{TemplateBinding Panel.Background}"
+                        BorderBrush="{TemplateBinding Border.BorderBrush}"
+                        BorderThickness="{TemplateBinding Border.BorderThickness}"
+                        SnapsToDevicePixels="True">
+                            <Grid>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="Auto" />
+                                    <ColumnDefinition />
+                                </Grid.ColumnDefinitions>
+                                <Grid
+                                x:Name="SelectedIcon"
+                                Margin="12.5,0,0.5,0"
+                                HorizontalAlignment="Left"
+                                VerticalAlignment="Center"
+                                Visibility="Collapsed">
+                                    <Rectangle
+                                    x:Name="Selectedrect"
+                                    Width="20"
+                                    Height="20"
+                                    HorizontalAlignment="Right"
+                                    VerticalAlignment="Top"
+                                    Fill="#FF477EDE" />
+                                    <Path
+                                    x:Name="MultiSelectCheck"
+                                    Width="15"
+                                    Height="15"
+                                    Margin="0,1,0,0"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    Data="M15.3493 0.596191L16.0564 1.3033L5.44979 11.9099L0.146484 6.6066L0.853591 5.89949L5.45004 10.496L15.3493 0.596191Z"
+                                    Fill="White" />
+                                </Grid>
+                                <ContentPresenter
+                                Grid.Column="1"
+                                Margin="0,0,0,0"
+                                HorizontalAlignment="Stretch"
+                                VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
+                                Content="{TemplateBinding ContentControl.Content}"
+                                ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
+                                ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
+                                SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
+                                <Rectangle
+                                Grid.Column="1"
+                                Height="1"
+                                HorizontalAlignment="Stretch"
+                                VerticalAlignment="Bottom"
+                                Fill="#C5CBD3" />
+                            </Grid>
+                        </Border>
+                        <ControlTemplate.Triggers>
+                            <MultiTrigger>
+                                <MultiTrigger.Conditions>
+                                    <Condition Property="UIElement.IsMouseOver" Value="True" />
+                                </MultiTrigger.Conditions>
+                                <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                <!--<Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A000000" />-->
+                            </MultiTrigger>
+                            <MultiTrigger>
+                                <MultiTrigger.Conditions>
+                                    <Condition Property="Selector.IsSelectionActive" Value="False" />
+                                    <Condition Property="Selector.IsSelected" Value="True" />
+                                </MultiTrigger.Conditions>
+                                <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
+                                <!--<Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />-->
+                                <!--<Setter TargetName="SelectedIcon" Property="Grid.Visibility" Value="Visible" />-->
+                            </MultiTrigger>
+                            <MultiTrigger>
+                                <MultiTrigger.Conditions>
+                                    <Condition Property="Selector.IsSelectionActive" Value="True" />
+                                    <Condition Property="Selector.IsSelected" Value="True" />
+                                </MultiTrigger.Conditions>
+                                <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
+                                <!--<Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />-->
+                                <!--<Setter TargetName="SelectedIcon" Property="Grid.Visibility" Value="Visible" />-->
+                            </MultiTrigger>
+                            <Trigger Property="UIElement.IsEnabled" Value="False">
+                                <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+        <DataTemplate x:Key="ScannerItemTemplate">
+            <TextBlock Text="{Binding ScannerName}">
+            </TextBlock>
+        </DataTemplate>
+    </UserControl.Resources>
+    <cus:DialogContent Header="Create PDF from scanner">
+        <Grid>
+            <Grid Height="406" Margin="16,0,16,0"
+                  Visibility="{Binding IsEmptyScanner,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                  >
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="360"/>
+                    <ColumnDefinition Width="16"/>
+                    <ColumnDefinition Width="312"/>
+                </Grid.ColumnDefinitions>
+
+                <Border Background="{StaticResource color.sys.layout.mg}">
+                    <Grid>
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="Auto"/>
+                            <RowDefinition/>
+                        </Grid.RowDefinitions>
+                        <TextBlock Text="Scanners"/>
+                        <ListView Grid.Row="1" x:Name="listScanner" 
+                              ItemsSource="{Binding Scanners}"
+                              ItemContainerStyle="{StaticResource ScannerListViewItemStyle}"
+                              ItemTemplate="{StaticResource ScannerItemTemplate}"
+                              >
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="SelectionChanged">
+                                    <i:InvokeCommandAction Command="{Binding SelectedScannerCommand}" CommandParameter="{Binding ElementName=listScanner,Path=SelectedItem}"/>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </ListView>
+                    </Grid>
+                </Border>
+                <Border Grid.Column="2" CornerRadius="6" BorderThickness="1" BorderBrush="{StaticResource color.sys.layout.divider}">
+                    <Grid>
+                        <Image  x:Name="ScannerImage" Source="{Binding Img}"
+                                Visibility="{Binding IsEmptyImg,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                                >
+                        </Image>
+                        <TextBlock Text="NO Image" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"
+                                   Visibility="{Binding IsEmptyImg,Converter={StaticResource BoolToVisible}}"
+                                   />
+                    </Grid>
+                </Border>
+            </Grid>
+
+            <Grid Height="406" Margin="16,0,16,0" Visibility="{Binding IsEmptyScanner,Converter={StaticResource BoolToVisible}}">
+                <TextBlock Text="No Scanners" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+            </Grid>
+        </Grid>
+        
+        <cus:DialogContent.BottmBar>
+            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
+                <Button
+                    Width="80"
+                    Height="32"
+                    Command="{Binding CreateCommand}"
+                    Content="Scan"
+                    Style="{StaticResource Btn.cta}" />
+                <Button
+                    Width="80"
+                    Height="32"
+                    Margin="16,0"
+                    Command="{Binding CancelCommand}"
+                    Content="Cancel"
+                    Style="{StaticResource btn.sec}" />
+            </StackPanel>
+        </cus:DialogContent.BottmBar>
+    </cus:DialogContent>
+</UserControl>

+ 28 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/CreateFromScannerDialogs.xaml.cs

@@ -0,0 +1,28 @@
+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.Views.Dialog.HomePageToolsDialogs
+{
+    /// <summary>
+    /// CreateFromScannerDialogs.xaml 的交互逻辑
+    /// </summary>
+    public partial class CreateFromScannerDialogs : UserControl
+    {
+        public CreateFromScannerDialogs()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 0 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml


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