Procházet zdrojové kódy

Merge branch 'compdfkit_demo_win_dev' into compdfkit_demo_windows

# Conflicts:
#	Demo/Examples/PDFViewer/MainPage.xaml.cs
TangJinZhou před 1 rokem
rodič
revize
2c85392c41
100 změnil soubory, kde provedl 4909 přidání a 1005 odebrání
  1. 3 0
      .gitignore
  2. 2 1
      Demo/Examples/Annotations/Annotations.csproj
  3. 2 26
      Demo/Examples/Annotations/App.xaml.cs
  4. 77 29
      Demo/Examples/Annotations/MainWindow.xaml
  5. 222 28
      Demo/Examples/Annotations/MainWindow.xaml.cs
  6. 8 38
      Demo/Examples/Annotations/Properties/AssemblyInfo.cs
  7. 5 1
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/CPDFAnnoationListUI.xaml.cs
  8. 1 1
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml
  9. 1 1
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFCreateSignatureDialog.xaml
  10. 2 1
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFCreateStampDialog.xaml
  11. 1 1
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFDeleteDialog.xaml
  12. 1 0
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFFreeTextUI.xaml.cs
  13. 10 2
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFFreehandUI.xaml.cs
  14. 45 33
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFLinkUI.xaml
  15. 10 2
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFMarkupUI.xaml.cs
  16. 9 2
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFNoteUI.xaml.cs
  17. 32 6
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFShapeUI.xaml.cs
  18. 40 3
      Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFAnnotationBarControl.xaml.cs
  19. 3 3
      Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFTitleBarControl.xaml
  20. 27 0
      Demo/Examples/Compdfkit_Tools/Common/Helper/CommonHelper.cs
  21. 2 3
      Demo/Examples/Compdfkit_Tools/Common/PropertyControl/ColorPickerControl.xaml.cs
  22. 2 2
      Demo/Examples/Compdfkit_Tools/Common/PropertyControl/PDFFont/CPDFFontUI.xaml.cs
  23. 7 0
      Demo/Examples/Compdfkit_Tools/Compdfkit_Tools.csproj
  24. 14 0
      Demo/Examples/Compdfkit_Tools/Edit/PDFContentEditControl.xaml
  25. 88 0
      Demo/Examples/Compdfkit_Tools/Edit/PDFContentEditControl.xaml.cs
  26. 2 1
      Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml
  27. 4 5
      Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml.cs
  28. 17 10
      Demo/Examples/Compdfkit_Tools/Edit/PDFTextEdit/PDFTextEditControl/PDFTextEditControl.xaml.cs
  29. 1 1
      Demo/Examples/Compdfkit_Tools/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextStyleUI.xaml.cs
  30. 3 3
      Demo/Examples/Compdfkit_Tools/Form/FromPropertyControl.xaml
  31. 3 3
      Demo/Examples/Compdfkit_Tools/PDFView/PDFDisplaySettings/PDFDisplaySettingsControl/CPDFDisplaySettingsControl.xaml.cs
  32. 27 18
      Demo/Examples/Compdfkit_Tools/PDFView/PDFDisplaySettings/PDFDisplaySettingsUI/CPDFViewModeUI.xaml
  33. 15 2
      Demo/Examples/Compdfkit_Tools/PDFView/PDFDisplaySettings/PDFDisplaySettingsUI/CPDFViewModeUI.xaml.cs
  34. 20 3
      Demo/Examples/Compdfkit_Tools/PDFView/PDFInfo/CPDFInfoControl.xaml
  35. 9 2
      Demo/Examples/Compdfkit_Tools/PDFView/PDFInfo/CPDFInfoControl.xaml.cs
  36. 1 1
      Demo/Examples/Compdfkit_Tools/PDFView/PDFThumbnail/PDFThumbnailUI/CPdfThumbnailUI.xaml
  37. 31 6
      Demo/Examples/Compdfkit_Tools/PDFView/PDFViewControl/PDFViewControl.xaml.cs
  38. 5 4
      Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml
  39. 54 120
      Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml.cs
  40. 4 4
      Demo/Examples/Compdfkit_Tools/Properties/AssemblyInfo.cs
  41. 2 22
      Demo/Examples/ContentEditor/App.xaml.cs
  42. 1 1
      Demo/Examples/ContentEditor/ContentEditor.csproj
  43. 66 31
      Demo/Examples/ContentEditor/MainWindow.xaml
  44. 449 93
      Demo/Examples/ContentEditor/MainWindow.xaml.cs
  45. 7 38
      Demo/Examples/ContentEditor/Properties/AssemblyInfo.cs
  46. 2 23
      Demo/Examples/DocsEditor/App.xaml.cs
  47. 1 1
      Demo/Examples/DocsEditor/DocsEditor.csproj
  48. 52 26
      Demo/Examples/DocsEditor/MainWindow.xaml
  49. 215 47
      Demo/Examples/DocsEditor/MainWindow.xaml.cs
  50. 8 38
      Demo/Examples/DocsEditor/Properties/AssemblyInfo.cs
  51. 364 7
      Demo/Examples/Examlpes.sln
  52. 2 22
      Demo/Examples/Forms/App.xaml.cs
  53. 1 1
      Demo/Examples/Forms/Forms.csproj
  54. 58 27
      Demo/Examples/Forms/MainWindow.xaml
  55. 211 52
      Demo/Examples/Forms/MainWindow.xaml.cs
  56. 8 38
      Demo/Examples/Forms/Properties/AssemblyInfo.cs
  57. 6 0
      Demo/Examples/PDFATest/App.config
  58. 45 0
      Demo/Examples/PDFATest/PDFATest.cs
  59. 82 0
      Demo/Examples/PDFATest/PDFATest.csproj
  60. 36 0
      Demo/Examples/PDFATest/Properties/AssemblyInfo.cs
  61. 4 0
      Demo/Examples/PDFATest/packages.config
  62. 1 2
      Demo/Examples/PDFViewer/App.xaml
  63. 2 30
      Demo/Examples/PDFViewer/App.xaml.cs
  64. binární
      Demo/Examples/PDFViewer/ComPDFKit.Desk.dll
  65. binární
      Demo/Examples/PDFViewer/ComPDFKit.Viewer.dll
  66. 86 33
      Demo/Examples/PDFViewer/MainPage.xaml
  67. 494 101
      Demo/Examples/PDFViewer/MainPage.xaml.cs
  68. 1 1
      Demo/Examples/PDFViewer/MainWindow.xaml
  69. 1 1
      Demo/Examples/PDFViewer/PDFViewer.csproj
  70. 2 2
      Demo/Examples/PDFViewer/Properties/AssemblyInfo.cs
  71. 111 0
      Demo/Examples/Samples/AnnotationImportExportTest/AnnotationImportExportTest.cs
  72. 136 0
      Demo/Examples/Samples/AnnotationImportExportTest/AnnotationImportExportTest.csproj
  73. 6 0
      Demo/Examples/Samples/AnnotationImportExportTest/App.config
  74. 36 0
      Demo/Examples/Samples/AnnotationImportExportTest/Properties/AssemblyInfo.cs
  75. 4 0
      Demo/Examples/Samples/AnnotationImportExportTest/packages.config
  76. 328 0
      Demo/Examples/Samples/AnnotationTest/AnnotationTest.cs
  77. 124 0
      Demo/Examples/Samples/AnnotationTest/AnnotationTest.csproj
  78. 6 0
      Demo/Examples/Samples/AnnotationTest/App.config
  79. 36 0
      Demo/Examples/Samples/AnnotationTest/Properties/AssemblyInfo.cs
  80. 4 0
      Demo/Examples/Samples/AnnotationTest/packages.config
  81. 6 0
      Demo/Examples/Samples/BackgroundTest/App.config
  82. 194 0
      Demo/Examples/Samples/BackgroundTest/BackgroundTest.cs
  83. 122 0
      Demo/Examples/Samples/BackgroundTest/BackgroundTest.csproj
  84. 36 0
      Demo/Examples/Samples/BackgroundTest/Properties/AssemblyInfo.cs
  85. 4 0
      Demo/Examples/Samples/BackgroundTest/packages.config
  86. 6 0
      Demo/Examples/Samples/BatesTest/App.config
  87. 190 0
      Demo/Examples/Samples/BatesTest/BatesTest.cs
  88. 78 0
      Demo/Examples/Samples/BatesTest/BatesTest.csproj
  89. 37 0
      Demo/Examples/Samples/BatesTest/LicenseKey.cs
  90. 36 0
      Demo/Examples/Samples/BatesTest/Properties/AssemblyInfo.cs
  91. 2 2
      Demo/Examples/license_key_win.xml
  92. 4 0
      Demo/Examples/Samples/BatesTest/packages.config
  93. 6 0
      Demo/Examples/Samples/BookmarkTest/App.config
  94. 159 0
      Demo/Examples/Samples/BookmarkTest/BookmarkTest.cs
  95. 86 0
      Demo/Examples/Samples/BookmarkTest/BookmarkTest.csproj
  96. 36 0
      Demo/Examples/Samples/BookmarkTest/Properties/AssemblyInfo.cs
  97. 4 0
      Demo/Examples/Samples/BookmarkTest/packages.config
  98. 6 0
      Demo/Examples/Samples/DocumentCompare/App.config
  99. 89 0
      Demo/Examples/Samples/DocumentCompare/DocumentCompare.cs
  100. 0 0
      Demo/Examples/Samples/DocumentCompare/DocumentCompareTest.csproj

+ 3 - 0
.gitignore

@@ -394,3 +394,6 @@ FodyWeavers.xsd
 
 # JetBrains Rider
 *.sln.iml
+
+#Output
+Output/

+ 2 - 1
Demo/Examples/Annotations/Annotations.csproj

@@ -103,6 +103,7 @@
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
     <None Include="..\TestFile\PDF32000_2008.pdf">
+      <Link>PDF32000_2008.pdf</Link>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="packages.config" />
@@ -116,7 +117,7 @@
   </ItemGroup>
   <ItemGroup>
     <Resource Include="ComPDFKit_Logo.ico" />
-    <Content Include="..\license_key_win.xml">
+    <Content Include="..\license_key_windows.xml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
   </ItemGroup>

+ 2 - 26
Demo/Examples/Annotations/App.xaml.cs

@@ -1,4 +1,5 @@
 using ComPDFKit.NativeMethod;
+using Compdfkit_Tools.Helper;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -12,29 +13,6 @@ using static ComPDFKit.NativeMethod.CPDFSDKVerifier;
 
 namespace annotation_ctrl_demo
 {
-    public class SDKLicenseHelper
-    {
-        public string key = string.Empty;
-        public string secret = string.Empty;
-        public SDKLicenseHelper()
-        {
-
-            string sdkLicensePath = "license_key_win.xml";
-            Assembly assembly = Assembly.GetExecutingAssembly();
-            XmlDocument xmlDocument = new XmlDocument();
-            xmlDocument.Load(sdkLicensePath);
-            var node = xmlDocument.SelectSingleNode("License");
-            if (node != null)
-            {
-                key = node.Attributes["key"].Value;
-                secret = node.Attributes["secret"].Value;
-            }
-        }
-
-    }
-    /// <summary>
-    /// App.xaml 的交互逻辑
-    /// </summary>
     public partial class App : Application
     {
         protected override void OnStartup(StartupEventArgs e)
@@ -46,9 +24,7 @@ namespace annotation_ctrl_demo
 
         private static bool LicenseVerify()
         {
-            bool result = false;
-
-            result = CPDFSDKVerifier.LoadNativeLibrary();
+            bool result = LoadNativeLibrary();
             if (!result)
                 return false;
             SDKLicenseHelper sdkLicenseHelper = new SDKLicenseHelper();

+ 77 - 29
Demo/Examples/Annotations/MainWindow.xaml

@@ -8,7 +8,7 @@
         xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common;assembly=Compdfkit_Tools"
         mc:Ignorable="d"
         Loaded="MainWindow_Loaded"
-        Title="Annotations_ComPDFKit" Height="720" Width="1080"  WindowStartupLocation="CenterScreen">
+        Title="Annotations_ComPDFKit V1.9.1" Height="720" Width="1080"  WindowStartupLocation="CenterScreen">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
@@ -16,8 +16,78 @@
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
             </ResourceDictionary.MergedDictionaries>
+            <!-- Shortcut -->
+            <RoutedUICommand x:Key="Open" Text="Open"/>
+            <RoutedUICommand x:Key="Save" Text="Right rotate"/>
+            <RoutedUICommand x:Key="SaveAs" Text="Delete"/>
+            <RoutedUICommand x:Key="Undo" Text="Undo"/>
+            <RoutedUICommand x:Key="Redo" Text="Redo"/>
+            <RoutedUICommand x:Key="ControlLeftPanel" Text="Control left panel"/>
+            <RoutedUICommand x:Key="ControlRightPanel" Text="Control right panel"/>
+            <RoutedUICommand x:Key="GoToBookmark" Text="Go to bookmark"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToOutline" Text="Go to outline"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToThumbnail" Text="Go to thumbnail"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToAnnotationList" Text="Go to annotation list"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToSearch" Text="Go to search"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleAdd" Text="Scale add"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleSubtract" Text="Scale reduce"></RoutedUICommand>
+            <RoutedUICommand x:Key="DisplaySettings" Text="Display settings"></RoutedUICommand>
+            <RoutedUICommand x:Key="DocumentInfo" Text="Document infomation"></RoutedUICommand>
+            <RoutedUICommand x:Key="Highlight" Text="Highlight"></RoutedUICommand>
+            <RoutedUICommand x:Key="Underline" Text="Underline"></RoutedUICommand>
+            <RoutedUICommand x:Key="Strikeout" Text="Strikeout"></RoutedUICommand>
+            <RoutedUICommand x:Key="Squiggly" Text="Squiggly"></RoutedUICommand>
         </ResourceDictionary>
     </Window.Resources>
+ 
+    
+    
+    <Window.CommandBindings>
+        <CommandBinding Command="{StaticResource Open}" Executed="CommandBinding_Executed_Open"/>
+        <CommandBinding Command="{StaticResource Save}" Executed="CommandBinding_Executed_Save"/>
+        <CommandBinding Command="{StaticResource SaveAs}" Executed="CommandBinding_Executed_SaveAs"/>
+        <CommandBinding Command="{StaticResource Undo}" Executed="CommandBinding_Executed_Undo"/>
+        <CommandBinding Command="{StaticResource Redo}" Executed="CommandBinding_Executed_Redo"/>
+        <CommandBinding Command="{StaticResource ControlLeftPanel}" Executed="CommandBinding_Executed_ControlLeftPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource ControlRightPanel}" Executed="CommandBinding_Executed_ControlRightPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToBookmark}" Executed="CommandBinding_Executed_Bookmark"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToOutline}" Executed="CommandBinding_Executed_Outline"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToThumbnail}" Executed="CommandBinding_Executed_Thumbnail"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToAnnotationList}" Executed="CommandBinding_Executed_Annotation"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToSearch}" Executed="CommandBinding_Executed_Search"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleAdd}" Executed="CommandBinding_Executed_ScaleAdd"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleSubtract}" Executed="CommandBinding_Executed_ScaleSubtract"></CommandBinding>
+        <CommandBinding Command="{StaticResource DisplaySettings}" Executed="CommandBinding_Executed_DisplaySettings"></CommandBinding>
+        <CommandBinding Command="{StaticResource DocumentInfo}" Executed="CommandBinding_Executed_DocumentInfo"></CommandBinding>
+        <CommandBinding Command="{StaticResource Highlight}" Executed="CommandBinding_Executed_Highlight"></CommandBinding>
+        <CommandBinding Command="{StaticResource Underline}" Executed="CommandBinding_Executed_Underline"></CommandBinding>
+        <CommandBinding Command="{StaticResource Strikeout}" Executed="CommandBinding_Executed_Strikeout"></CommandBinding>
+        <CommandBinding Command="{StaticResource Squiggly}" Executed="CommandBinding_Executed_Squiggly"></CommandBinding>
+    </Window.CommandBindings>
+
+    <Window.InputBindings>
+        <KeyBinding Key="O" Modifiers="Control" Command="{StaticResource Open}"/>
+        <KeyBinding Key="S" Modifiers="Control" Command="{StaticResource Save}"/>
+        <KeyBinding Key="S" Modifiers="Control+Shift" Command="{StaticResource SaveAs}"/>
+        <KeyBinding Key="Z" Modifiers="Control" Command="{StaticResource Undo}"/>
+        <KeyBinding Key="Y" Modifiers="Control" Command="{StaticResource Redo}"/>
+        <KeyBinding Key="F4" Command="{StaticResource ControlLeftPanel}"/>
+        <KeyBinding Key="F4" Modifiers="Control" Command="{StaticResource ControlRightPanel}"/>
+        <KeyBinding Key="B" Modifiers="Control" Command="{StaticResource GoToBookmark}"></KeyBinding>
+        <KeyBinding Key="O" Modifiers="Control+Shift" Command="{StaticResource GoToOutline}"></KeyBinding>
+        <KeyBinding Key="T" Modifiers="Control" Command="{StaticResource GoToThumbnail}"></KeyBinding>
+        <KeyBinding Key="A" Modifiers="Control" Command="{StaticResource GoToAnnotationList}"></KeyBinding>
+        <KeyBinding Key="F" Modifiers="Control" Command="{StaticResource GoToSearch}"></KeyBinding>
+        <KeyBinding Key="Add" Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
+        <KeyBinding Key="Subtract" Modifiers="Control" Command="{StaticResource ScaleSubtract}"></KeyBinding>
+        <KeyBinding Key="D" Modifiers="Control" Command="{StaticResource DisplaySettings}"></KeyBinding>
+        <KeyBinding Key="I" Modifiers="Control" Command="{StaticResource DocumentInfo}"></KeyBinding>
+        <KeyBinding Key="H" Modifiers="Control+Alt" Command="{StaticResource Highlight}"></KeyBinding>
+        <KeyBinding Key="U" Modifiers="Control+Alt" Command="{StaticResource Underline}"></KeyBinding>
+        <KeyBinding Key="Q" Modifiers="Control+Alt" Command="{StaticResource Squiggly}"></KeyBinding>
+        <KeyBinding Key="S" Modifiers="Control+Alt" Command="{StaticResource Strikeout}"></KeyBinding>
+    </Window.InputBindings>
+
     <Grid>
         <Grid>
             <Grid.RowDefinitions>
@@ -79,8 +149,8 @@
                             <ToolTip Content="Save"></ToolTip>
                         </Button.ToolTip>
                     </Button>
- 
-                    <ToggleButton Name="ToolExpandBtn" Margin="13,0,0,0" BorderThickness="0" Width="30" Height="30" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="ToolExpand_Click">
+
+                    <ToggleButton Name="LeftToolPanelButton" Margin="13,0,0,0" BorderThickness="0" Width="30" Height="30" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="LeftToolPanelButton_Click">
                         <ToggleButton.Content>
                             <Path Fill="#43474D" Width="30" Height="30">
                                 <Path.Data>
@@ -119,8 +189,8 @@
 
                     <cpdftools:CPDFScalingControl x:Name="CPDFSaclingControl"></cpdftools:CPDFScalingControl>
                 </StackPanel>
- 
-                <ComboBox Style="{StaticResource ComboBoxStyle1}" Width="120" Height="26" Grid.Column="1" HorizontalAlignment="Center" FontSize="14" Foreground="#001A4E" SelectionChanged="ComboBox_SelectionChanged">
+
+                <ComboBox Name="ModeComboBox" Style="{StaticResource ComboBoxStyle1}" Width="120" Height="26" Grid.Column="1" HorizontalAlignment="Center" FontSize="14" Foreground="#001A4E" SelectionChanged="ComboBox_SelectionChanged">
                     <ComboBoxItem IsSelected="True" Tag="Viewer">Viewer</ComboBoxItem>
                     <ComboBoxItem IsSelected="True" Tag="Annotation">Annotation</ComboBoxItem>
                 </ComboBox>
@@ -144,7 +214,7 @@
                         </Button.ToolTip>
                     </Button>
 
-                    <ToggleButton  x:Name="AnnotationBarBtn" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="AnnotationBarControl_Click">
+                    <ToggleButton  x:Name="RightPanelButton" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="RightPanelButton_Click">
                         <ToggleButton.Content>
                             <Path Fill="#43474D" Width="30" Height="30">
                                 <Path.Data>
@@ -307,30 +377,8 @@
 
         <Border Name="PopupBorder" Background="#A0000000" Visibility="Collapsed">
             <Grid>
- 
-                <Grid Name="FileInfoUI"  Width="422" Height="680" HorizontalAlignment="Center" VerticalAlignment="Center" Background="White" Visibility="Collapsed">
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                    </Grid.ColumnDefinitions>
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="auto"></RowDefinition>
-                        <RowDefinition Height="*"></RowDefinition>
-                    </Grid.RowDefinitions>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
-                    <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
-                        <Button.Content>
-                            <Path Fill="Black">
-                                <Path.Data>
-                                    M6.69495 6L11.5 1.19495L10.805 0.5L6 5.30505L1.19495 0.5L0.5 1.19495L5.30505 6L0.5 10.805L1.19495 11.5L6 6.69495L10.805 11.5L11.5 10.805L6.69495 6Z
-                                </Path.Data>
-                            </Path>
-                        </Button.Content>
-                    </Button>
-                    <cpdftools:CPDFInfoControl Grid.Row="1" Margin="25,10,25,0" Grid.ColumnSpan="2" Name="FileInfoControl"></cpdftools:CPDFInfoControl>
-                </Grid>
- 
+                <cpdftools:CPDFInfoControl x:Name="CPDFInfoControl" Visibility="Collapsed"></cpdftools:CPDFInfoControl>
                 <cpdfcommon:PasswordDialog x:Name="PasswordUI" Visibility="Collapsed"></cpdfcommon:PasswordDialog>
             </Grid>
 

+ 222 - 28
Demo/Examples/Annotations/MainWindow.xaml.cs

@@ -188,6 +188,7 @@ namespace Annotations
                     PasswordUI.ClearPassword();
                     PasswordUI.Visibility = Visibility.Collapsed;
                     PopupBorder.Visibility = Visibility.Collapsed;
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                 }
@@ -221,7 +222,7 @@ namespace Annotations
             PropertyContainer.Visibility = visible;
             if (visible == Visibility.Collapsed || visible == Visibility.Hidden)
             {
-                AnnotationBarBtn.IsChecked = false;
+                RightPanelButton.IsChecked = false;
             }
         }
 
@@ -294,8 +295,7 @@ namespace Annotations
                                     pdfViewControl.PDFView.SetMouseMode(MouseModes.AnnotCreate);
                                     pdfViewControl.PDFView.SetToolParam(highLightArgs);
                                     pdfViewControl.PDFView.SetMouseMode(oldMode);
-                                }
-
+                                } 
                             };
 
                             e.PopupMenu.Items.Add(highLightMenu);
@@ -601,36 +601,39 @@ namespace Annotations
             return standardZoom / 100;
         }
 
-        private void ToolExpand_Click(object sender, RoutedEventArgs e)
+        private void ControlLeftPanel()
         {
-            ToggleButton expandBtn = sender as ToggleButton;
-            if (expandBtn != null)
+            if (LeftToolPanelButton != null)
             {
-                bool isExpand = expandBtn.IsChecked == true;
+                bool isExpand = LeftToolPanelButton.IsChecked == true;
                 ExpandLeftPanel(isExpand);
             }
         }
 
+        private void LeftToolPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlLeftPanel();
+        }
+
         private void ExpandSearchBtn_Click(object sender, RoutedEventArgs e)
         {
             ExpandLeftPanel(true);
             BotaSideTool.SelectBotaTool(BOTATools.Search);
         }
 
-        private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
+        private void ShowViewSettings()
         {
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
+            if (ViewSettingBtn != null)
             {
-                if (toggleButton.IsChecked == true)
+                if (ViewSettingBtn.IsChecked == true)
                 {
                     CPDFDisplaySettingsControl displayPanel = new CPDFDisplaySettingsControl();
                     displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
                     PropertyContainer.Child = displayPanel;
                     PropertyContainer.Visibility = Visibility.Visible;
-                    if ((bool)AnnotationBarBtn.IsChecked)
+                    if ((bool)RightPanelButton.IsChecked)
                     {
-                        AnnotationBarBtn.IsChecked = false;
+                        RightPanelButton.IsChecked = false;
                     }
                 }
                 else
@@ -641,20 +644,26 @@ namespace Annotations
             }
         }
 
+        private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
+        {
+            ShowViewSettings();
+        }
+
         private void PageInfoBtn_Click(object sender, RoutedEventArgs e)
         {
             PasswordUI.Visibility = Visibility.Collapsed;
-            FileInfoUI.Visibility = Visibility.Visible;
-            FileInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.Visibility = Visibility.Visible;
+            CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+            CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
             PopupBorder.Visibility = Visibility.Visible;
         }
 
-        private void FileInfoCloseBtn_Click(object sender, RoutedEventArgs e)
+        private void CPDFInfoControl_CloseInfoEvent(object sender, EventArgs e)
         {
             PopupBorder.Visibility = Visibility.Collapsed;
         }
-
-        private void OpenFile_Click(object sender, RoutedEventArgs e)
+        private void OpenFile()
         {
             string filePath = CommonHelper.GetFilePathOrEmpty();
             if (!string.IsNullOrEmpty(filePath) && pdfViewControl != null)
@@ -685,24 +694,29 @@ namespace Annotations
                 }
                 else
                 {
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                 }
             }
         }
 
+        private void OpenFile_Click(object sender, RoutedEventArgs e)
+        {
+            OpenFile();
+        }
+
         private void SaveFileBtn_Click(object sender, RoutedEventArgs e)
         {
             SaveFile();
             pdfViewControl.PDFView.UndoManager.CanSave = false;
         }
 
-        private void AnnotationBarControl_Click(object sender, RoutedEventArgs e)
-        {
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
+        private void ControlRightPanel()
+        { 
+            if (RightPanelButton != null)
             {
-                if (toggleButton.IsChecked == true)
+                if (RightPanelButton.IsChecked == true)
                 {
                     if (pdfAnnotationControl != null)
                     {
@@ -720,6 +734,11 @@ namespace Annotations
             }
         }
 
+        private void RightPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlRightPanel();
+        }
+
         private void EditLink_Click(object sender, RoutedEventArgs e)
         {
             PropertyContainer.Visibility = Visibility.Visible;
@@ -762,7 +781,7 @@ namespace Annotations
         {
             pdfAnnotationControl.AnnotationCancel();
             ExpandRightPropertyPanel(null, Visibility.Collapsed);
-            AnnotationBarBtn.IsChecked = false;
+            RightPanelButton.IsChecked = false;
             ViewSettingBtn.IsChecked = false;
         }
 
@@ -772,7 +791,7 @@ namespace Annotations
             if (e != CPDFAnnotationType.Audio && e != CPDFAnnotationType.Image)
             {
                 ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
-                AnnotationBarBtn.IsChecked = true;
+                RightPanelButton.IsChecked = true;
             }
         }
 
@@ -788,8 +807,7 @@ namespace Annotations
         }
 
         private void PdfViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
-        {
-
+        { 
             if (e.Key == "Zoom")
             {
                 CPDFSaclingControl.SetZoomTextBoxText(string.Format("{0}", (int)((double)e.Value * 100)));
@@ -798,6 +816,31 @@ namespace Annotations
         #endregion
 
         #region Save file
+        /// <summary>
+        /// Save the file to another PDF file.
+        /// </summary>
+        public void SaveAsFile()
+        {
+            {
+                if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
+                {
+                    CPDFDocument pdfDoc = pdfViewControl.PDFView.Document;
+                    SaveFileDialog saveDialog = new SaveFileDialog();
+                    saveDialog.Filter = "(*.pdf)|*.pdf";
+                    saveDialog.DefaultExt = ".pdf";
+                    saveDialog.OverwritePrompt = true;
+
+                    if (saveDialog.ShowDialog() == true)
+                    {
+                        pdfDoc.WriteToFilePath(saveDialog.FileName);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Save the file in the current path.
+        /// </summary>
         private void SaveFile()
         {
             if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
@@ -840,7 +883,7 @@ namespace Annotations
                 ToolBarContainer.Visibility = Visibility.Collapsed;
                 ExpandRightPropertyPanel(null, Visibility.Collapsed);
                 pdfAnnotationControl.AnnotationCancel();
-                AnnotationBarBtn.IsChecked = false;
+                RightPanelButton.IsChecked = false;
                 if (pdfViewControl != null && pdfViewControl.PDFView != null)
                 {
                     pdfViewControl.PDFView.SetMouseMode(MouseModes.Viewer);
@@ -881,5 +924,156 @@ namespace Annotations
         }
 
         #endregion
+
+        #region Shortcut
+        private void CommandBinding_Executed_Open(object sender, ExecutedRoutedEventArgs e)
+        {
+            OpenFile();
+        }
+
+        private void CommandBinding_Executed_Save(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (CanSave)
+            {
+                SaveFile();
+            }
+        }
+
+        private void CommandBinding_Executed_SaveAs(object sender, ExecutedRoutedEventArgs e)
+        {
+            SaveAsFile();
+        }
+
+        private void CommandBinding_Executed_Undo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (pdfViewControl != null && pdfViewControl.PDFView != null && CanUndo)
+            {
+                pdfViewControl.PDFView.UndoManager?.Undo();
+            }
+        }
+
+        private void CommandBinding_Executed_Redo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (pdfViewControl != null && pdfViewControl.PDFView != null && CanRedo)
+            {
+                pdfViewControl.PDFView.UndoManager?.Redo();
+            }
+        }
+
+        private void CommandBinding_Executed_ControlLeftPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            LeftToolPanelButton.IsChecked = !LeftToolPanelButton.IsChecked;
+            ControlLeftPanel();
+        }
+
+        private void CommandBinding_Executed_ControlRightPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            RightPanelButton.IsChecked = !RightPanelButton.IsChecked;
+            ControlRightPanel();
+        }
+
+        private void CommandBinding_Executed_Highlight(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (ModeComboBox.SelectedIndex == 1)
+            {
+                AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Highlight);
+            }
+        }
+
+        private void CommandBinding_Executed_Underline(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (ModeComboBox.SelectedIndex == 1)
+            {
+                AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Underline);
+            }
+        }
+
+        private void CommandBinding_Executed_Strikeout(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (ModeComboBox.SelectedIndex == 1)
+            {
+                AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Strikeout);
+            }
+        }
+
+        private void CommandBinding_Executed_Squiggly(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (ModeComboBox.SelectedIndex == 1)
+            {
+                AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Squiggly);
+            }
+        }
+
+        private void CommandBinding_Executed_Bookmark(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Bookmark);
+        }
+
+        private void CommandBinding_Executed_Outline(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Outline);
+        }
+
+        private void CommandBinding_Executed_Thumbnail(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Thumbnail);
+        }
+
+        private void CommandBinding_Executed_Annotation(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Annotation);
+        }
+
+        private void CommandBinding_Executed_Search(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Search);
+        }
+
+        private void CommandBinding_Executed_ScaleAdd(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor + 0.01, true);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_ScaleSubtract(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor - 0.01, false);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_DisplaySettings(object sender, ExecutedRoutedEventArgs e)
+        {
+            ViewSettingBtn.IsChecked = !ViewSettingBtn.IsChecked;
+            ShowViewSettings();
+        }
+
+        private void CommandBinding_Executed_DocumentInfo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (PopupBorder.Visibility != Visibility.Visible)
+            {
+                PasswordUI.Visibility = Visibility.Collapsed;
+                CPDFInfoControl.Visibility = Visibility.Visible;
+                CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+                CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+                CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
+                PopupBorder.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                CPDFInfoControl.Visibility = Visibility.Collapsed;
+                PopupBorder.Visibility = Visibility.Collapsed;
+            }
+        }
+        #endregion
     }
 }

+ 8 - 38
Demo/Examples/Annotations/Properties/AssemblyInfo.cs

@@ -3,10 +3,7 @@ using System.Resources;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Windows;
-
-// 有关程序集的一般信息由以下
-// 控制。更改这些特性值可修改
-// 与程序集关联的信息。
+ 
 [assembly: AssemblyTitle("Annotations_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
@@ -15,41 +12,14 @@ using System.Windows;
 [assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
-
-// 将 ComVisible 设置为 false 会使此程序集中的类型
-//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
-//请将此类型的 ComVisible 特性设置为 true。
+ 
 [assembly: ComVisible(false)]
-
-//若要开始生成可本地化的应用程序,请设置
-//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
-//例如,如果您在源文件中使用的是美国英语,
-//使用的是美国英语,请将 <UICulture> 设置为 en-US。  然后取消
-//对以下 NeutralResourceLanguage 特性的注释。  更新
-//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
+ 
 
 [assembly: ThemeInfo(
-    ResourceDictionaryLocation.None, //主题特定资源词典所处位置
-                                     //(未在页面中找到资源时使用,
-                                     //或应用程序资源字典中找到时使用)
-    ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
-                                              //(未在页面中找到资源时使用,
-                                              //、应用程序或任何主题专用资源字典中找到时使用)
+    ResourceDictionaryLocation.None,  
+    ResourceDictionaryLocation.SourceAssembly  
 )]
-
-
-// 程序集的版本信息由下列四个值组成: 
-//
-//      主版本
-//      次版本
-//      生成号
-//      修订号
-//
-//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
-//通过使用 "*",如下所示:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.9.0.0")]
-[assembly: AssemblyFileVersion("1.9.0.0")]
+ 
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 5 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/CPDFAnnoationListUI.xaml.cs

@@ -170,7 +170,11 @@ namespace Compdfkit_Tools.PDFControlUI
         {
             if (enableSelectEvent)
             {
-                AnnotationSelectionChanged?.Invoke(this, (e.AddedItems[0] as AnnotationBindData).BindProperty);
+                try
+                {
+                    AnnotationSelectionChanged?.Invoke(this, (e.AddedItems[0] as AnnotationBindData).BindProperty);
+                }
+                catch { }
             }
         }
 

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml

@@ -9,7 +9,7 @@
              Unloaded="AnnotationControl_Unloaded"
              d:DesignHeight="800" d:DesignWidth="300">
     <Grid>
-            <Border x:Name="AnnotationPanelContainer" Background="#FFFFFF"></Border>
+        <Border x:Name="AnnotationPanelContainer" Background="#FAFCFF"></Border>
         <TextBlock x:Name="EmptyMessage" Text="The property panel is empty." VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
     </Grid>
 </UserControl>

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFCreateSignatureDialog.xaml

@@ -10,7 +10,7 @@
         AllowsTransparency="True" 
         WindowStyle="None"
         Loaded="Window_Loaded"
-        Title="CreateSignatureDialog" Height="422" Width="626">
+        Title="CreateSignatureDialog" Height="422" Width="626" BorderThickness="1" BorderBrush="Black">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>

+ 2 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFCreateStampDialog.xaml

@@ -10,7 +10,8 @@
         ShowInTaskbar="False"
         ResizeMode="NoResize"
         Loaded="Window_Loaded"
-        Title="CreateStampDialog" Height="357" Width="626">
+        Title="CreateStampDialog" Height="357" Width="626"
+        BorderBrush="Black" BorderThickness="1"> 
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFDeleteDialog.xaml

@@ -8,7 +8,7 @@
         AllowsTransparency="True" 
         WindowStyle="None"
         Loaded="Window_Loaded"
-        Title="DeleteDialog" Height="146" Width="318">
+        Title="DeleteDialog" Height="146" Width="318" BorderBrush="Black" BorderThickness="1">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>

+ 1 - 0
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFFreeTextUI.xaml.cs

@@ -24,6 +24,7 @@ namespace Compdfkit_Tools.PDFControlUI
             CPDFFontControl.FontAlignChanged += CPDFFontControl_FontAlignChanged;
             CPDFFontControl.FontSizeChanged += CPDFFontControl_FontSizeChanged;
             CPDFAnnotationPreviewerControl.DrawFreeTextPreview(GetFreeTextData());
+            ColorPickerControl.SetCheckedForColor(GetFreeTextData().BorderColor);
         }
 
         private void CPDFFontControl_FontSizeChanged(object sender, EventArgs e)

+ 10 - 2
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFFreehandUI.xaml.cs

@@ -21,8 +21,10 @@ namespace Compdfkit_Tools.PDFControlUI
             ColorPickerControl.ColorChanged += ColorPickerControl_ColorChanged;
             CPDFOpacityControl.OpacityChanged += CPDFOpacityControl_OpacityChanged;
             CPDFThicknessControl.ThicknessChanged += CPDFThicknessControl_ThicknessChanged;
-            CPDFAnnotationPreviewerControl.DrawFreehandPreview(GetFreehandData());
             EraseThickness.ThicknessChanged += EraseThickness_ThicknessChanged;
+
+            CPDFAnnotationPreviewerControl.DrawFreehandPreview(GetFreehandData());
+            ColorPickerControl.SetCheckedForColor(GetFreehandData().BorderColor);
         }
 
         private void EraseThickness_ThicknessChanged(object sender, EventArgs e)
@@ -99,12 +101,18 @@ namespace Compdfkit_Tools.PDFControlUI
             CPDFThicknessControl.Thickness =Convert.ToInt16(annotAttribEvent.Attribs[AnnotAttrib.Thickness]);
             if(annotAttribEvent.Attribs.ContainsKey(AnnotAttrib.Color))
             {
-                ColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+                ColorPickerControl.Loaded += ColorPickerControl_Loaded;
             }
             NoteTextBox.Text = (string)annotAttribEvent.Attribs[AnnotAttrib.NoteText];
             this.annotAttribEvent = annotAttribEvent;
         }
 
+        private void ColorPickerControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            ColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+            ColorPickerControl.Loaded -= ColorPickerControl_Loaded;
+        }
+
         public CPDFFreehandData GetFreehandData()
         {
             CPDFFreehandData pdfFreehandData = new CPDFFreehandData();

+ 45 - 33
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFLinkUI.xaml

@@ -419,37 +419,49 @@
             </Setter>
         </Style>
     </UserControl.Resources>
-    <ScrollViewer VerticalScrollBarVisibility="Auto">
-        <Grid Background="#FFFFFF">
-            <Grid.RowDefinitions>
-                <RowDefinition Height="100"/>
-                <RowDefinition Height="*"/>
-            </Grid.RowDefinitions>
-            <TabControl x:Name="HeadTabControl" Style="{DynamicResource TabControlStyle1}">
-                <TabItem Style="{DynamicResource TabItemStyle1}" Header="Hyperlink">
-                    <Grid IsEnabled="{Binding InputEnable}">
-                        <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28"  x:Name="UrlText" VerticalContentAlignment="Center" TextChanged="UrlText_TextChanged" VerticalAlignment="Center" Margin="16"/>
-                        <TextBlock Text="https://www.compdf.com/" VerticalAlignment="Center"  Margin="22" Visibility="{Binding ElementName=UrlText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False"  Foreground="#BBB"></TextBlock>
-                    </Grid>
-                </TabItem>
-                <TabItem Style="{DynamicResource TabItemStyle1}" Header="Go To Pages">
-                    <Grid IsEnabled="{Binding InputEnable}">
-                        <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28"  x:Name="PageText" VerticalContentAlignment="Center" TextChanged="PageText_TextChanged" VerticalAlignment="Center" Margin="16,0,16,0" Grid.ColumnSpan="2"/>
-                        <TextBlock Text="{Binding PagePromptText, Mode=OneWay}" VerticalAlignment="Center"  Margin="22,0,22,0" Visibility="{Binding ElementName=PageText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False"  Foreground="#BBB"></TextBlock>
-                    </Grid>
-                </TabItem>
-                <TabItem Style="{DynamicResource TabItemStyle1}" Header="Email">
-                    <Grid IsEnabled="{Binding InputEnable}">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="79*"/>
-                            <ColumnDefinition Width="319*"/>
-                        </Grid.ColumnDefinitions>
-                        <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28" x:Name="EmailText" VerticalContentAlignment="Center"  TextChanged="EmailText_TextChanged" VerticalAlignment="Center" Margin="16,0,16,0" Grid.ColumnSpan="2"/>
-                        <TextBlock Text="support@compdf.com" VerticalAlignment="Center"  Margin="22,0,22,0" Visibility="{Binding ElementName=EmailText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False"  Foreground="#BBB" Grid.ColumnSpan="2"></TextBlock>
-                    </Grid>
-                </TabItem>
-            </TabControl>
-            <Button Style="{DynamicResource ButtonStyle1}" x:Name="SaveBtn"  Background="#001A4E" Width="120" Height="32" Grid.Row="1" Foreground="#FFFFFF" Content="Save" VerticalAlignment="Top" Click="Save_Click" IsEnabled="False"/>
-        </Grid>
-    </ScrollViewer>
+
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Border BorderThickness="1" BorderBrush="#1A000000">
+            <Grid  Height="40" Background="White" >
+                <TextBlock x:Name="TitleTextBlock" Text="Link"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+            </Grid>
+        </Border>
+        <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1">
+            <Grid  Background="#FFFFFF">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="100"/>
+                    <RowDefinition Height="*"/>
+                </Grid.RowDefinitions>
+                <TabControl x:Name="HeadTabControl" Style="{DynamicResource TabControlStyle1}">
+                    <TabItem Style="{DynamicResource TabItemStyle1}" Header="Hyperlink">
+                        <Grid IsEnabled="{Binding InputEnable}">
+                            <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28"  x:Name="UrlText" VerticalContentAlignment="Center" TextChanged="UrlText_TextChanged" VerticalAlignment="Center" Margin="16"/>
+                            <TextBlock Text="https://www.compdf.com/" VerticalAlignment="Center"  Margin="22" Visibility="{Binding ElementName=UrlText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False"  Foreground="#BBB"></TextBlock>
+                        </Grid>
+                    </TabItem>
+                    <TabItem Style="{DynamicResource TabItemStyle1}" Header="Go To Pages">
+                        <Grid IsEnabled="{Binding InputEnable}">
+                            <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28"  x:Name="PageText" VerticalContentAlignment="Center" TextChanged="PageText_TextChanged" VerticalAlignment="Center" Margin="16,0,16,0" Grid.ColumnSpan="2"/>
+                            <TextBlock Text="{Binding PagePromptText, Mode=OneWay}" VerticalAlignment="Center"  Margin="22,0,22,0" Visibility="{Binding ElementName=PageText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False"  Foreground="#BBB"></TextBlock>
+                        </Grid>
+                    </TabItem>
+                    <TabItem Style="{DynamicResource TabItemStyle1}" Header="Email">
+                        <Grid IsEnabled="{Binding InputEnable}">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="79*"/>
+                                <ColumnDefinition Width="319*"/>
+                            </Grid.ColumnDefinitions>
+                            <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28" x:Name="EmailText" VerticalContentAlignment="Center"  TextChanged="EmailText_TextChanged" VerticalAlignment="Center" Margin="16,0,16,0" Grid.ColumnSpan="2"/>
+                            <TextBlock Text="support@compdf.com" VerticalAlignment="Center"  Margin="22,0,22,0" Visibility="{Binding ElementName=EmailText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False"  Foreground="#BBB" Grid.ColumnSpan="2"></TextBlock>
+                        </Grid>
+                    </TabItem>
+                </TabControl>
+                <Button Style="{DynamicResource ButtonStyle1}" x:Name="SaveBtn"  Background="#001A4E" Width="120" Height="32" Grid.Row="1" Foreground="#FFFFFF" Content="Save" VerticalAlignment="Top" Click="Save_Click" IsEnabled="False"/>
+            </Grid>
+        </ScrollViewer>
+    </Grid>
 </UserControl>

+ 10 - 2
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFMarkupUI.xaml.cs

@@ -19,6 +19,7 @@ namespace Compdfkit_Tools.PDFControlUI
             InitializeComponent();
             ColorPickerControl.ColorChanged += ColorPickerControl_ColorChanged;
             CPDFOpacityControl.OpacityChanged += CPDFOpacityControl_OpacityChanged;
+            ColorPickerControl.SetCheckedForColor(GetMarkupData().Color);
         }
 
         private void CPDFOpacityControl_OpacityChanged(object sender, EventArgs e)
@@ -75,14 +76,21 @@ namespace Compdfkit_Tools.PDFControlUI
         public void SetPresentAnnotAttrib(AnnotAttribEvent annotAttribEvent)
         {
             this.annotAttribEvent = null;
-            ColorPickerControl.Brush = new SolidColorBrush((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
-            ColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+            //ColorPickerControl.Brush = new SolidColorBrush((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+
+            ColorPickerControl.Loaded += ColorPickerControl_Loaded;
             CPDFOpacityControl.OpacityValue = (int)((double)annotAttribEvent.Attribs[AnnotAttrib.Transparency] * 100);
             NoteTextBox.Text = (string)annotAttribEvent.Attribs[AnnotAttrib.NoteText];
             this.annotAttribEvent = annotAttribEvent;
             CPDFAnnotationPreviewerControl.DrawMarkUpPreview(GetMarkupData());
         }
 
+        private void ColorPickerControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+            ColorPickerControl.Loaded -= ColorPickerControl_Loaded;
+        }
+
         public void InitWithAnnotationType(CPDFAnnotationType annotationType)
         {
             currentAnnotationType = annotationType;

+ 9 - 2
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFNoteUI.xaml.cs

@@ -18,6 +18,7 @@ namespace Compdfkit_Tools.PDFControlUI
             InitializeComponent();
             ColorPickerControl.ColorChanged += ColorPickerControl_ColorChanged;
             CPDFAnnotationPreviewerControl.DrawNotePreview(GetNoteData());
+            ColorPickerControl.SetCheckedForColor(GetNoteData().BorderColor);
         }
 
         private void ColorPickerControl_ColorChanged(object sender, EventArgs e)
@@ -50,16 +51,22 @@ namespace Compdfkit_Tools.PDFControlUI
         public void SetPresentAnnotAttrib(AnnotAttribEvent annotAttribEvent)
         {
             this.annotAttribEvent = null;
-            ColorPickerControl.Brush = new SolidColorBrush((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
             NoteTextBox.Text = (string)annotAttribEvent.Attribs[AnnotAttrib.NoteText];
             this.annotAttribEvent = annotAttribEvent;
 
             if (annotAttribEvent.Attribs != null && annotAttribEvent.Attribs.ContainsKey(AnnotAttrib.Color))
             {
-                ColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+                ColorPickerControl.Loaded += ColorPickerControl_Loaded;
             }
         }
 
+        private void ColorPickerControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+            ColorPickerControl.Loaded -= ColorPickerControl_Loaded;
+
+        }
+
         public CPDFNoteData GetNoteData()
         {
             CPDFNoteData pdfNoteData = new CPDFNoteData();

+ 32 - 6
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFShapeUI.xaml.cs

@@ -27,6 +27,7 @@ namespace Compdfkit_Tools.PDFControlUI
             CPDFLineStyleControl.LineStyleChanged += CPDFLineStyleControl_LineStyleChanged;
 
             CPDFAnnotationPreviewerControl.DrawShapePreview(GetShapeData());
+           
         }
 
         private void BorderColorPickerControl_ColorChanged(object sender, EventArgs e)
@@ -165,14 +166,14 @@ namespace Compdfkit_Tools.PDFControlUI
             CPDFOpacityControl.OpacityValue = (int)((double)annotAttribEvent.Attribs[AnnotAttrib.Transparency] * 100);
             CPDFThicknessControl.Thickness = Convert.ToInt16(annotAttribEvent.Attribs[AnnotAttrib.Thickness]);
             NoteTextBox.Text = (string)annotAttribEvent.Attribs[AnnotAttrib.NoteText];
-            if(annotAttribEvent.Attribs!=null && annotAttribEvent.Attribs.ContainsKey(AnnotAttrib.Color))
+            if (annotAttribEvent.Attribs != null && annotAttribEvent.Attribs.ContainsKey(AnnotAttrib.Color))
             {
-                BorderColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+                BorderColorPickerControl.Loaded += BorderColorPickerControl_Loaded;
             }
 
             if (annotAttribEvent.Attribs != null && annotAttribEvent.Attribs.ContainsKey(AnnotAttrib.FillColor))
             {
-                FillColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.FillColor]);
+                FillColorPickerControl.Loaded += FillColorPickerControl_Loaded;
             }
 
             CPDFLineStyleControl.DashStyle = (DashStyle)(annotAttribEvent.Attribs[AnnotAttrib.LineStyle]);
@@ -189,12 +190,24 @@ namespace Compdfkit_Tools.PDFControlUI
                     HeadLineType = (C_LINE_TYPE)annotAttribEvent.Attribs[AnnotAttrib.LineStart],
                     TailLineType = (C_LINE_TYPE)annotAttribEvent.Attribs[AnnotAttrib.LineEnd]
                 };
-                CPDFArrowControl.LineType = lineType; 
+                CPDFArrowControl.LineType = lineType;
             }
             this.annotAttribEvent = annotAttribEvent;
             CPDFAnnotationPreviewerControl.DrawShapePreview(GetShapeData());
         }
 
+        private void FillColorPickerControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            FillColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.FillColor]);
+            FillColorPickerControl.Loaded -= FillColorPickerControl_Loaded;
+        }
+
+        private void BorderColorPickerControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            BorderColorPickerControl.SetCheckedForColor((Color)annotAttribEvent.Attribs[AnnotAttrib.Color]);
+            BorderColorPickerControl.Loaded -= BorderColorPickerControl_Loaded;
+        }
+
         public void InitWhenRectAndRound()
         {
             FillColorStackPanel.Visibility = Visibility.Visible;
@@ -231,8 +244,7 @@ namespace Compdfkit_Tools.PDFControlUI
             }
             CPDFArrowControl.LineType = lineType;
         }
-
-
+         
         public void InitWithAnnotationType(CPDFAnnotationType annotationType)
         {
             currentAnnotationType = annotationType;
@@ -240,24 +252,38 @@ namespace Compdfkit_Tools.PDFControlUI
             {
                 case CPDFAnnotationType.Square:
                     TitleTextBlock.Text = "Rectangle";
+                    currentAnnotationType = CPDFAnnotationType.Square;
                     InitWhenRectAndRound();
                     break;
                 case CPDFAnnotationType.Circle:
                     TitleTextBlock.Text = "Circle";
+                    currentAnnotationType = CPDFAnnotationType.Circle; 
                     InitWhenRectAndRound();
                     break;
                 case CPDFAnnotationType.Arrow:
                     TitleTextBlock.Text = "Arrow";
+                    currentAnnotationType= CPDFAnnotationType.Arrow;
                     InitWhenArrowAndLine();
                     break;
                 case CPDFAnnotationType.Line:
                     TitleTextBlock.Text = "Line";
+                    currentAnnotationType = CPDFAnnotationType.Line;
                     InitWhenArrowAndLine();
                     break;
                 default:
                     throw new ArgumentException("Not Excepted Argument");
             }
             CPDFAnnotationPreviewerControl.DrawShapePreview(GetShapeData());
+            if (currentAnnotationType == CPDFAnnotationType.Circle || currentAnnotationType == CPDFAnnotationType.Square)
+            {
+                BorderColorPickerControl.SetCheckedForColor((GetShapeData() as CPDFShapeData).BorderColor);
+                FillColorPickerControl.SetCheckedForColor((GetShapeData() as CPDFShapeData).FillColor);
+
+            }
+            else if (currentAnnotationType == CPDFAnnotationType.Line || currentAnnotationType == CPDFAnnotationType.Arrow)
+            {
+                BorderColorPickerControl.SetCheckedForColor((GetShapeData() as CPDFLineShapeData).BorderColor);
+            }
         }
     }
 }

+ 40 - 3
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFAnnotationBarControl.xaml.cs

@@ -1,5 +1,6 @@
 using Compdfkit_Tools.Data;
 using System;
+using System.Collections.Generic;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
@@ -218,9 +219,9 @@ namespace Compdfkit_Tools.PDFControl
                 canvas.Children.Add(path);
             }
 
-            else if (toggleButton.Tag.ToString()==CPDFAnnotationType.Image.ToString())
+            else if (toggleButton.Tag.ToString() == CPDFAnnotationType.Image.ToString())
             {
-              
+
                 annotationGeometry = Geometry.Parse("M18.75,3.25 L18.75,16.75 L1.25,16.75 L1.25,3.25 L18.75,3.25 Z M17.25,4.75 L2.75,4.75 L2.75,13.209 L5.79495643,10 L10.0642824,13.5 L12.3718478,11.0677556 L17.144,15.25 L17.25,15.25 L17.25,4.75 Z M14.5,6 C15.3284271,6 16,6.67157288 16,7.5 C16,8.32842712 15.3284271,9 14.5,9 C13.6715729,9 13,8.32842712 13,7.5 C13,6.67157288 13.6715729,6 14.5,6 Z");
                 Path imagePath = new Path
                 {
@@ -295,7 +296,7 @@ namespace Compdfkit_Tools.PDFControl
                 toggleButton.ToolTip = toggleButton.Tag.ToString();
                 Grid.SetColumn(toggleButton, annotationCounter++);
                 AnnotationGrid.Children.Add(toggleButton);
-            } 
+            }
         }
 
         public void ClearAllToolState()
@@ -336,6 +337,42 @@ namespace Compdfkit_Tools.PDFControl
             }
         }
 
+        private ToggleButton FindToggleButtonByTag(DependencyObject parent, string tag)
+        {
+            var count = VisualTreeHelper.GetChildrenCount(parent);
+
+            for (var i = 0; i < count; i++)
+            {
+                var child = VisualTreeHelper.GetChild(parent, i);
+
+                if (child is ToggleButton toggleButton && toggleButton.Tag != null && toggleButton.Tag.ToString() == tag)
+                {
+                    return toggleButton;
+                }
+                else
+                {
+                    var result = FindToggleButtonByTag(child, tag);
+                    if (result != null)
+                    {
+                        return result;
+                    }
+                }
+            }
+            return null;
+        }
+
+        public void SetAnnotationType(CPDFAnnotationType annotationType)
+        { 
+            ToggleButton toggleButton = FindToggleButtonByTag(this, annotationType.ToString());
+            if (toggleButton != null)
+            {
+                toggleButton.IsChecked = true;
+                ClearToolState(toggleButton);
+                AnnotationPropertyChanged?.Invoke(toggleButton, CPDFAnnotationDictionary.GetAnnotationFromTag[toggleButton.Tag.ToString()]);
+                CurrentMode = toggleButton.Tag.ToString();
+            } 
+        }
+
         public void InitAnnotationBar(CPDFAnnotationType[] annotationProperties)
         {
             for (int i = 0; i < annotationProperties.Length; i++)

+ 3 - 3
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFTitleBarControl.xaml

@@ -22,9 +22,9 @@
                   HorizontalAlignment="Left">
                     
                     <MenuItem Header="File" Style="{StaticResource Dropdown_MenuItem}">
-                        <MenuItem Header="Open File" Name="OpenFileItem" Style="{StaticResource Sub_MenuItem}" Click="OpenFileItem_Click"></MenuItem>
-                        <MenuItem Header="Save File" Style="{StaticResource Sub_MenuItem}"  Click="SaveFileItem_Click" IsEnabled="{Binding CanSave, RelativeSource={RelativeSource AncestorType=UserControl}}"></MenuItem>
-                        <MenuItem Header="Save As" Style="{StaticResource Sub_MenuItem}"  Click="SaveAsItem_Click"></MenuItem>
+                        <MenuItem Header="Open File(Ctrl+O)" Name="OpenFileItem" Style="{StaticResource Sub_MenuItem}" Click="OpenFileItem_Click"></MenuItem>
+                        <MenuItem Header="Save File(Ctrl+S)" Style="{StaticResource Sub_MenuItem}"  Click="SaveFileItem_Click" IsEnabled="{Binding CanSave, RelativeSource={RelativeSource AncestorType=UserControl}}"></MenuItem>
+                        <MenuItem Header="Save As(Ctrl+Shift+S)" Style="{StaticResource Sub_MenuItem}"  Click="SaveAsItem_Click"></MenuItem>
                     </MenuItem>
                     
                     <MenuItem Header="Help" Style="{StaticResource Dropdown_MenuItem}">

+ 27 - 0
Demo/Examples/Compdfkit_Tools/Common/Helper/CommonHelper.cs

@@ -8,9 +8,36 @@ using System.Reflection;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
+using System.Xml;
 
 namespace Compdfkit_Tools.Helper
 {
+    public class SDKLicenseHelper
+    {
+        public string key = string.Empty;
+        public string secret = string.Empty;
+        public SDKLicenseHelper()
+        {
+            string sdkLicensePath = "license_key_windows.xml";
+            XmlDocument xmlDocument = new XmlDocument();
+            xmlDocument.Load(sdkLicensePath);
+
+            XmlNode keyNode = xmlDocument.SelectSingleNode("/license/key");
+            XmlNode secretNode = xmlDocument.SelectSingleNode("/license/secret");
+
+            if (keyNode != null && secretNode != null)
+            {
+                key = keyNode.InnerText;
+                secret = secretNode.InnerText;
+
+            }
+            else
+            {
+                Console.WriteLine("Key or secret element not found in the XML.");
+            }
+        }
+    }
+
     public static class CommonHelper
     {
         /// <summary>

+ 2 - 3
Demo/Examples/Compdfkit_Tools/Common/PropertyControl/ColorPickerControl.xaml.cs

@@ -105,12 +105,11 @@ namespace Compdfkit_Tools.Common
             {
                 return false;
             }
-        }
-
+        }  
 
         public void SetCheckedForColor(Color color)
         {
-            bool Transparent =GetTransparentBtnVisibility();
+            bool Transparent = GetTransparentBtnVisibility();
             List<string> brushes = GetButtonColor();
             int index = brushes.IndexOf(color.ToString());
             if (index < 0)

+ 2 - 2
Demo/Examples/Compdfkit_Tools/Common/PropertyControl/PDFFont/CPDFFontUI.xaml.cs

@@ -157,7 +157,7 @@ namespace Compdfkit_Tools.Common
 
             List<string> fontStyleList = new List<string>()
             {
-                {"Common" },
+                {"Regular" },
                 {"Bold" },
                 {"Italic" },
                 {"Bold and Italic" }
@@ -200,7 +200,7 @@ namespace Compdfkit_Tools.Common
         private void FontStyleComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
             FontStyleTextBox.Text = (sender as ComboBox).SelectedItem.ToString();
-            if (FontStyleTextBox.Text == "Common")
+            if (FontStyleTextBox.Text == "Regular")
             {
                 IsBold = false;
                 IsItalic = false;

+ 7 - 0
Demo/Examples/Compdfkit_Tools/Compdfkit_Tools.csproj

@@ -200,6 +200,9 @@
     <Compile Include="Common\PropertyControl\WritableComboBoxControl.xaml.cs">
       <DependentUpon>WritableComboBoxControl.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Edit\PDFContentEditControl.xaml.cs">
+      <DependentUpon>PDFContentEditControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Edit\PDFImageEdit\PDFImageEditControl\PDFImageEditControl.xaml.cs">
       <DependentUpon>PDFImageEditControl.xaml</DependentUpon>
     </Compile>
@@ -587,6 +590,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Edit\PDFContentEditControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Edit\PDFImageEdit\PDFImageEditControl\PDFImageEditControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 14 - 0
Demo/Examples/Compdfkit_Tools/Edit/PDFContentEditControl.xaml

@@ -0,0 +1,14 @@
+<UserControl x:Class="Compdfkit_Tools.Edit.PDFContentEditControl"
+             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:Compdfkit_Tools.Edit"
+             mc:Ignorable="d" 
+             d:DesignHeight="800" d:DesignWidth="300"
+              Background="#FAFCFF">
+    <Grid>
+        <TextBlock x:Name="EmptyMessage" Text="The property panel is empty." VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
+        <Border x:Name="ContentEditContainer"></Border>
+    </Grid>
+</UserControl>

+ 88 - 0
Demo/Examples/Compdfkit_Tools/Edit/PDFContentEditControl.xaml.cs

@@ -0,0 +1,88 @@
+using ComPDFKitViewer.PdfViewer;
+using ComPDFKitViewer;
+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 Compdfkit_Tools.Edit
+{
+    /// <summary>
+    /// Interaction logic for PDFContentEditControl.xaml
+    /// </summary>
+    public partial class PDFContentEditControl : UserControl
+    {
+        private PDFImageEditControl PDFImageEditControl = new PDFImageEditControl();
+        private PDFTextEditControl PDFTextEditControl = new PDFTextEditControl();
+        private PDFTextEditControl tempPDFTextEditControl = null;
+        private PDFEditEvent editEvent = null;
+
+        public CPDFViewer PDFView { get; private set; }
+        public PDFEditEvent EditEvent { get; set; }
+
+        public PDFContentEditControl()
+        {
+            InitializeComponent();
+        }
+
+        public void InitWithPDFViewer(CPDFViewer newPDFView)
+        {
+            PDFView = newPDFView;
+            PDFImageEditControl.InitWithPDFViewer(newPDFView);
+        }
+
+        public void SetPDFTextEditData(PDFEditEvent editEvent, bool isTemp = false)
+        {
+            if (!isTemp)
+            {
+                PDFTextEditControl.SetPDFTextEditData(editEvent);
+                ContentEditContainer.Child = PDFTextEditControl;
+            }
+            else
+            {
+                tempPDFTextEditControl = new PDFTextEditControl();
+                this.editEvent = editEvent;
+                tempPDFTextEditControl.Loaded += TempPDFTextEditControl_Loaded;
+                ContentEditContainer.Child = tempPDFTextEditControl;
+            }
+        }
+
+        public void ClearPanel()
+        {
+            ContentEditContainer.Child = null;
+            EmptyMessage.Visibility = Visibility.Visible;
+        }
+
+        private void TempPDFTextEditControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            tempPDFTextEditControl.SetPDFTextEditData(editEvent);
+
+        }
+
+        public void ClearContentControl()
+        {
+            ContentEditContainer.Child = null;
+        }
+
+        public void SetPDFImageEditData(PDFEditEvent editEvent)
+        {
+                PDFImageEditControl.SetPDFImageEditData(editEvent);
+                ContentEditContainer.Child = PDFImageEditControl;
+        }
+
+        public void RefreshThumb()
+        {
+            PDFImageEditControl?.SetImageThumb();
+        }
+    }
+}

+ 2 - 1
Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml

@@ -6,7 +6,8 @@
              xmlns:local="clr-namespace:Compdfkit_Tools.Edit"
              xmlns:common="clr-namespace:Compdfkit_Tools.Common"
              mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800" MinWidth="260" Padding="10">
+             d:DesignHeight="450" d:DesignWidth="800" MinWidth="260" Padding="10"
+             Background="#FAFCFF">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>

+ 4 - 5
Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml.cs

@@ -137,7 +137,8 @@ namespace Compdfkit_Tools.Edit
                 {
                     EditEvent.ReplaceImagePath = openFileDialog.FileName;
                     EditEvent.UpdatePDFEditByEventArgs();
-                    EditEvent = null;
+                    // EditEvent = null;
+                    SetImageThumb();
                 }
             }
         }
@@ -213,7 +214,6 @@ namespace Compdfkit_Tools.Edit
                         {
                             Bitmap bitmapImage = imageList[0];
                             MemoryStream memoryStream = new MemoryStream();
-
                             bitmapImage.Save(memoryStream, bitmapImage.RawFormat);
                             BitmapImage imageShow = new BitmapImage();
                             imageShow.BeginInit();
@@ -222,8 +222,7 @@ namespace Compdfkit_Tools.Edit
                             ImageThumbUI.Source = imageShow;
                             break;
                         }
-                    }
-
+                    } 
                 }
                 catch (Exception ex)
                 {
@@ -235,7 +234,7 @@ namespace Compdfkit_Tools.Edit
         public void SetImageTransparency(double transparency)
         {
             ImasgeOpacitySlider.Value = transparency / 255D;
-            OpacityTextBox.Text = string.Format("{0}%", (int)(Math.Ceiling(ImasgeOpacitySlider.Value * 100)));
+            OpacityTextBox.Text = string.Format("{0}%", (int)Math.Round(ImasgeOpacitySlider.Value * 100));
         }
     }
 }

+ 17 - 10
Demo/Examples/Compdfkit_Tools/Edit/PDFTextEdit/PDFTextEditControl/PDFTextEditControl.xaml.cs

@@ -12,7 +12,7 @@ namespace Compdfkit_Tools.Edit
 {
     public partial class PDFTextEditControl : UserControl
     {
-        public CPDFViewer PDFView { get;private set; }
+        public CPDFViewer PDFView { get; private set; }
         public PDFEditEvent EditEvent { get; set; }
         public PDFTextEditControl()
         {
@@ -28,18 +28,25 @@ namespace Compdfkit_Tools.Edit
         public void SetPDFTextEditData(PDFEditEvent newEvent)
         {
             EditEvent = null;
-            if (newEvent!=null && newEvent.EditType==CPDFEditType.EditText)
+            if (newEvent != null && newEvent.EditType == CPDFEditType.EditText)
             {
-                if (newEvent.SystemFontNameList.Contains(newEvent.FontName) == false && string.IsNullOrEmpty(newEvent.FontName)==false)
+                if (newEvent.SystemFontNameList != null && newEvent.SystemFontNameList.Count == 0)
+                {
+                    newEvent.SystemFontNameList.Add("Helvetica");
+                    newEvent.SystemFontNameList.Add("Courier New");
+                    newEvent.SystemFontNameList.Add("Times New Roman");
+                }
+                if (newEvent.SystemFontNameList.Contains(newEvent.FontName) == false && string.IsNullOrEmpty(newEvent.FontName) == false)
                 {
                     newEvent.SystemFontNameList.Add(newEvent.FontName);
                 }
 
                 TextStyleUI.SetFontNames(newEvent.SystemFontNameList);
                 TextStyleUI.SelectFontName(newEvent.FontName);
-                TextStyleUI.SetFontStyle(newEvent.IsBold,newEvent.IsItalic);
+                TextStyleUI.SetFontStyle(newEvent.IsBold, newEvent.IsItalic);
                 TextStyleUI.SetFontSize(newEvent.FontSize);
-                OpacityTextBox.Text = string.Format("{0}%", (int)(Math.Ceiling(newEvent.Transparency * 100/255D)));
+                OpacityTextBox.Text = string.Format("{0}%", (int)(Math.Ceiling(newEvent.Transparency * 100 / 255D)));
+                FontOpacitySlider.Value = ((int)(Math.Ceiling(newEvent.Transparency * 100 / 255D))) / 100D;
                 TextAlignUI.SetFontAlign(newEvent.TextAlign);
                 FontColorUI.SetCheckedForColor(newEvent.FontColor);
             }
@@ -77,11 +84,11 @@ namespace Compdfkit_Tools.Edit
         private void SliderOpacity_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
         {
             Slider slider = sender as Slider;
-            if(OpacityTextBox!=null && FontOpacitySlider!=null)
+            if (OpacityTextBox != null && FontOpacitySlider != null)
             {
                 OpacityTextBox.Text = string.Format("{0}%", (int)(FontOpacitySlider.Value * 100));
             }
-          
+
             if (slider != null && slider.Tag != null && slider.Tag.ToString() == "false")
             {
                 return;
@@ -158,7 +165,7 @@ namespace Compdfkit_Tools.Edit
             }
         }
 
-        private void TextAlignUI_TextAlignChanged(object sender,TextAlignType e)
+        private void TextAlignUI_TextAlignChanged(object sender, TextAlignType e)
         {
             if (EditEvent != null)
             {
@@ -169,7 +176,7 @@ namespace Compdfkit_Tools.Edit
 
         private void TextStyleUI_TextItalicChanged(object sender, bool e)
         {
-            if(EditEvent!=null)
+            if (EditEvent != null)
             {
                 EditEvent.IsItalic = e;
                 EditEvent.UpdatePDFEditByEventArgs();
@@ -202,7 +209,7 @@ namespace Compdfkit_Tools.Edit
                 if (double.TryParse(selectItem.Content.ToString().TrimEnd('%'), out double newOpacity))
                 {
                     OpacityTextBox.Text = selectItem.Content.ToString();
-                    FontOpacitySlider.Value = newOpacity/100.0;
+                    FontOpacitySlider.Value = newOpacity / 100.0;
                 }
             }
         }

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextStyleUI.xaml.cs

@@ -76,7 +76,7 @@ namespace Compdfkit_Tools.Edit
 
             if (isBold == false && isItalic)
             {
-                FontStyleBox.SelectedIndex = 0;
+                FontStyleBox.SelectedIndex = 2;
                 return;
             }
 

+ 3 - 3
Demo/Examples/Compdfkit_Tools/Form/FromPropertyControl.xaml

@@ -7,9 +7,9 @@
              mc:Ignorable="d" 
              Loaded="UserControl_Loaded"
              Unloaded="UserControl_Unloaded"
-             Width="260">
-    <Grid >
-        <TextBlock Name="NoResultText" Foreground="#43474D" FontSize="14" LineHeight="16" TextWrapping="Wrap" Width="190" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center">Show/hide Form properties panel</TextBlock>
+             Width="260" Background="#FAFCFF">
+    <Grid>
+        <TextBlock Name="NoResultText" Foreground="#43474D" FontSize="14" LineHeight="16" TextWrapping="Wrap" Width="190" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center">The property panel is empty</TextBlock>
         <Border x:Name="FromPropertyPanel"></Border>
     </Grid>
 </UserControl>

+ 3 - 3
Demo/Examples/Compdfkit_Tools/PDFView/PDFDisplaySettings/PDFDisplaySettingsControl/CPDFDisplaySettingsControl.xaml.cs

@@ -68,13 +68,13 @@ namespace Compdfkit_Tools.PDFControl
                 ViewModeUI.SetSplitModeUI(pdfView.Mode);
                 ViewModeUI.SetViewModeUI(pdfView.ModeView);
                 ViewModeUI.SetCropUI(pdfView.IsCropMode());
-            }
-          
+            } 
         }
 
-        public void SetSplitContainerVisibility(Visibility visible)
+        public void SetVisibilityWhenContentEdit(Visibility visible)
         {
             ViewModeUI?.SetSplitContainerVisibility(visible);
+            ViewModeUI?.SetCropContainerVisibility(visible);
         }
 
         private void PdfView_InfoChanged(object sender, KeyValuePair<string, object> e)

+ 27 - 18
Demo/Examples/Compdfkit_Tools/PDFView/PDFDisplaySettings/PDFDisplaySettingsUI/CPDFViewModeUI.xaml

@@ -22,7 +22,7 @@
                 </RadioButton.ToolTip>
             </RadioButton>
             <RadioButton x:Name="DiscontinuousRadioButton" Tag="Discontinuous" GroupName="Continuous" Click="ContinuousRadioButton_Click">
-                <TextBlock Text="DisContinous"></TextBlock>
+                <TextBlock Text="Discontinous"></TextBlock>
                 <RadioButton.ToolTip>
                     <ToolTip Content="Discontinuous"></ToolTip>
                 </RadioButton.ToolTip>
@@ -47,7 +47,7 @@
                 </RadioButton.ToolTip>
             </RadioButton>
         </StackPanel>
-        
+
         <Grid>
             <Grid.RowDefinitions>
                 <RowDefinition Height="auto"></RowDefinition>
@@ -62,8 +62,8 @@
                         <RowDefinition Height="auto"></RowDefinition>
                     </Grid.RowDefinitions>
                     <TextBlock Foreground="#43474D" FontSize="14" LineHeight="16" Margin="0,0,0,18">Split View</TextBlock>
-                    
-                    <StackPanel Orientation="Horizontal" Grid.Row="1"> 
+
+                    <StackPanel Orientation="Horizontal" Grid.Row="1">
                         <ToggleButton Name="VerticalBtn" Width="50" Height="36" BorderThickness="0" Style="{StaticResource RoundToggleButtonStyle}" 
                                       Background="Transparent" Click="VerticalBtn_Click">
                             <ToggleButton.Content>
@@ -81,7 +81,7 @@
                                 <ToolTip Content="Vertical"></ToolTip>
                             </ToggleButton.ToolTip>
                         </ToggleButton>
- 
+
                         <ToggleButton Name="HorizonBtn" Width="50" Height="36" BorderThickness="0" Margin="5,0,0,0" Style="{StaticResource RoundToggleButtonStyle}" 
                                       Background="Transparent" Click="HorizonBtn_Click">
                             <ToggleButton.Content>
@@ -100,7 +100,7 @@
                                 <ToolTip Content="Horizontal"></ToolTip>
                             </ToggleButton.ToolTip>
                         </ToggleButton>
-                        
+
                     </StackPanel>
                 </Grid>
             </Border>
@@ -114,7 +114,7 @@
                     <TextBlock Foreground="#43474D" FontSize="14" LineHeight="16" Margin="0,0,0,18">Display Mode</TextBlock>
 
                     <StackPanel Orientation="Horizontal" Grid.Row="1">
-                         
+
                         <ToggleButton Name="SingleViewBtn" Width="50" Height="36" BorderThickness="0" Style="{StaticResource RoundToggleButtonStyle}" Background="Transparent"
                                       Click="SingleViewBtn_Click">
                             <ToggleButton.Content>
@@ -128,7 +128,7 @@
                                 <ToolTip Content="Single Page"></ToolTip>
                             </ToggleButton.ToolTip>
                         </ToggleButton>
-                         
+
                         <ToggleButton Name="DoubleViewBtn" Width="50" Height="36" BorderThickness="0" Margin="5,0,0,0" Style="{StaticResource RoundToggleButtonStyle}" Background="Transparent"
                                       Click="DoubleViewBtn_Click">
                             <ToggleButton.Content>
@@ -142,7 +142,7 @@
                                 <ToolTip Content="Double Page"></ToolTip>
                             </ToggleButton.ToolTip>
                         </ToggleButton>
-                         
+ 
                         <ToggleButton Name="BookViewBtn" Width="50" Height="36" BorderThickness="0" Margin="5,0,0,0" Style="{StaticResource RoundToggleButtonStyle}" Background="Transparent"
                                       Click="BookViewBtn_Click">
                             <ToggleButton.Content>
@@ -159,7 +159,7 @@
                                 <ToolTip Content="Cover Mode"></ToolTip>
                             </ToggleButton.ToolTip>
                         </ToggleButton>
-                        
+
                     </StackPanel>
                 </Grid>
             </Border>
@@ -170,16 +170,25 @@
                         <RowDefinition Height="auto"></RowDefinition>
                         <RowDefinition Height="auto"></RowDefinition>
                     </Grid.RowDefinitions>
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                        <ColumnDefinition Width="auto"></ColumnDefinition>
-                    </Grid.ColumnDefinitions>
-                    <TextBlock FontSize="14" Foreground="#43474D">Continuous Scroll</TextBlock>
-                    <ToggleButton Name="ContinuePageBtn" Style="{StaticResource ToggleButtonSwitchStyle}" Margin="0,0,33,0" Grid.Column="1" Width="40" BorderThickness="0"
+
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="*"></ColumnDefinition>
+                            <ColumnDefinition Width="auto"></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+                        <TextBlock FontSize="14" Foreground="#43474D">Continuous Scroll</TextBlock>
+                        <ToggleButton Name="ContinuePageBtn" Style="{StaticResource ToggleButtonSwitchStyle}" Margin="0,0,33,0" Grid.Column="1" Width="40" BorderThickness="0"
                                   Click="ContinuePageBtn_Click"></ToggleButton>
-                    <TextBlock FontSize="14" Foreground="#43474D" Grid.Row="1" Margin="0,24,0,0">Crop</TextBlock>
-                    <ToggleButton Name="CropModeBtn" Style="{StaticResource ToggleButtonSwitchStyle}"  Margin="0,24,33,0" Grid.Row="1"  Grid.Column="1" Width="40" BorderThickness="0"
+                    </Grid>
+                    <Grid Grid.Row="1" x:Name="CropContainer">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="*"></ColumnDefinition>
+                            <ColumnDefinition Width="auto"></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+                        <TextBlock FontSize="14" Foreground="#43474D" Margin="0,24,0,0">Crop</TextBlock>
+                        <ToggleButton Name="CropModeBtn" Style="{StaticResource ToggleButtonSwitchStyle}"  Margin="0,24,33,0" Grid.Column="1" Width="40" BorderThickness="0"
                                   Click="CropModeBtn_Click"></ToggleButton>
+                    </Grid> 
                 </Grid>
             </Border>
         </Grid>

+ 15 - 2
Demo/Examples/Compdfkit_Tools/PDFView/PDFDisplaySettings/PDFDisplaySettingsUI/CPDFViewModeUI.xaml.cs

@@ -73,7 +73,6 @@ namespace Compdfkit_Tools.PDFControlUI
                 SingleViewBtn,
                 DoubleViewBtn,
                 BookViewBtn,
-                ContinuePageBtn
             };
 
             List<Path> viewPathList = new List<Path>()
@@ -216,6 +215,8 @@ namespace Compdfkit_Tools.PDFControlUI
             CropModeBtn.IsChecked=isAutoCrop;
         }
 
+
+
         public void SetSplitContainerVisibility(Visibility visibility)
         {
             SplitContainer.Visibility = visibility;
@@ -224,10 +225,22 @@ namespace Compdfkit_Tools.PDFControlUI
                 DisplayContainer.Margin = new Thickness(0,30,0,0);
             }
             else
+            {
+                DisplayContainer.Margin = new Thickness(0);
+            } 
+        }
+
+        public void SetCropContainerVisibility(Visibility visibility)
+        {
+            CropContainer.Visibility = visibility;
+            if (visibility == Visibility.Visible)
+            {
+                DisplayContainer.Margin = new Thickness(0, 30, 0, 0);
+            }
+            else
             {
                 DisplayContainer.Margin = new Thickness(0);
             }
-          
         }
     }
 }

+ 20 - 3
Demo/Examples/Compdfkit_Tools/PDFView/PDFInfo/CPDFInfoControl.xaml

@@ -4,11 +4,28 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl"
-             mc:Ignorable="d">
+             mc:Ignorable="d"
+             Width="422" Height="680" Background="#ffffff">
     <Grid>
-        <StackPanel Orientation="Vertical">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <TextBlock Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">Password</TextBlock>
+            <Button x:Name="CloseInfoButton" Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="CloseInfoButton_Click">
+                <Button.Content>
+                    <Path Fill="Black">
+                        <Path.Data>
+                            M6.69495 6L11.5 1.19495L10.805 0.5L6 5.30505L1.19495 0.5L0.5 1.19495L5.30505 6L0.5 10.805L1.19495 11.5L6 6.69495L10.805 11.5L11.5 10.805L6.69495 6Z
+                        </Path.Data>
+                    </Path>
+                </Button.Content>
+            </Button>
+        </Grid>
+        <StackPanel Orientation="Vertical" Grid.Row="1" Margin="20,0,20,0">
             <cpdftools:CPDFAbstractInfoControl x:Name="CPDFAbstractInfoControl"></cpdftools:CPDFAbstractInfoControl>
-            <cpdftools:CPDFCreateInfoControl x:Name="CPDFCreateInfoControl" Margin="0,21,0,0"></cpdftools:CPDFCreateInfoControl>
+            <cpdftools:CPDFCreateInfoControl x:Name="CPDFCreateInfoControl" ></cpdftools:CPDFCreateInfoControl>
             <cpdftools:CPDFSecurityInfoControl x:Name="CPDFSecurityInfoControl"></cpdftools:CPDFSecurityInfoControl>
         </StackPanel>
     </Grid>

+ 9 - 2
Demo/Examples/Compdfkit_Tools/PDFView/PDFInfo/CPDFInfoControl.xaml.cs

@@ -1,4 +1,5 @@
 using ComPDFKitViewer.PdfViewer;
+using System;
 using System.Windows.Controls;
 
 namespace Compdfkit_Tools.PDFControl
@@ -7,10 +8,11 @@ namespace Compdfkit_Tools.PDFControl
     {
         public CPDFViewer pdfViewer;
 
+        public event EventHandler CloseInfoEvent;
+
         public CPDFInfoControl()
         {
-            InitializeComponent();
-
+            InitializeComponent(); 
         }
 
         public void InitWithPDFViewer(CPDFViewer pdfViewer)
@@ -20,5 +22,10 @@ namespace Compdfkit_Tools.PDFControl
             CPDFCreateInfoControl.InitWithPDFViewer(pdfViewer);
             CPDFSecurityInfoControl.InitWithPDFViewer(pdfViewer);
         }
+
+        private void CloseInfoButton_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            CloseInfoEvent?.Invoke(this, new EventArgs());
+        }
     }
 }

+ 1 - 1
Demo/Examples/Compdfkit_Tools/PDFView/PDFThumbnail/PDFThumbnailUI/CPdfThumbnailUI.xaml

@@ -16,7 +16,7 @@
     </UserControl.Resources>
     <Grid>
         <ListBox Name="ThumbListBox" SelectionChanged="ThumbListBox_SelectionChanged" SelectionMode="Single" ScrollViewer.ScrollChanged="ThumbListBox_ScrollChanged" BorderThickness="0"
-                 ScrollViewer.VerticalScrollBarVisibility="Hidden">
+                 ScrollViewer.VerticalScrollBarVisibility="Auto">
             <ListBox.Resources>
                 <Style TargetType="ListBoxItem" BasedOn="{StaticResource ThumbnailListBoxItemStyle}"/>
             </ListBox.Resources>

+ 31 - 6
Demo/Examples/Compdfkit_Tools/PDFView/PDFViewControl/PDFViewControl.xaml.cs

@@ -1,12 +1,17 @@
 using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation;
+using ComPDFKit.PDFAnnotation.Form;
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFDocument.Action;
+using ComPDFKit.PDFPage;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using Microsoft.Win32;
 using System;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
+using System.Linq;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media.Imaging;
@@ -15,7 +20,7 @@ namespace Compdfkit_Tools.PDFControl
 {
     public partial class PDFViewControl : UserControl
     {
-        public CPDFViewer PDFView { get;private set; }
+        public CPDFViewer PDFView { get; private set; }
 
         public bool CustomSignHandle { get; set; }
 
@@ -33,7 +38,7 @@ namespace Compdfkit_Tools.PDFControl
 
         private void PDFView_WidgetClickHandler(object sender, WidgetArgs e)
         {
-            if ((e is WidgetSignArgs) && CustomSignHandle==false)
+            if ((e is WidgetSignArgs) && CustomSignHandle == false)
             {
                 try
                 {
@@ -64,14 +69,14 @@ namespace Compdfkit_Tools.PDFControl
                         }
                     }
                 }
-                catch(Exception ex)
+                catch (Exception ex)
                 {
 
                 }
             }
         }
 
-        private void PDFView_PDFActionHandler(object sender,CPDFAction pdfAction)
+        private void PDFView_PDFActionHandler(object sender, CPDFAction pdfAction)
         {
             if (pdfAction != null)
             {
@@ -162,8 +167,6 @@ namespace Compdfkit_Tools.PDFControl
                         break;
                 }
             }
-
-          
         }
 
         private void PDFView_MouseWheelZoomHandler(object sender, bool e)
@@ -201,5 +204,27 @@ namespace Compdfkit_Tools.PDFControl
             return standardZoom / 100;
         }
 
+        public bool CheckHasForm()
+        {
+            if (PDFView == null || PDFView.Document == null)
+                return false;
+
+            var document = PDFView.Document;
+            for (int i = 0; i < document.PageCount; i++)
+            {
+                CPDFPage page = document.PageAtIndex(i, false);
+                List<CPDFAnnotation> annotList = page.GetAnnotations();
+                if (annotList == null || annotList.Count < 1)
+                    continue;
+
+                List<CPDFWidget> formList = annotList.AsEnumerable().
+                    Where(x => x.Type == C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET)
+                    .Cast<CPDFWidget>()
+                    .ToList();
+                if (formList.Count > 0)
+                    return true;
+            }
+            return false;
+        }
     }
 }

+ 5 - 4
Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml

@@ -32,8 +32,8 @@
                 <MenuItem Name="Copy" Header="Copy" IsEnabled="True" Click="Copy_Click"></MenuItem>
                 <MenuItem Name="Delete" Header="Delete" Click="Delete_Click"></MenuItem>
             </ContextMenu>
-            <RoutedUICommand x:Key="LeftRotate" Text="Left Rotate"/>
-            <RoutedUICommand x:Key="RightRotate" Text="Right Rotate"/>
+            <RoutedUICommand x:Key="LeftRotate" Text="Left rotate"/>
+            <RoutedUICommand x:Key="RightRotate" Text="Right rotate"/>
             <RoutedUICommand x:Key="Delete" Text="Delete"/>
             <RoutedUICommand x:Key="Copy" Text="Copy"/>
 
@@ -75,7 +75,7 @@
                  VirtualizingPanel.VirtualizationMode="Standard"
                  VirtualizingPanel.CacheLengthUnit="Page"
                  VirtualizingPanel.CacheLength="1"
-                 VirtualizingPanel.ScrollUnit="Pixel"  
+                 VirtualizingPanel.ScrollUnit="Pixel" d:ItemsSource="{d:SampleData ItemCount=5}"  
             >
 
                 <ListBox.ItemContainerStyle>
@@ -101,7 +101,8 @@
             <Border Name="tip" Visibility="Collapsed" CornerRadius="4" Background="#89000000" Grid.Row="1"  HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,150">
                 <TextBlock x:Name="PageViewTipText" Margin="12,4" Foreground="White" FontSize="14" Padding="4 2 4 2"/>
             </Border> 
-            <Line Name="MidLane" StrokeStartLineCap="Triangle" StrokeEndLineCap="Triangle"  Visibility="Collapsed"  AllowDrop="True" Drop="MidLane_Drop"  X1="20" X2="20" Y1="0" Y2="150" Stroke="#FF477EDE" StrokeThickness="5"/> 
+            <Line Name="MidLane" StrokeStartLineCap="Triangle" StrokeEndLineCap="Triangle"  Visibility="Collapsed"  AllowDrop="True" Drop="MidLane_Drop"  X1="20" X2="20" Y1="0" Y2="150" Stroke="#FF477EDE" StrokeThickness="5"/>
+ 
             <Image Name="ShadowPicture" Opacity="0.8" Visibility="{Binding ElementName=MidLane,Path=Visibility}" AllowDrop="True"  Drop="ShadowPicture_Drop" RenderOptions.BitmapScalingMode="HighQuality" UseLayoutRounding="True"  HorizontalAlignment="Left" VerticalAlignment="Top"/>
 
             <Rectangle Name="ChooseRect" VerticalAlignment="Top" HorizontalAlignment="Left" Stroke="#AACCEE" StrokeThickness ="2" Fill ="#AACCEE" Opacity="0.3"/>

+ 54 - 120
Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml.cs

@@ -118,13 +118,11 @@ namespace Compdfkit_Tools.PDFControl
             get { return PageEditListBox.SelectedIndex; }
         }
 
-
         public event EventHandler ExitPageEdit;
 
         public CPDFPageEditControl()
         {
             InitializeComponent();
-            SetLangText();
         }
 
         public void PageEdit(string PageEditString)
@@ -151,9 +149,7 @@ namespace Compdfkit_Tools.PDFControl
                 pageExtractWindow.InitPageExtractWindow(SelectedItemsRange, pdfViewer.Document.PageCount);
                 pageExtractWindow.DialogClosed += PageExtractWindow_DialogClosed;
                 pageExtractWindow.Owner = parentWindow;
-                pageExtractWindow.ShowDialog();
-
-
+                pageExtractWindow.ShowDialog();  
             }
             else if (PageEditString == "Copy")
             {
@@ -197,17 +193,10 @@ namespace Compdfkit_Tools.PDFControl
             }
         }
 
-        private void SetLangText()
-        {
-
-        }
-
         private void Timer_Tick(object sender, EventArgs e)
-        {
-            // Hide the Border control after the timer is triggered
+        { 
             AlertBorder.Visibility = Visibility.Collapsed;
-
-            // Stop the timer
+             
             DispatcherTimer timer = (DispatcherTimer)sender;
             timer.Stop();
             timer.Tick -= Timer_Tick;
@@ -257,8 +246,7 @@ namespace Compdfkit_Tools.PDFControl
                     return;
                 }
                 ScrollViewer sv = GetScrollHost(PageEditListBox);
-
-                //ListBoxItem item = PageEditListBox.Items[pageIndex] as ListBoxItem;
+                 
                 ListBoxItem listboxitem = PageEditListBox.ItemContainerGenerator.ContainerFromIndex(pageIndex) as ListBoxItem;
                 if (ViewportHelper.IsInViewport(sv, listboxitem))
                 {
@@ -407,16 +395,11 @@ namespace Compdfkit_Tools.PDFControl
             }
         }
 
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="isFromClick">是否是缩放时的刷新</param>
         public void RefreshThumbnail(bool isZooming = false)
         {
             try
             {
                 if (pdfViewer == null) return;
-                //确保缩放后选中项不发生改变
                 var items = GetListFromSelectedItems();
                 PopulateThumbnailList();
                 if (pdfViewer.CurrentIndex >= PageEditListBox.Items.Count)
@@ -445,7 +428,7 @@ namespace Compdfkit_Tools.PDFControl
 
         private void PageEditListBox_ScrollChanged(object sender, ScrollChangedEventArgs e)
         {
-            ItemsInViewHitTest();//第一次加载时触发的Scollchange 直接刷新界面,减少白板显示时间
+            ItemsInViewHitTest();
 
             if (startChoose)
             {
@@ -464,16 +447,15 @@ namespace Compdfkit_Tools.PDFControl
         {
             var s = GetScrollHost(PageEditListBox);
             Point start = new Point();
-            start = new Point(startPostion.X, startPostion.Y - s.VerticalOffset);//通过 实时的垂直偏移量和第一次的偏移量抵消,来获取准确的垂直偏移值。
+            start = new Point(startPostion.X, startPostion.Y - s.VerticalOffset);
             var rec = new Rect(start, Mouse.GetPosition(PageEditListBox));
             ChooseRect.Margin = new Thickness(rec.Left, rec.Top, 0, 0);
             ChooseRect.Width = rec.Width;
             ChooseRect.Height = rec.Height;
             ChooseRect.Visibility = Visibility.Visible;
-            for (int i = 0; i < PageEditListBox.Items.Count; i++)//检测所有内容是否在矩形框中
+            for (int i = 0; i < PageEditListBox.Items.Count; i++)
             {
                 var _item = PageEditListBox.Items[i] as ListBoxItem;
-                //通过这一步来避免重复误选中
                 var parent = Utils.FindVisualParent<VirtualizingWrapPanel>(_item);
                 if (parent == null)
                     continue;
@@ -522,7 +504,6 @@ namespace Compdfkit_Tools.PDFControl
             {
                 return;
             }
-            //未选中item  并且不是点击滑轨时 开始框选
             var listBoxItem = Utils.FindVisualParent<ListBoxItem>(result.VisualHit);
             var scroller = Utils.FindVisualParent<ScrollBar>(result.VisualHit);
             if (listBoxItem == null)
@@ -532,7 +513,7 @@ namespace Compdfkit_Tools.PDFControl
                     startChoose = false;
                     return;
                 }
-                //点击空白处时开始框选
+
                 startChoose = true;
                 PageEditListBox.SelectedItems.Clear();
                 startPostion = e.GetPosition(PageEditListBox);
@@ -541,10 +522,9 @@ namespace Compdfkit_Tools.PDFControl
                 Mouse.Capture(PageEditListBox);
                 return;
             }
-            startChoose = false;//选中了item 时,不能框选
+            startChoose = false;
             if (listBoxItem.IsSelected == true && !Keyboard.IsKeyDown(Key.LeftCtrl))
             {
-                //  isDraging = true;
                 e.Handled = true;
             }
         }
@@ -566,11 +546,8 @@ namespace Compdfkit_Tools.PDFControl
                 return;
             }
 
-            // shift多选后,再次点击时,清空选中项,高亮当前项 按下ctrl时,不处理
-            //因为listView 本身在选择项方面相当别扭,所以常见的按键模式都要逐个测试,并借助较多的限定条件才能实现
             if (iskeyDown && !Keyboard.IsKeyDown(Key.LeftCtrl) && !Keyboard.IsKeyDown(Key.LeftShift))
             {
-                //IskeyDown = false;
                 PageEditListBox.SelectedItems.Clear();
                 PageEditListBox.SelectedItem = listBoxItem;
                 listBoxItem.IsSelected = true;
@@ -587,7 +564,6 @@ namespace Compdfkit_Tools.PDFControl
             }
             if (isDragingEnter)
             {
-                //在当前位置插入整个pdf
                 CPDFDocument dragDoc = CPDFDocument.InitWithFilePath(dragingEnterPath);
                 if (dragingEnterPath.Substring(dragingEnterPath.LastIndexOf(".")).ToLower() == ".pdf")
                 {
@@ -608,12 +584,9 @@ namespace Compdfkit_Tools.PDFControl
                     else
                     {
                     }
-                    //提示文档损坏无法打开
                 }
                 else if (!string.IsNullOrEmpty(dragingEnterPath))
                 {
-                    //其他文件  则新增一个页签打开
-                    //    DragAddTab.Invoke(dragingEnterPath, new RoutedEventArgs());//底层库需要加一个  Load(TPDFDocument)的接口
                 }
                 MidLane.Visibility = Visibility.Collapsed;
                 isDragingEnter = false;
@@ -624,12 +597,10 @@ namespace Compdfkit_Tools.PDFControl
             var result = VisualTreeHelper.HitTest(PageEditListBox, pos);
             if (result == null)
             {
-                //超出当前可控区域
                 MidLane.Visibility = Visibility.Collapsed;
                 isDraging = false;
                 return;
             }
-            //查找元数据
             var sourcePerson = e.Data.GetData(typeof(StackPanel)) as StackPanel;
             if (sourcePerson == null)
             {
@@ -637,19 +608,16 @@ namespace Compdfkit_Tools.PDFControl
                 isDraging = false;
                 return;
             }
-            //查找目标数据
-            int targetindex = 0;//目标插入位置
+            int targetindex = 0;
             if (InsertIndex != -1)
             {
-                //往前移动时  此index  不是准确的,需要处理++
                 targetindex = InsertIndex;
             }
-            else//基本不会命中  仅作为保险措施
+            else
             {
                 var listBoxItem = Utils.FindVisualParent<ListBoxItem>(result.VisualHit);
                 if (listBoxItem == null)
                 {
-                    ////鼠标停留在两个item之间或其他无效区域  暂时不做处理(比较麻烦)
                     MidLane.Visibility = Visibility.Collapsed;
                     isDraging = false;
                     return;
@@ -668,14 +636,12 @@ namespace Compdfkit_Tools.PDFControl
             }
 
             List<ListBoxItem> list = new List<ListBoxItem>();
-            List<int> sourceindex = new List<int>();//需要保存每个页面对应的位置
-            //开始排序
+            List<int> sourceindex = new List<int>();
             List<int> pages = new List<int>();
-            //要先对所有选中项 根据页码排序
             for (int i = 0; i < PageEditListBox.SelectedItems.Count; i++)
             {
                 var pageindex = PageEditListBox.Items.IndexOf(PageEditListBox.SelectedItems[i] as ListBoxItem);
-                pages.Add(pageindex);//存入的为页码索引值
+                pages.Add(pageindex);
             }
             pages.Sort();
             if (pages.Count <= 0)
@@ -685,9 +651,7 @@ namespace Compdfkit_Tools.PDFControl
                 return;
             }
 
-            //要考虑每一次交换都会导致局部页码发生改变
-            //每次整体往后移动时,先移动大页码;整体往前移动时,先移动小页码;往中间移动时,再按上述两种情况分别移动
-            if (targetindex <= pages[0])// 目标位置在所有选中内容左边,整体前移动  优先先判断左移的情况
+            if (targetindex <= pages[0])
             {
                 sourceindex.Add(-1);
                 list = new List<ListBoxItem>();
@@ -698,7 +662,7 @@ namespace Compdfkit_Tools.PDFControl
                     DragToSort(pages[i], targetindex + i);
                 }
             }
-            else if (targetindex > pages[pages.Count - 1])//目标位置在所有选中内容右边 整体后移
+            else if (targetindex > pages[pages.Count - 1])
             {
                 sourceindex.Add(1);
                 list = new List<ListBoxItem>();
@@ -706,43 +670,40 @@ namespace Compdfkit_Tools.PDFControl
                 {
                     list.Add(PageEditListBox.Items[pages[pages.Count - 1 - i]] as ListBoxItem);
                     sourceindex.Add(pages[pages.Count - 1 - i]);
-                    DragToSort(pages[pages.Count - 1 - i], targetindex - 1 - i/* + (PageEditListBox.SelectedItems.Count - 1 - i)*/);
+                    DragToSort(pages[pages.Count - 1 - i], targetindex - 1 - i);
                 }
             }
-            else//目标位置在所有选中项中间
+            else
             {
                 int i, j, k;
-                for (k = 0; k < pages.Count - 1; k++)//找出PageEditListBox.Items中页码等于destpage的下标
+                for (k = 0; k < pages.Count - 1; k++)
                 {
-                    //这里要算入K---即前面部分的页面个数
                     if (pages[k] < targetindex && pages[k + 1] >= targetindex)
                         break;
                 }
 
                 sourceindex.Add(0);
                 list = new List<ListBoxItem>();
-                for (i = 0; i <= k; i++)//局部往后移动
+                for (i = 0; i <= k; i++)
                 {
                     list.Add(PageEditListBox.Items[pages[k - i]] as ListBoxItem);
                     sourceindex.Add(pages[k - i]);
                     DragToSort(pages[k - i], targetindex - 1 - i);
                 }
-                for (j = i; j < pages.Count; j++)//局部往前移动
+                for (j = i; j < pages.Count; j++)
                 {
                     list.Add(PageEditListBox.Items[pages[j]] as ListBoxItem);
                     sourceindex.Add(pages[j]);
                     DragToSort(pages[j], targetindex);
                     targetindex++;
                 }
-                sourceindex.Add(k);//往中间移时, index数组的最后一位 表示 间隔位置K
+                sourceindex.Add(k); 
             }
             isDraging = false;
         }
 
         private void MidLane_Drop(object sender, DragEventArgs e)
-        {
-            //指针停留在中间线上后释放  也需要隐藏
-            MidLane.Visibility = Visibility.Collapsed;
+        {             MidLane.Visibility = Visibility.Collapsed;
             this.PageEditListBox_Drop(sender, e);
         }
 
@@ -761,7 +722,7 @@ namespace Compdfkit_Tools.PDFControl
                         {
                             startChoose = false;
                             ChooseRect.Visibility = Visibility.Collapsed;
-                            Mouse.Capture(null);//暂时未想到靠近顶部和底部自动翻滚的好方法,只能先屏蔽这部分功能
+                            Mouse.Capture(null); 
                             return;
                         }
                         DoSelectItems();
@@ -810,33 +771,21 @@ namespace Compdfkit_Tools.PDFControl
         }
 
         private void Grid_DragOver(object sender, DragEventArgs e)
-        {
-            //if (startchoose)
-            //{
-            //    return;
-            //}
+        { 
             try
-            {
-                //ctrl建按下 不显示插入标记和虚影  因为释放不会响应drop事件
+            { 
                 if (e.KeyStates == (DragDropKeyStates.ControlKey | DragDropKeyStates.LeftMouseButton) || e.KeyStates == (DragDropKeyStates.ShiftKey | DragDropKeyStates.LeftMouseButton | DragDropKeyStates.ControlKey))
                     return;
-
-                //滚动后有 位置不准确 要减去滚动偏移量
-                //控制线的位置
+                 
                 var pos = e.GetPosition(PageEditListBox);
                 var result = VisualTreeHelper.HitTest(PageEditListBox, pos);
                 if (result == null)
-                {
-                    //MidLane.Visibility = Visibility.Collapsed;
-                    //return;
+                { 
                 }
-
-                //获取当前鼠标指针下的容器
+                 
                 var listBoxItem = Utils.FindVisualParent<ListBoxItem>(result.VisualHit);
                 if (listBoxItem == null)
-                {
-                    //MidLane.Visibility = Visibility.Collapsed;
-                    //return;
+                { 
                 }
 
                 #region  计算虚影位置
@@ -903,8 +852,7 @@ namespace Compdfkit_Tools.PDFControl
                     }
                 }
                 #endregion
-
-                //暂时处理  鼠标移出边框时,虚影的显示问题
+                 
                 if (pos.Y <= 30 || pos.Y >= PageEditListBox.ActualHeight - 10)
                 {
                     MidLane.Visibility = Visibility.Collapsed;
@@ -927,8 +875,7 @@ namespace Compdfkit_Tools.PDFControl
                 }
 
                 var v = scroll.VerticalOffset;
-                scroll.ScrollToVerticalOffset(v + speed);//触发连续滚动
-                //SetReadModeTip(true, str, true);
+                scroll.ScrollToVerticalOffset(v + speed); 
                 #endregion
             }
             catch (Exception ex)
@@ -941,11 +888,9 @@ namespace Compdfkit_Tools.PDFControl
         {
             this.PageEditListBox_Drop(sender, e);
         }
-
-        //增加辅助判断,防止误触发 拖动排序
+         
         private void ListBoxItem_DragLeave(object sender, DragEventArgs e)
-        {
-            //较大幅度拖动才能触发排序
+        { 
             isDraging = true;
         }
 
@@ -956,8 +901,7 @@ namespace Compdfkit_Tools.PDFControl
             var list = GetListFromSelectedItems();
             DoDelete(list, true);
         }
-
-        //顺时针旋转图片
+         
         public void Rotate_Click(object sender, RoutedEventArgs e)
         {
             var item = sender as MenuItem;
@@ -1014,16 +958,14 @@ namespace Compdfkit_Tools.PDFControl
             if (pdfViewer == null)
                 return;
             if (isFirstLoad)
-            {
-                //第一次载入的时候 减少一次刷新次数
+            { 
                 isFirstLoad = false;
                 return;
             }
-            if ((bool)e.NewValue == true && pdfViewer != null && pdfViewer.CurrentIndex >= 0 /*&& (this.Parent as Grid).Name != "Thumbnail"*/)//添加一个判断条件,避免来回切换时影响缩略图显示效果
+            if ((bool)e.NewValue == true && pdfViewer != null && pdfViewer.CurrentIndex >= 0)  
             {
-                RefreshThumbnail();//保证从View 切换到PageEdit时,能及时更新 
-            }
-            //每次切换到页面编辑都同步选中项
+                RefreshThumbnail(); 
+            } 
             if (pdfViewer?.CurrentIndex >= PageEditListBox.Items.Count || PageEditListBox.Items.Count == 0)
                 return;
             ListBoxItem item = PageEditListBox.Items[pdfViewer?.CurrentIndex == -1 ? 0 : pdfViewer.CurrentIndex] as ListBoxItem;
@@ -1033,8 +975,7 @@ namespace Compdfkit_Tools.PDFControl
         }
 
         private async void ListBoxItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            //点击刷新加载失败的图片
+        { 
             if (!Keyboard.IsKeyDown(Key.LeftCtrl) && !Keyboard.IsKeyDown(Key.LeftShift))
             {
                 var item = sender as ListBoxItem;
@@ -1051,7 +992,7 @@ namespace Compdfkit_Tools.PDFControl
         private void PageGrid_PreviewDragEnter(object sender, DragEventArgs e)
         {
             var file = (System.Array)e.Data.GetData(DataFormats.FileDrop);
-            if (file == null || file.Length > 1)//为null 表示内部拖动 触发的
+            if (file == null || file.Length > 1) 
             { return; }
             foreach (var f in file)
             {
@@ -1062,8 +1003,7 @@ namespace Compdfkit_Tools.PDFControl
                 }
             }
         }
-
-        //右键菜单初始化
+         
         private void ContextMenu_Loaded(object sender, RoutedEventArgs e)
         {
             if (ViewportHelper.CopyDoc == null)
@@ -1252,9 +1192,7 @@ namespace Compdfkit_Tools.PDFControl
             int imageHeight = pageSize.Height > pageSize.Width ? thumbnailWidth * 2 : (int)(pageSize.Height / pageSize.Width * thumbnailWidth * 2);
 
             Image img = new Image()
-            {
-                // Margin = new Thickness(0, 0, 5, 0),
-
+            { 
                 Width = imageWidth,
                 Height = imageHeight,
                 Stretch = Stretch.Uniform,
@@ -1313,8 +1251,8 @@ namespace Compdfkit_Tools.PDFControl
             item.Tag = ItemIndex;
             item.Margin = new Thickness(6, 10, 6, 10);
             return item;
-        } 
-
+        }
+         
         public void AddBlankPages(int pagecount, int insertindex)
         {
             for (int i = 0; i < pagecount; i++)
@@ -1326,7 +1264,7 @@ namespace Compdfkit_Tools.PDFControl
             }
             PageEditListBox.UpdateLayout();
         }
-          
+         
         private async void RenderPage(int pageindex)
         {
             var range = GetRoughViewportRange(PageEditListBox, (PageEditListBox.Items[0] as ListBoxItem).DesiredSize, new Thickness(6, 10, 6, 10));
@@ -1377,8 +1315,7 @@ namespace Compdfkit_Tools.PDFControl
                             Image image = GetImageElement(PageEditListBox.Items[i] as ListBoxItem);
                             if (image.Source != null)
                             {
-                                image.Source = null;
-                                //(image.Parent as Border).BorderBrush = Brushes.Transparent;
+                                image.Source = null; 
                                 Debug.WriteLine("Page {0} is out of range, removed thumb", (i + 1));
                             }
                             else
@@ -1522,8 +1459,8 @@ namespace Compdfkit_Tools.PDFControl
                 TextBlock pagenum = GetPageNumTextBlock(item);
                 pagenum.Text = (i + 1).ToString();
             }
-        } 
-
+        }
+         
         private void UpdateAllPageNum()
         {
             for (int i = 0; i < PageEditListBox.Items.Count; i++)
@@ -1595,8 +1532,7 @@ namespace Compdfkit_Tools.PDFControl
                     if (visiblePageIndexes.Contains(insertindex + i))
                         visiblePageIndexes.Remove(insertindex + i); 
                 }
-
-                // RefreshThumbnail();
+                 
                 pdfViewer.UndoManager.ClearHistory();
                 pdfViewer.UndoManager.CanSave = true;
 
@@ -1649,8 +1585,7 @@ namespace Compdfkit_Tools.PDFControl
             pdfViewer.ReloadDocument();
             ItemsInViewHitTest();
         }
-
-  
+         
         public static string CreateFilePath(string path)
         {
             int i = 1;
@@ -1705,7 +1640,7 @@ namespace Compdfkit_Tools.PDFControl
                     pageName = "OddPages";
                     break;
                 case 3: 
-                    if (pagecount == 1)
+                    if (pagecount == 1) 
                         return;
                     count = pagecount / 2;
                     for (int i = 0; i < count; i++)
@@ -1947,7 +1882,7 @@ namespace Compdfkit_Tools.PDFControl
          
         public static bool GetPagesInRange(ref List<int> pageList, string pageRange, int count, char[] enumerationSeparator, char[] rangeSeparator, bool inittag = false)
         {
-            string[] rangeSplit = pageRange.Split(enumerationSeparator); 
+            string[] rangeSplit = pageRange.Split(enumerationSeparator);
 
             pageList.Clear();
 
@@ -1958,11 +1893,11 @@ namespace Compdfkit_Tools.PDFControl
                 {
                     starttag = 0;
                 }
-                if (range.Contains("-")) 
+                if (range.Contains("-"))
                 {
                     try
                     {
-                        string[] limits = range.Split(rangeSeparator); 
+                        string[] limits = range.Split(rangeSeparator);
                         if (limits.Length >= 2 && !string.IsNullOrWhiteSpace(limits[0]) && !string.IsNullOrWhiteSpace(limits[1]))
                         {
                             int start = int.Parse(limits[0]);
@@ -2215,7 +2150,6 @@ namespace Compdfkit_Tools.PDFControl
 
         private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
         {
-            DoSelectItems();
             ItemsInViewHitTest(); 
         }
     }

+ 4 - 4
Demo/Examples/Compdfkit_Tools/Properties/AssemblyInfo.cs

@@ -7,11 +7,11 @@ using System.Windows;
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("Compdfkit-Tools")]
+[assembly: AssemblyTitle("ComPDFKit_Tools")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Compdfkit-Tools")]
+[assembly: AssemblyProduct("ComPDFKit_Tools")]
 [assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
@@ -51,5 +51,5 @@ using System.Windows;
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.9.0.0")]
-[assembly: AssemblyFileVersion("1.9.0.0")]
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 2 - 22
Demo/Examples/ContentEditor/App.xaml.cs

@@ -1,4 +1,5 @@
 using ComPDFKit.NativeMethod;
+using Compdfkit_Tools.Helper;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -12,25 +13,6 @@ using static ComPDFKit.NativeMethod.CPDFSDKVerifier;
 
 namespace ContentEditor
 {
-    public class SDKLicenseHelper
-    {
-        public string key = string.Empty;
-        public string secret = string.Empty;
-        public SDKLicenseHelper()
-        {
-            string sdkLicensePath = "license_key_win.xml";
-            Assembly assembly = Assembly.GetExecutingAssembly();
-            XmlDocument xmlDocument = new XmlDocument();
-            xmlDocument.Load(sdkLicensePath);
-            var node = xmlDocument.SelectSingleNode("License");
-            if (node != null)
-            {
-                key = node.Attributes["key"].Value;
-                secret = node.Attributes["secret"].Value;
-            }
-        }
-    }
-
     public partial class App : Application
     {
         protected override void OnStartup(StartupEventArgs e)
@@ -41,9 +23,7 @@ namespace ContentEditor
 
         private static bool LicenseVerify()
         {
-            bool result = false;
-
-            result = CPDFSDKVerifier.LoadNativeLibrary();
+            bool result = LoadNativeLibrary();
             if (!result)
                 return false;
 

+ 1 - 1
Demo/Examples/ContentEditor/ContentEditor.csproj

@@ -118,7 +118,7 @@
   </ItemGroup>
   <ItemGroup>
     <Resource Include="ComPDFKit_Logo.ico" />
-    <Content Include="..\license_key_win.xml">
+    <Content Include="..\license_key_windows.xml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
   </ItemGroup>

+ 66 - 31
Demo/Examples/ContentEditor/MainWindow.xaml

@@ -7,7 +7,7 @@
         xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl;assembly=Compdfkit_Tools"
         xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common;assembly=Compdfkit_Tools"
         mc:Ignorable="d"
-        Title="Content Editor_ComPDFKit" Height="700" Width="1200" WindowStartupLocation="CenterScreen">
+        Title="Content Editor_ComPDFKit V1.9.1" Height="700" Width="1200" WindowStartupLocation="CenterScreen">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
@@ -15,8 +15,61 @@
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
             </ResourceDictionary.MergedDictionaries>
+
+            <!-- Shortcut -->
+            <RoutedUICommand x:Key="Open" Text="Open"/>
+            <RoutedUICommand x:Key="Save" Text="Right rotate"/>
+            <RoutedUICommand x:Key="SaveAs" Text="Delete"/>
+            <RoutedUICommand x:Key="Undo" Text="Undo"/>
+            <RoutedUICommand x:Key="Redo" Text="Redo"/>
+            <RoutedUICommand x:Key="ControlLeftPanel" Text="Control left panel"/>
+            <RoutedUICommand x:Key="ControlRightPanel" Text="Control right panel"/>
+            <RoutedUICommand x:Key="GoToBookmark" Text="Go to bookmark"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToOutline" Text="Go to outline"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToThumbnail" Text="Go to thumbnail"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToSearch" Text="Go to search"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleAdd" Text="Scale add"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleSubtract" Text="Scale reduce"></RoutedUICommand>
+            <RoutedUICommand x:Key="DisplaySettings" Text="Display settings"></RoutedUICommand>
+            <RoutedUICommand x:Key="DocumentInfo" Text="Document infomation"></RoutedUICommand>
         </ResourceDictionary>
     </Window.Resources>
+
+    <Window.CommandBindings>
+        <CommandBinding Command="{StaticResource Open}" Executed="CommandBinding_Executed_Open"/>
+        <CommandBinding Command="{StaticResource Save}" Executed="CommandBinding_Executed_Save"/>
+        <CommandBinding Command="{StaticResource SaveAs}" Executed="CommandBinding_Executed_SaveAs"/>
+        <CommandBinding Command="{StaticResource Undo}" Executed="CommandBinding_Executed_Undo"/>
+        <CommandBinding Command="{StaticResource Redo}" Executed="CommandBinding_Executed_Redo"/>
+        <CommandBinding Command="{StaticResource ControlLeftPanel}" Executed="CommandBinding_Executed_ControlLeftPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource ControlRightPanel}" Executed="CommandBinding_Executed_ControlRightPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToBookmark}" Executed="CommandBinding_Executed_Bookmark"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToOutline}" Executed="CommandBinding_Executed_Outline"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToSearch}" Executed="CommandBinding_Executed_Search"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleAdd}" Executed="CommandBinding_Executed_ScaleAdd"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleSubtract}" Executed="CommandBinding_Executed_ScaleSubtract"></CommandBinding>
+        <CommandBinding Command="{StaticResource DisplaySettings}" Executed="CommandBinding_Executed_DisplaySettings"></CommandBinding>
+        <CommandBinding Command="{StaticResource DocumentInfo}" Executed="CommandBinding_Executed_DocumentInfo"></CommandBinding>
+    </Window.CommandBindings>
+
+    <Window.InputBindings>
+        <KeyBinding Key="O" Modifiers="Control" Command="{StaticResource Open}"/>
+        <KeyBinding Key="S" Modifiers="Control" Command="{StaticResource Save}"/>
+        <KeyBinding Key="S" Modifiers="Control+Shift" Command="{StaticResource SaveAs}"/>
+        <KeyBinding Key="Z" Modifiers="Control" Command="{StaticResource Undo}"/>
+        <KeyBinding Key="Y" Modifiers="Control" Command="{StaticResource Redo}"/>
+        <KeyBinding Key="F4" Command="{StaticResource ControlLeftPanel}"/>
+        <KeyBinding Key="F4" Modifiers="Control" Command="{StaticResource ControlRightPanel}"/>
+        <KeyBinding Key="B" Modifiers="Control" Command="{StaticResource GoToBookmark}"></KeyBinding>
+        <KeyBinding Key="O" Modifiers="Control+Shift" Command="{StaticResource GoToOutline}"></KeyBinding>
+        <KeyBinding Key="T" Modifiers="Control" Command="{StaticResource GoToThumbnail}"></KeyBinding>
+        <KeyBinding Key="F" Modifiers="Control" Command="{StaticResource GoToSearch}"></KeyBinding>
+        <KeyBinding Key="Add" Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
+        <KeyBinding Key="Subtract" Modifiers="Control" Command="{StaticResource ScaleSubtract}"></KeyBinding>
+        <KeyBinding Key="D" Modifiers="Control" Command="{StaticResource DisplaySettings}"></KeyBinding>
+        <KeyBinding Key="I" Modifiers="Control" Command="{StaticResource DocumentInfo}"></KeyBinding>
+    </Window.InputBindings>
+
     <Grid>
         <Grid>
             <Grid.RowDefinitions>
@@ -91,8 +144,8 @@
                             <ToolTip Content="Save"></ToolTip>
                         </Button.ToolTip>
                     </Button>
- 
-                    <ToggleButton Name="ToolExpandBtn" Margin="13,0,0,0" BorderThickness="0" Width="30" Height="30" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="ToolExpand_Click">
+
+                    <ToggleButton Name="LeftToolPanelButton" Margin="13,0,0,0" BorderThickness="0" Width="30" Height="30" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="LeftToolPanelButton_Click">
                         <ToggleButton.Content>
                             <Path Fill="#43474D" Width="30" Height="30">
                                 <Path.Data>
@@ -136,7 +189,7 @@
                 <ComboBox Name="ViewComboBox" Width="120" Height="26" Grid.Column="1" HorizontalAlignment="Center" FontSize="14" Foreground="#001A4E" SelectionChanged="ComboBox_SelectionChanged"
                          Style="{StaticResource ComboBoxStyle1}" >
                     <ComboBoxItem>Viewer</ComboBoxItem>
-                    <ComboBoxItem IsSelected="True">PDF Edit</ComboBoxItem>
+                    <ComboBoxItem IsSelected="True">Content Edit</ComboBoxItem>
                 </ComboBox>
  
                 <StackPanel Orientation="Horizontal" Grid.Column="2">
@@ -157,8 +210,8 @@
                             <ToolTip Content="Search"></ToolTip>
                         </Button.ToolTip>
                     </Button>
- 
-                    <ToggleButton Name="RightPanelBtn" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="RightPanelBtn_Click">
+
+                    <ToggleButton Name="RightPanelButton" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="RightPanelButton_Click">
                         <ToggleButton.Content>
                             <Path Fill="#43474D" Width="30" Height="30">
                                 <Path.Data>
@@ -341,37 +394,19 @@
  
                     <cpdfcommon:PageNumberControl Grid.Row="1" Name="FloatPageTool" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20"></cpdfcommon:PageNumberControl>
                 </Grid>
- 
-                <Border Grid.Row="1" Name="PropertyContainer" Grid.Column="3" Visibility="Hidden"></Border>
+                <Grid Grid.Row="1" Grid.Column="3">
+                    <TextBlock x:Name="EmptyMessage" Text="The property panel is empty." Visibility="{Binding ElementName=PropertyContainer, Path=Visibility}" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
+
+                    <Border Name="PropertyContainer" Visibility="Hidden"></Border>
+                </Grid>
+                
             </Grid>
         </Grid>
 
         <Border Name="PopupBorder" Background="#A0000000" Visibility="Collapsed">
             <Grid>
- 
-                <Grid Name="FileInfoUI"  Width="422" Height="680" HorizontalAlignment="Center" VerticalAlignment="Center" Background="White" Visibility="Collapsed">
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                    </Grid.ColumnDefinitions>
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="auto"></RowDefinition>
-                        <RowDefinition Height="*"></RowDefinition>
-                    </Grid.RowDefinitions>
+                <cpdftools:CPDFInfoControl x:Name="CPDFInfoControl" Visibility="Collapsed"></cpdftools:CPDFInfoControl>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
-                    <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
-                        <Button.Content>
-                            <Path Fill="Black">
-                                <Path.Data>
-                                    M6.69495 6L11.5 1.19495L10.805 0.5L6 5.30505L1.19495 0.5L0.5 1.19495L5.30505 6L0.5 10.805L1.19495 11.5L6 6.69495L10.805 11.5L11.5 10.805L6.69495 6Z
-                                </Path.Data>
-                            </Path>
-                        </Button.Content>
-                    </Button>
-                    <cpdftools:CPDFInfoControl Grid.Row="1" Margin="25,10,25,0" Grid.ColumnSpan="2" Name="FileInfoControl"></cpdftools:CPDFInfoControl>
-                </Grid>
- 
                 <cpdfcommon:PasswordDialog x:Name="PasswordUI" Visibility="Collapsed"></cpdfcommon:PasswordDialog>
             </Grid>
 

+ 449 - 93
Demo/Examples/ContentEditor/MainWindow.xaml.cs

@@ -1,5 +1,6 @@
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFPage;
+using ComPDFKit.PDFPage.Edit;
 using Compdfkit_Tools.Edit;
 using Compdfkit_Tools.Helper;
 using Compdfkit_Tools.PDFControl;
@@ -18,7 +19,9 @@ using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
 using System.Windows.Input;
+using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using Point = System.Windows.Point;
 
 namespace ContentEditor
 {
@@ -83,6 +86,9 @@ namespace ContentEditor
 
         public event PropertyChangedEventHandler PropertyChanged;
 
+        private PDFEditEvent pdfTextCreateParam;
+
+        private KeyEventHandler KeyDownHandler;
         #endregion
 
         public MainWindow()
@@ -105,7 +111,6 @@ namespace ContentEditor
         }
 
         #region Load document
-
         private void LoadDocument()
         {
             if (pdfViewControl.PDFView.Document == null)
@@ -145,6 +150,12 @@ namespace ContentEditor
             PropertyContainer.Visibility = Visibility.Collapsed;
 
             SetEditMode();
+            if (KeyDownHandler != null)
+            {
+                pdfViewControl.PDFView.RemoveHandler(KeyDownEvent, KeyDownHandler);
+            }
+            KeyDownHandler = new KeyEventHandler(PDFView_KeyDown);
+            pdfViewControl.PDFView.AddHandler(KeyDownEvent, KeyDownHandler, false, true);
         }
 
         private void LoadDefaultDocument()
@@ -171,6 +182,7 @@ namespace ContentEditor
                     PasswordUI.ClearPassword();
                     PasswordUI.Visibility = Visibility.Collapsed;
                     PopupBorder.Visibility = Visibility.Collapsed;
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                 }
@@ -194,7 +206,7 @@ namespace ContentEditor
         }
 
         #endregion
-           
+
         #region Expand and collapse Panel
 
         private void ExpandLeftPanel(bool isExpand)
@@ -216,7 +228,7 @@ namespace ContentEditor
         #endregion
 
         #region Context menu
-         
+
         private void PDFView_AnnotCommandHandler(object sender, AnnotCommandArgs e)
         {
             if (e != null && e.CommandType == CommandType.Context)
@@ -561,6 +573,11 @@ namespace ContentEditor
                 editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
                 editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
                 editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
+                editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
+                if (editCommand.TextAreaCopied)
+                {
+                    editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Paste And Match Style", Command = CustomCommands.PasteMatchStyle, CommandTarget = (UIElement)sender });
+                }
             }
             else
             {
@@ -592,7 +609,7 @@ namespace ContentEditor
                 parentMenu.Items.Add(opacityMenu);
             }
         }
-         
+
         private void PDFEditTextContextMenu(object sender, PDFEditCommand editCommand)
         {
             editCommand.PopupMenu = new ContextMenu();
@@ -658,13 +675,16 @@ namespace ContentEditor
             }
             SetImageEditProperty();
         }
-        private void RightPanelBtn_Click(object sender, RoutedEventArgs e)
+
+        private void ControlRightPanel()
         {
-            ViewSettingBtn.IsChecked = false;
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
+            if ((bool)ViewSettingBtn.IsChecked)
+            {
+                ViewSettingBtn.IsChecked = false;
+            }
+            if (RightPanelButton != null)
             {
-                if (toggleButton.IsChecked == true)
+                if (RightPanelButton.IsChecked == true)
                 {
                     if (PropertyContainer.Child is CPDFDisplaySettingsControl)
                     {
@@ -684,35 +704,52 @@ namespace ContentEditor
             }
         }
 
-        private void ToolExpand_Click(object sender, RoutedEventArgs e)
+        private void RightPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlRightPanel();
+        }
+
+        private void ControlLeftPanel()
         {
-            ToggleButton expandBtn = sender as ToggleButton;
-            if (expandBtn != null)
+            if (LeftToolPanelButton != null)
             {
-                bool isExpand = expandBtn.IsChecked == true;
+                bool isExpand = LeftToolPanelButton.IsChecked == true;
                 ExpandLeftPanel(isExpand);
             }
         }
 
+        private void LeftToolPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlLeftPanel();
+        }
+
         private void ExpandSearchBtn_Click(object sender, RoutedEventArgs e)
         {
-            ToolExpandBtn.IsChecked = true;
+            LeftToolPanelButton.IsChecked = true;
             ExpandLeftPanel(true);
             BotaSideTool.SelectBotaTool(BOTATools.Search);
         }
 
-
-        private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
+        private void ShowViewSettings()
         {
-            RightPanelBtn.IsChecked = false;
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
+            if (RightPanelButton != null)
+            {
+                RightPanelButton.IsChecked = false;
+            }
+            if (ViewSettingBtn != null)
             {
-                if (toggleButton.IsChecked == true)
+                if (ViewSettingBtn.IsChecked == true)
                 {
                     CPDFDisplaySettingsControl displayPanel = new CPDFDisplaySettingsControl();
-                    displayPanel.SetSplitContainerVisibility(Visibility.Collapsed);
                     displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
+                    if (ViewComboBox.SelectedIndex == 1)
+                    {
+                        displayPanel.SetVisibilityWhenContentEdit(Visibility.Collapsed);
+                    }
+                    else
+                    {
+                        displayPanel.SetVisibilityWhenContentEdit(Visibility.Visible);
+                    }
                     prevPanel = PropertyContainer.Child;
                     PropertyContainer.Child = displayPanel;
                     PropertyContainer.Visibility = Visibility.Visible;
@@ -725,6 +762,11 @@ namespace ContentEditor
             }
         }
 
+        private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
+        {
+            ShowViewSettings();
+        }
+
         private void NextPageBorder_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
             pdfViewControl.PDFView?.GoToPage(pdfViewControl.PDFView.CurrentIndex + 1);
@@ -738,60 +780,61 @@ namespace ContentEditor
         private void PageInfoBtn_Click(object sender, RoutedEventArgs e)
         {
             PasswordUI.Visibility = Visibility.Collapsed;
-            FileInfoUI.Visibility = Visibility.Visible;
-            FileInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.Visibility = Visibility.Visible;
+            CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+            CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
             PopupBorder.Visibility = Visibility.Visible;
         }
 
-        private void FileInfoCloseBtn_Click(object sender, RoutedEventArgs e)
+        private void CPDFInfoControl_CloseInfoEvent(object sender, EventArgs e)
         {
             PopupBorder.Visibility = Visibility.Collapsed;
         }
 
-        private void OpenFile_Click(object sender, RoutedEventArgs e)
+        private void OpenFile()
         {
-            try
+            string filePath = CommonHelper.GetFilePathOrEmpty();
+            if (!string.IsNullOrEmpty(filePath) && pdfViewControl != null)
             {
-                string filePath = CommonHelper.GetFilePathOrEmpty();
-                if (!string.IsNullOrEmpty(filePath) && pdfViewControl != null)
+                if (pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
                 {
-                    if (pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
-                    {
-                        string oldFilePath = pdfViewControl.PDFView.Document.FilePath;
-                        if (oldFilePath.ToLower() == filePath.ToLower())
-                        {
-                            return;
-                        }
-                    }
-
-                    passwordViewer = new PDFViewControl();
-                    passwordViewer.PDFView.InitDocument(filePath);
-                    if (passwordViewer.PDFView.Document == null)
+                    string oldFilePath = pdfViewControl.PDFView.Document.FilePath;
+                    if (oldFilePath.ToLower() == filePath.ToLower())
                     {
-                        MessageBox.Show("Open File Failed");
                         return;
                     }
+                }
 
-                    if (passwordViewer.PDFView.Document.IsLocked)
-                    {
-                        PasswordUI.SetShowText(System.IO.Path.GetFileName(filePath) + " password encrypted.");
-                        PasswordUI.ClearPassword();
-                        PopupBorder.Visibility = Visibility.Visible;
-                        PasswordUI.Visibility = Visibility.Visible;
-                    }
-                    else
-                    {
-                        pdfViewControl = passwordViewer;
-                        LoadDocument();
-                    }
+                passwordViewer = new PDFViewControl();
+                passwordViewer.PDFView.InitDocument(filePath);
+                if (passwordViewer.PDFView.Document == null)
+                {
+                    MessageBox.Show("Open File Failed");
+                    return;
                 }
-            }
-            catch (Exception ex)
-            {
 
+                if (passwordViewer.PDFView.Document.IsLocked)
+                {
+                    PasswordUI.SetShowText(System.IO.Path.GetFileName(filePath) + " password encrypted.");
+                    PasswordUI.ClearPassword();
+                    PopupBorder.Visibility = Visibility.Visible;
+                    PasswordUI.Visibility = Visibility.Visible;
+                }
+                else
+                {
+                    pdfViewControl.PDFView.Document.Release();
+                    pdfViewControl = passwordViewer;
+                    LoadDocument();
+                }
             }
         }
 
+        private void OpenFile_Click(object sender, RoutedEventArgs e)
+        {
+            OpenFile();
+        }
+
         private void SaveFileBtn_Click(object sender, RoutedEventArgs e)
         {
             SaveFile();
@@ -803,26 +846,66 @@ namespace ContentEditor
             if (senderBtn != null && pdfViewControl != null)
             {
                 ClearPDFEditState(senderBtn);
-                RightPanelBtn.IsChecked = false;
-                if (PropertyContainer.Child != null)
-                {
-                    PropertyContainer.Child = empytPanel;
-                }
-
                 if (senderBtn.IsChecked == true)
                 {
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.Viewer);
+                    PDFEditEvent createParam = new PDFEditEvent();
+                    createParam.EditType = CPDFEditType.EditText;
+                    createParam.IsBold = false;
+                    createParam.IsItalic = false;
+                    createParam.FontSize = 14;
+                    createParam.FontName = "Helvetica";
+                    createParam.FontColor = Colors.Black;
+                    createParam.TextAlign = TextAlignType.AlignLeft;
+                    createParam.Transparency = 255;
+
+                    if (pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
+                    {
+                        CPDFDocument pdfDoc = pdfViewControl.PDFView.Document;
+                        if (pdfDoc.PageCount > 0)
+                        {
+                            CPDFPage pdfPage = pdfDoc.PageAtIndex(0);
+                            CPDFEditPage editPage = pdfPage.GetEditPage();
+                            editPage.BeginEdit(CPDFEditType.EditText);
+                            createParam.SystemFontNameList.AddRange(editPage.GetFontList());
+                            editPage.EndEdit();
+                        }
+                    }
+                   
                     pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.EditText);
                     pdfViewControl.PDFView?.SetPDFEditCreateType(CPDFEditType.EditText);
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.PDFEdit);
-                    pdfViewControl.PDFView?.ReloadDocument();
+                    pdfViewControl.PDFView?.SetPDFEditParam(createParam);
+                    if (textEditControl == null)
+                    {
+                        textEditControl = new PDFTextEditControl();
+                    }
+
+                    textEditControl.SetPDFTextEditData(createParam);
+                    PropertyContainer.Child = textEditControl;
+                    PropertyContainer.Visibility = Visibility.Visible;
+                    if ((bool)ViewSettingBtn.IsChecked)
+                    {
+                        ViewSettingBtn.IsChecked = false;
+                    }
+                    RightPanelButton.IsChecked = true;
+                    pdfTextCreateParam = createParam;
                 }
                 else
                 {
                     pdfViewControl.PDFView?.SetPDFEditCreateType(CPDFEditType.None);
                     pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.EditImage | CPDFEditType.EditText);
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.PDFEdit);
-                    pdfViewControl.PDFView?.ReloadDocument();
+                    RightPanelButton.IsChecked = false;
+                    if ((bool)ViewSettingBtn.IsChecked)
+                    {
+                        return;
+                    }
+                    else
+                    {
+                        if (PropertyContainer.Child != null)
+                        {
+                            PropertyContainer.Child = empytPanel;
+                        }
+                    }
+                    PropertyContainer.Visibility = Visibility.Collapsed;
                 }
             }
         }
@@ -832,24 +915,21 @@ namespace ContentEditor
             ToggleButton senderBtn = sender as ToggleButton;
             if (senderBtn != null && pdfViewControl != null)
             {
-                ClearPDFEditState(senderBtn);
                 senderBtn.IsChecked = false;
-
                 OpenFileDialog openFileDialog = new OpenFileDialog();
                 openFileDialog.Filter = "Image Files(*.jpg;*.jpeg;*.png;*.bmp)|*.jpg;*.jpeg;*.png;*.bmp;";
                 if (openFileDialog.ShowDialog() == true)
                 {
+                    ClearPDFEditState(senderBtn);
                     pdfViewControl.PDFView?.ClearSelectPDFEdit();
                     pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.EditImage | CPDFEditType.EditText);
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.PDFEdit);
-                    pdfViewControl.PDFView?.ReloadDocument();
 
-                    RightPanelBtn.IsChecked = false;
-                    if (PropertyContainer.Child != null)
+                    RightPanelButton.IsChecked = false;
+                    if (PropertyContainer.Child != null && !(bool)ViewSettingBtn.IsChecked)
                     {
                         PropertyContainer.Child = empytPanel;
+                        PropertyContainer.Visibility = Visibility.Collapsed;
                     }
-                    PropertyContainer.Visibility = Visibility.Collapsed;
                     pdfViewControl.PDFView?.SetPDFEditCreateType(CPDFEditType.EditImage);
                     pdfViewControl.PDFView?.AddPDFEditImage(openFileDialog.FileName);
                 }
@@ -892,7 +972,7 @@ namespace ContentEditor
         #endregion
 
         #region Property changed
-         
+
         protected void OnPropertyChanged([CallerMemberName] string name = null)
         {
             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
@@ -906,7 +986,7 @@ namespace ContentEditor
         #endregion
 
         #region Event handle
-         
+
         private void PDFView_PDFEditCommandHandler(object sender, PDFEditCommand e)
         {
             if (e == null)
@@ -931,12 +1011,26 @@ namespace ContentEditor
         {
             PDFEditEvent tempEvent = lastPDFEditEvent;
             lastPDFEditEvent = e;
-            ViewSettingBtn.IsChecked = false;
+            if ((bool)ViewSettingBtn.IsChecked)
+            {
+                ViewSettingBtn.IsChecked = false;
+                RightPanelButton.IsChecked = true;
+            }
             if (e == null)
             {
-                PropertyContainer.Child = null;
-                RightPanelBtn.IsChecked = false;
-                PropertyContainer.Visibility = Visibility.Collapsed;
+                PropertyContainer.Child = empytPanel;
+                if (pdfTextCreateParam != null && pdfViewControl != null && pdfViewControl.PDFView != null)
+                {
+                    if (pdfViewControl.PDFView.GetPDFEditCreateType() == CPDFEditType.EditText)
+                    {
+                        if (textEditControl == null)
+                        {
+                            textEditControl = new PDFTextEditControl();
+                        }
+                        textEditControl.SetPDFTextEditData(pdfTextCreateParam);
+                        PropertyContainer.Child = textEditControl;
+                    }
+                }
                 return;
             }
 
@@ -953,8 +1047,6 @@ namespace ContentEditor
                 }
                 textEditControl.SetPDFTextEditData(e);
                 PropertyContainer.Child = textEditControl;
-                PropertyContainer.Visibility = Visibility.Visible;
-                RightPanelBtn.IsChecked = true;
                 return;
             }
 
@@ -974,10 +1066,32 @@ namespace ContentEditor
             }
         }
 
-        #endregion 
+        #endregion
 
         #region Save file
 
+        /// <summary>
+        /// Save the file to another PDF file.
+        /// </summary>
+        public void SaveAsFile()
+        {
+            {
+                if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
+                {
+                    CPDFDocument pdfDoc = pdfViewControl.PDFView.Document;
+                    SaveFileDialog saveDialog = new SaveFileDialog();
+                    saveDialog.Filter = "(*.pdf)|*.pdf";
+                    saveDialog.DefaultExt = ".pdf";
+                    saveDialog.OverwritePrompt = true;
+
+                    if (saveDialog.ShowDialog() == true)
+                    {
+                        pdfDoc.WriteToFilePath(saveDialog.FileName);
+                    }
+                }
+            }
+        }
+
         private void SaveFile()
         {
             if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
@@ -1023,8 +1137,6 @@ namespace ContentEditor
                 imageEditControl.InitWithPDFViewer(pdfViewControl.PDFView);
                 imageEditControl.SetPDFImageEditData(lastPDFEditEvent);
                 PropertyContainer.Child = imageEditControl;
-                PropertyContainer.Visibility = Visibility.Visible;
-                RightPanelBtn.IsChecked = true;
             }
         }
 
@@ -1046,13 +1158,8 @@ namespace ContentEditor
                     pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.None);
                     pdfViewControl.PDFView?.SetMouseMode(MouseModes.Viewer);
                     pdfViewControl.PDFView?.ReloadDocument();
-                    if (PropertyContainer != null)
-                    {
-                        PropertyContainer.Child = null;
-                    }
-                    return;
-                }
 
+                }
                 if (ViewComboBox.SelectedIndex == 1)
                 {
                     PDFEditTool.Visibility = Visibility.Visible;
@@ -1062,10 +1169,147 @@ namespace ContentEditor
                     pdfViewControl.PDFView?.SetMouseMode(MouseModes.PDFEdit);
                     pdfViewControl.PDFView?.ReloadDocument();
                 }
+                RightPanelButton.IsChecked = false;
+                ViewSettingBtn.IsChecked = false;
+                PropertyContainer.Visibility = Visibility.Collapsed;
+                if (PropertyContainer != null)
+                {
+                    PropertyContainer.Child = null;
+                }
             }
         }
 
-        #endregion 
+        public void PDFView_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (pdfViewControl.PDFView.MouseMode != MouseModes.PDFEdit)
+            {
+                return;
+            }
+
+            if (Keyboard.Modifiers == ModifierKeys.Control)
+            {
+                if (e.Key == Key.Left)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypePreWord, false);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Right)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeNextWord, false);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Up)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeSectionBegin, false);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Down)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeSectionEnd, false);
+                    e.Handled = true;
+                }
+            }
+
+            if (Keyboard.Modifiers == ModifierKeys.Shift)
+            {
+                if (e.Key == Key.Left)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypePreCharPlace, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Right)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeNextCharPlace, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Up)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeUpCharPlace, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Down)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeDownCharPlace, true);
+                    e.Handled = true;
+                }
+            }
+
+            if (Keyboard.Modifiers == ModifierKeys.Alt)
+            {
+                if (e.SystemKey == Key.Up)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLocationLineBegin, false);
+                    e.Handled = true;
+                }
+
+                if (e.SystemKey == Key.Down)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeLineEnd, false);
+                    e.Handled = true;
+                }
+            }
+
+            if (Keyboard.Modifiers == ModifierKeys.None)
+            {
+                if (e.Key == Key.Left)
+                {
+                    pdfViewControl.PDFView.MoveEditArea(new Point(-5, 0));
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Right)
+                {
+                    pdfViewControl.PDFView.MoveEditArea(new Point(5, 0));
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Up)
+                {
+                    pdfViewControl.PDFView.MoveEditArea(new Point(0, -5));
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Down)
+                {
+                    pdfViewControl.PDFView.MoveEditArea(new Point(0, 5));
+                    e.Handled = true;
+                }
+            }
+
+            if (Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift))
+            {
+                if (e.Key == Key.Left)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypePreWord, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Right)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeNextWord, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Up)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeSectionBegin, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Down)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeSectionEnd, true);
+                    e.Handled = true;
+                }
+            }
+        }
+        #endregion
 
         #region Close window
 
@@ -1089,7 +1333,119 @@ namespace ContentEditor
             }
         }
 
-        #endregion 
+        #endregion
+
+        #region Shortcut
+        private void CommandBinding_Executed_Open(object sender, ExecutedRoutedEventArgs e)
+        {
+            OpenFile();
+        }
+
+        private void CommandBinding_Executed_Save(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (CanSave)
+            {
+                SaveFile();
+            }
+        }
+
+        private void CommandBinding_Executed_SaveAs(object sender, ExecutedRoutedEventArgs e)
+        {
+            SaveAsFile();
+        }
+
+        private void CommandBinding_Executed_Undo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (pdfViewControl != null && pdfViewControl.PDFView != null && CanUndo)
+            {
+                pdfViewControl.PDFView.UndoManager?.Undo();
+            }
+        }
+
+        private void CommandBinding_Executed_Redo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (pdfViewControl != null && pdfViewControl.PDFView != null && CanRedo)
+            {
+                pdfViewControl.PDFView.UndoManager?.Redo();
+            }
+        }
+
+        private void CommandBinding_Executed_ControlLeftPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            LeftToolPanelButton.IsChecked = !LeftToolPanelButton.IsChecked;
+            ControlLeftPanel();
+        }
+
+        private void CommandBinding_Executed_ControlRightPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            RightPanelButton.IsChecked = !RightPanelButton.IsChecked;
+            ControlRightPanel();
+        }
+
+        private void CommandBinding_Executed_Bookmark(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Bookmark);
+        }
+
+        private void CommandBinding_Executed_Outline(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Outline);
+        }
+
+        private void CommandBinding_Executed_Thumbnail(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Thumbnail);
+        }
+
+        private void CommandBinding_Executed_Search(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Search);
+        }
+
+        private void CommandBinding_Executed_ScaleAdd(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor + 0.01, true);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_ScaleSubtract(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor - 0.01, false);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_DisplaySettings(object sender, ExecutedRoutedEventArgs e)
+        {
+            ViewSettingBtn.IsChecked = !ViewSettingBtn.IsChecked;
+            ShowViewSettings();
+        }
+
+        private void CommandBinding_Executed_DocumentInfo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (PopupBorder.Visibility != Visibility.Visible)
+            {
+                PasswordUI.Visibility = Visibility.Collapsed;
+                CPDFInfoControl.Visibility = Visibility.Visible;
+                CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+                CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+                CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
+                PopupBorder.Visibility = Visibility.Visible;
+            } 
+            else
+            {
+                CPDFInfoControl.Visibility = Visibility.Collapsed;
+                PopupBorder.Visibility = Visibility.Collapsed;
+            }
+        }
+        #endregion
     }
 }
 

+ 7 - 38
Demo/Examples/ContentEditor/Properties/AssemblyInfo.cs

@@ -3,10 +3,7 @@ using System.Resources;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Windows;
-
-// 有关程序集的一般信息由以下
-// 控制。更改这些特性值可修改
-// 与程序集关联的信息。
+ 
 [assembly: AssemblyTitle("Content Editor_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
@@ -15,41 +12,13 @@ using System.Windows;
 [assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
-
-// 将 ComVisible 设置为 false 会使此程序集中的类型
-//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
-//请将此类型的 ComVisible 特性设置为 true。
+ 
 [assembly: ComVisible(false)]
 
-//若要开始生成可本地化的应用程序,请设置
-//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
-//例如,如果您在源文件中使用的是美国英语,
-//使用的是美国英语,请将 <UICulture> 设置为 en-US。  然后取消
-//对以下 NeutralResourceLanguage 特性的注释。  更新
-//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
 [assembly: ThemeInfo(
-    ResourceDictionaryLocation.None, //主题特定资源词典所处位置
-                                     //(未在页面中找到资源时使用,
-                                     //或应用程序资源字典中找到时使用)
-    ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
-                                              //(未在页面中找到资源时使用,
-                                              //、应用程序或任何主题专用资源字典中找到时使用)
+    ResourceDictionaryLocation.None,  
+    ResourceDictionaryLocation.SourceAssembly  
 )]
-
-
-// 程序集的版本信息由下列四个值组成: 
-//
-//      主版本
-//      次版本
-//      生成号
-//      修订号
-//
-//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
-//通过使用 "*",如下所示:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.9.0.0")]
-[assembly: AssemblyFileVersion("1.9.0.0")]
+ 
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 2 - 23
Demo/Examples/DocsEditor/App.xaml.cs

@@ -1,4 +1,5 @@
 using ComPDFKit.NativeMethod;
+using Compdfkit_Tools.Helper;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -11,26 +12,6 @@ using System.Xml;
 
 namespace DocsEditor
 {
-    public class SDKLicenseHelper
-    {
-        public string key = string.Empty;
-        public string secret = string.Empty;
-        public SDKLicenseHelper()
-        {
-
-            string sdkLicensePath = "license_key_win.xml";
-            Assembly assembly = Assembly.GetExecutingAssembly();
-            XmlDocument xmlDocument = new XmlDocument();
-            xmlDocument.Load(sdkLicensePath);
-            var node = xmlDocument.SelectSingleNode("License");
-            if (node != null)
-            {
-                key = node.Attributes["key"].Value;
-                secret = node.Attributes["secret"].Value;
-            }
-        }
-    }
-
     public partial class App : Application
     {
         protected override void OnStartup(StartupEventArgs e)
@@ -42,9 +23,7 @@ namespace DocsEditor
 
         private static bool LicenseVerify()
         {
-            bool result = false;
-
-            result = CPDFSDKVerifier.LoadNativeLibrary();
+            bool result = CPDFSDKVerifier.LoadNativeLibrary();
             if (!result)
                 return false;
 

+ 1 - 1
Demo/Examples/DocsEditor/DocsEditor.csproj

@@ -115,7 +115,7 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
-    <Content Include="..\license_key_win.xml">
+    <Content Include="..\license_key_windows.xml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     <Resource Include="ComPDFKit_Logo.ico" />

+ 52 - 26
Demo/Examples/DocsEditor/MainWindow.xaml

@@ -7,7 +7,7 @@
         xmlns:local="clr-namespace:DocsEditor"
         xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common;assembly=Compdfkit_Tools"
         mc:Ignorable="d"
-        Title="Docs Editor_ComPDFKit" Height="450" Width="800">
+        Title="Docs Editor_ComPDFKit V1.9.1" Height="450" Width="800">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
@@ -15,8 +15,56 @@
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
             </ResourceDictionary.MergedDictionaries>
+            <!-- Shortcut -->
+            <RoutedUICommand x:Key="Open" Text="Open"/>
+            <RoutedUICommand x:Key="Save" Text="Right rotate"/>
+            <RoutedUICommand x:Key="SaveAs" Text="Delete"/>
+            <RoutedUICommand x:Key="ControlLeftPanel" Text="Control left panel"/>
+            <RoutedUICommand x:Key="ControlRightPanel" Text="Control right panel"/>
+            <RoutedUICommand x:Key="GoToBookmark" Text="Go to bookmark"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToOutline" Text="Go to outline"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToThumbnail" Text="Go to thumbnail"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToSearch" Text="Go to search"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleAdd" Text="Scale add"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleSubtract" Text="Scale reduce"></RoutedUICommand>
+            <RoutedUICommand x:Key="DisplaySettings" Text="Display settings"></RoutedUICommand>
+            <RoutedUICommand x:Key="DocumentInfo" Text="Document infomation"></RoutedUICommand> 
         </ResourceDictionary>
     </Window.Resources>
+
+
+    <Window.CommandBindings>
+        <CommandBinding Command="{StaticResource Open}" Executed="CommandBinding_Executed_Open"/>
+        <CommandBinding Command="{StaticResource Save}" Executed="CommandBinding_Executed_Save"/>
+        <CommandBinding Command="{StaticResource SaveAs}" Executed="CommandBinding_Executed_SaveAs"/>
+        <CommandBinding Command="{StaticResource ControlLeftPanel}" Executed="CommandBinding_Executed_ControlLeftPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource ControlRightPanel}" Executed="CommandBinding_Executed_ControlRightPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToBookmark}" Executed="CommandBinding_Executed_Bookmark"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToOutline}" Executed="CommandBinding_Executed_Outline"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToThumbnail}" Executed="CommandBinding_Executed_Thumbnail"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToSearch}" Executed="CommandBinding_Executed_Search"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleAdd}" Executed="CommandBinding_Executed_ScaleAdd"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleSubtract}" Executed="CommandBinding_Executed_ScaleSubtract"></CommandBinding>
+        <CommandBinding Command="{StaticResource DisplaySettings}" Executed="CommandBinding_Executed_DisplaySettings"></CommandBinding>
+        <CommandBinding Command="{StaticResource DocumentInfo}" Executed="CommandBinding_Executed_DocumentInfo"></CommandBinding>
+    </Window.CommandBindings>
+
+    <Window.InputBindings>
+        <KeyBinding Key="O" Modifiers="Control" Command="{StaticResource Open}"/>
+        <KeyBinding Key="S" Modifiers="Control" Command="{StaticResource Save}"/>
+        <KeyBinding Key="S" Modifiers="Control+Shift" Command="{StaticResource SaveAs}"/>
+        <KeyBinding Key="F4" Command="{StaticResource ControlLeftPanel}"/>
+        <KeyBinding Key="F4" Modifiers="Control" Command="{StaticResource ControlRightPanel}"/>
+        <KeyBinding Key="B" Modifiers="Control" Command="{StaticResource GoToBookmark}"></KeyBinding>
+        <KeyBinding Key="O" Modifiers="Control+Shift" Command="{StaticResource GoToOutline}"></KeyBinding>
+        <KeyBinding Key="T" Modifiers="Control" Command="{StaticResource GoToThumbnail}"></KeyBinding>
+        <KeyBinding Key="F" Modifiers="Control" Command="{StaticResource GoToSearch}"></KeyBinding>
+        <KeyBinding Key="Add" Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
+        <KeyBinding Key="Subtract" Modifiers="Control" Command="{StaticResource ScaleSubtract}"></KeyBinding>
+        <KeyBinding Key="D" Modifiers="Control" Command="{StaticResource DisplaySettings}"></KeyBinding>
+        <KeyBinding Key="I" Modifiers="Control" Command="{StaticResource DocumentInfo}"></KeyBinding>
+    </Window.InputBindings>
+
     <Grid>
         <Grid>
             <Grid.RowDefinitions>
@@ -145,7 +193,7 @@
                         </ToggleButton.Content>
                     </ToggleButton>
 
-                    <ToggleButton  x:Name="RightToolPanelButton" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="RightToolPanelButton_Click">
+                    <ToggleButton  x:Name="RightPanelButton" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="RightPanelButton_Click">
                         <ToggleButton.Content>
                             <Path Fill="#43474D" Width="30" Height="30">
                                 <Path.Data>
@@ -208,7 +256,6 @@
                     <RowDefinition Height="auto"/>
                     <RowDefinition Height="*"/>
                 </Grid.RowDefinitions>
-
  
                 <cpdftools:CPDFBOTABarControl Grid.Row="1" Visibility="Collapsed" Name="BotaSideTool"/>
  
@@ -240,30 +287,9 @@
  
                     <cpdfcommon:PageNumberControl Grid.Row="1" Name="FloatPageTool" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20" Grid.Column="1"></cpdfcommon:PageNumberControl>
                     <Border Name="PopupBorder" Background="#A0000000" Visibility="Collapsed"  Grid.Row="1">
-                        <Grid> 
-                            <Grid Name="FileInfoUI"  Width="422" Height="680" HorizontalAlignment="Center" VerticalAlignment="Center" Background="White" Visibility="Collapsed">
-                                <Grid.ColumnDefinitions>
-                                    <ColumnDefinition Width="*"></ColumnDefinition>
-                                    <ColumnDefinition Width="*"></ColumnDefinition>
-                                </Grid.ColumnDefinitions>
-                                <Grid.RowDefinitions>
-                                    <RowDefinition Height="auto"></RowDefinition>
-                                    <RowDefinition Height="*"></RowDefinition>
-                                </Grid.RowDefinitions>
+                        <Grid>
+                            <cpdftools:CPDFInfoControl x:Name="CPDFInfoControl" Visibility="Collapsed"></cpdftools:CPDFInfoControl>
 
-                                <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
-                                <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
-                                    <Button.Content>
-                                        <Path Fill="Black">
-                                            <Path.Data>
-                                                M6.69495 6L11.5 1.19495L10.805 0.5L6 5.30505L1.19495 0.5L0.5 1.19495L5.30505 6L0.5 10.805L1.19495 11.5L6 6.69495L10.805 11.5L11.5 10.805L6.69495 6Z
-                                            </Path.Data>
-                                        </Path>
-                                    </Button.Content>
-                                </Button>
-                                <cpdftools:CPDFInfoControl Grid.Row="1" Margin="25,10,25,0" Grid.ColumnSpan="2" Name="FileInfoControl"></cpdftools:CPDFInfoControl>
-                            </Grid>
- 
                             <cpdfcommon:PasswordDialog x:Name="PasswordUI" Visibility="Collapsed"/>
                         </Grid>
 

+ 215 - 47
Demo/Examples/DocsEditor/MainWindow.xaml.cs

@@ -31,6 +31,7 @@ namespace DocsEditor
         private CPDFAnnotationControl pdfAnnotationControl = null;
         private CPDFSearchControl searchControl = null;
         private CPDFPageEditControl pageEditControl = null;
+        private CPDFDisplaySettingsControl displayPanel = new CPDFDisplaySettingsControl();
         private double[] zoomLevelList = { 1f, 8f, 12f, 25, 33f, 50, 66f, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
 
         public bool CanSave
@@ -45,12 +46,10 @@ namespace DocsEditor
             }
         }
 
-
         public event PropertyChangedEventHandler PropertyChanged;
 
         #endregion
 
-
         public MainWindow()
         {
             InitializeComponent();
@@ -72,13 +71,13 @@ namespace DocsEditor
             string defaultFilePath = "PDF32000_2008.pdf";
             LeftToolPanelButton.IsEnabled = false;
             SearchButton.IsEnabled = false;
-            RightToolPanelButton.IsEnabled = false;
+            RightPanelButton.IsEnabled = false;
             ViewSettingBtn.IsEnabled = false;
             pdfViewControl = new PDFViewControl();
             pdfViewControl.PDFView.InitDocument(defaultFilePath);
             LoadDocument();
         }
-         
+
         private void LoadDocument()
         {
             if (pdfViewControl.PDFView.Document == null)
@@ -140,7 +139,7 @@ namespace DocsEditor
         #endregion
 
         #region Context menu
-        
+
         private void PDFView_AnnotCommandHandler(object sender, AnnotCommandArgs e)
         {
             if (e != null && e.CommandType == CommandType.Context)
@@ -373,6 +372,7 @@ namespace DocsEditor
                     PasswordUI.ClearPassword();
                     PasswordUI.Visibility = Visibility.Collapsed;
                     PopupBorder.Visibility = Visibility.Collapsed;
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                 }
@@ -384,7 +384,6 @@ namespace DocsEditor
         }
 
         #endregion
-         
 
         #region Expand and collapse Panel
 
@@ -395,11 +394,10 @@ namespace DocsEditor
             PropertyContainer.Visibility = visible;
             if (visible == Visibility.Hidden || visible == Visibility.Collapsed)
             {
-                RightToolPanelButton.IsChecked = false;
+                RightPanelButton.IsChecked = false;
             }
         }
 
-
         private void ExpandLeftPanel(bool isExpand)
         {
             BotaSideTool.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
@@ -422,12 +420,20 @@ namespace DocsEditor
         private void PageInfoBtn_Click(object sender, RoutedEventArgs e)
         {
             PasswordUI.Visibility = Visibility.Collapsed;
-            FileInfoUI.Visibility = Visibility.Visible;
-            FileInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.Visibility = Visibility.Visible;
+            CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+            CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
             PopupBorder.Visibility = Visibility.Visible;
         }
 
-        private void OpenFile_Click(object sender, RoutedEventArgs e)
+        private void CPDFInfoControl_CloseInfoEvent(object sender, EventArgs e)
+        {
+            PopupBorder.Visibility = Visibility.Collapsed;
+        }
+
+
+        private void OpenFile()
         {
             string filePath = CommonHelper.GetFilePathOrEmpty();
             if (!string.IsNullOrEmpty(filePath) && pdfViewControl != null)
@@ -458,22 +464,32 @@ namespace DocsEditor
                 }
                 else
                 {
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                 }
             }
         }
 
-        private void LeftToolPanelButton_Click(object sender, RoutedEventArgs e)
+        private void OpenFile_Click(object sender, RoutedEventArgs e)
         {
-            ToggleButton expandBtn = sender as ToggleButton;
-            if (expandBtn != null)
+            OpenFile();
+        }
+
+        private void ControlLeftPanel()
+        {
+            if (LeftToolPanelButton != null)
             {
-                bool isExpand = expandBtn.IsChecked == true;
+                bool isExpand = LeftToolPanelButton.IsChecked == true;
                 ExpandLeftPanel(isExpand);
             }
         }
 
+        private void LeftToolPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlLeftPanel();
+        }
+
         private void SaveFileBtn_Click(object sender, RoutedEventArgs e)
         {
             SaveFile();
@@ -493,49 +509,35 @@ namespace DocsEditor
             BotaSideTool.SelectBotaTool(BOTATools.Search);
         }
 
-        private void RightToolPanelButton_Click(object sender, RoutedEventArgs e)
+        private void ControlRightPanel()
         {
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
+            if ((bool)ViewSettingBtn.IsChecked)
             {
-                if (toggleButton.IsChecked == true)
+                ViewSettingBtn.IsChecked = false;
+            }
+            if (RightPanelButton != null)
+            {
+                if (RightPanelButton.IsChecked == true)
                 {
                     ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
-                    if ((bool)ViewSettingBtn.IsChecked)
-                    {
-                        ViewSettingBtn.IsChecked = false;
-                    }
                 }
                 else
                 {
                     ExpandRightPropertyPanel(null, Visibility.Collapsed);
                 }
             }
+        }
 
+        private void RightPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlRightPanel();
         }
 
+
+
         private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
         {
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
-            {
-                if (toggleButton.IsChecked == true)
-                {
-                    CPDFDisplaySettingsControl displayPanel = new CPDFDisplaySettingsControl();
-                    displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
-                    PropertyContainer.Child = displayPanel;
-                    PropertyContainer.Visibility = Visibility.Visible;
-                    if ((bool)RightToolPanelButton.IsChecked)
-                    {
-                        RightToolPanelButton.IsChecked = false;
-                    }
-                }
-                else
-                {
-                    PropertyContainer.Child = null;
-                    PropertyContainer.Visibility = Visibility.Collapsed;
-                }
-            }
+            ShowViewSettings();
         }
 
         private double CheckZoomLevel(double zoom, bool IsGrowth)
@@ -571,6 +573,32 @@ namespace DocsEditor
         #endregion
 
         #region Save file
+
+        /// <summary>
+        /// Save the file to another PDF file.
+        /// </summary>
+        public void SaveAsFile()
+        {
+            {
+                if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
+                {
+                    CPDFDocument pdfDoc = pdfViewControl.PDFView.Document;
+                    SaveFileDialog saveDialog = new SaveFileDialog();
+                    saveDialog.Filter = "(*.pdf)|*.pdf";
+                    saveDialog.DefaultExt = ".pdf";
+                    saveDialog.OverwritePrompt = true;
+
+                    if (saveDialog.ShowDialog() == true)
+                    {
+                        pdfDoc.WriteToFilePath(saveDialog.FileName);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Save the file in the current path.
+        /// </summary>
         private void SaveFile()
         {
             if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
@@ -619,7 +647,7 @@ namespace DocsEditor
                     pdfViewControl.PDFView.ReloadDocument();
                     LeftToolPanelButton.IsEnabled = true;
                     SearchButton.IsEnabled = true;
-                    RightToolPanelButton.IsEnabled = true;
+                    RightPanelButton.IsEnabled = true;
                     ViewSettingBtn.IsEnabled = true;
                     break;
                 default:
@@ -645,8 +673,8 @@ namespace DocsEditor
                 LeftToolPanelButton.IsChecked = false;
                 LeftToolPanelButton.IsEnabled = false;
                 SearchButton.IsEnabled = false;
-                RightToolPanelButton.IsChecked = false;
-                RightToolPanelButton.IsEnabled = false;
+                RightPanelButton.IsChecked = false;
+                RightPanelButton.IsEnabled = false;
                 ViewSettingBtn.IsChecked = false;
                 ViewSettingBtn.IsEnabled = false;
                 ExpandLeftPanel(false);
@@ -668,7 +696,7 @@ namespace DocsEditor
         {
             ViewComboBox.SelectedIndex = 0;
         }
-         
+
         private void UndoManager_PropertyChanged(object sender, PropertyChangedEventArgs e)
         {
             OnPropertyChanged(e.PropertyName);
@@ -700,5 +728,145 @@ namespace DocsEditor
         }
 
         #endregion
+
+        #region Shortcut
+        private void CommandBinding_Executed_Open(object sender, ExecutedRoutedEventArgs e)
+        {
+            OpenFile();
+        }
+
+        private void CommandBinding_Executed_Save(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (CanSave)
+            {
+                SaveFile();
+            }
+        }
+
+        private void CommandBinding_Executed_SaveAs(object sender, ExecutedRoutedEventArgs e)
+        {
+            SaveAsFile();
+        }
+
+        private void CommandBinding_Executed_ControlLeftPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Page Edit")
+            {
+                LeftToolPanelButton.IsChecked = !LeftToolPanelButton.IsChecked;
+                ControlLeftPanel();
+            }
+        }
+
+        private void CommandBinding_Executed_ControlRightPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Page Edit")
+            {
+                RightPanelButton.IsChecked = !RightPanelButton.IsChecked;
+                ControlRightPanel();
+            }
+        }
+
+        private void CommandBinding_Executed_Bookmark(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Page Edit")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Bookmark);
+            }
+        }
+
+        private void CommandBinding_Executed_Outline(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Page Edit")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Outline);
+            }
+        }
+
+        private void CommandBinding_Executed_Thumbnail(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Page Edit")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Thumbnail);
+            }
+        }
+
+        private void CommandBinding_Executed_Search(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Page Edit")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Search);
+            }
+        }
+
+        private void CommandBinding_Executed_ScaleAdd(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor + 0.01, true);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_ScaleSubtract(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor - 0.01, false);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void ShowViewSettings()
+        {
+            if (ViewSettingBtn != null)
+            {
+                if (ViewSettingBtn.IsChecked == true)
+                {
+                    displayPanel = new CPDFDisplaySettingsControl();
+                    displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
+                    PropertyContainer.Child = displayPanel;
+                    PropertyContainer.Visibility = Visibility.Visible;
+                    if ((bool)RightPanelButton.IsChecked)
+                    {
+                        RightPanelButton.IsChecked = false;
+                    }
+                }
+                else
+                {
+                    PropertyContainer.Child = null;
+                    PropertyContainer.Visibility = Visibility.Collapsed;
+                }
+            }
+        }
+
+        private void CommandBinding_Executed_DisplaySettings(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Page Edit")
+            {
+                ViewSettingBtn.IsChecked = !ViewSettingBtn.IsChecked;
+                ShowViewSettings();
+            }
+        }
+
+        private void CommandBinding_Executed_DocumentInfo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (PopupBorder.Visibility != Visibility.Visible)
+            {
+                PasswordUI.Visibility = Visibility.Collapsed;
+                CPDFInfoControl.Visibility = Visibility.Visible;
+                CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+                CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+                CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
+                PopupBorder.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                CPDFInfoControl.Visibility = Visibility.Collapsed;
+                PopupBorder.Visibility = Visibility.Collapsed;
+            }
+        }
+        #endregion
     }
 }

+ 8 - 38
Demo/Examples/DocsEditor/Properties/AssemblyInfo.cs

@@ -3,10 +3,7 @@ using System.Resources;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Windows;
-
-// 有关程序集的一般信息由以下
-// 控制。更改这些特性值可修改
-// 与程序集关联的信息。
+ 
 [assembly: AssemblyTitle("Docs Editor_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
@@ -15,41 +12,14 @@ using System.Windows;
 [assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
-
-// 将 ComVisible 设置为 false 会使此程序集中的类型
-//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
-//请将此类型的 ComVisible 特性设置为 true。
+ 
 [assembly: ComVisible(false)]
-
-//若要开始生成可本地化的应用程序,请设置
-//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
-//例如,如果您在源文件中使用的是美国英语,
-//使用的是美国英语,请将 <UICulture> 设置为 en-US。  然后取消
-//对以下 NeutralResourceLanguage 特性的注释。  更新
-//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
+ 
 
 [assembly: ThemeInfo(
-    ResourceDictionaryLocation.None, //主题特定资源词典所处位置
-                                     //(未在页面中找到资源时使用,
-                                     //或应用程序资源字典中找到时使用)
-    ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
-                                              //(未在页面中找到资源时使用,
-                                              //、应用程序或任何主题专用资源字典中找到时使用)
+    ResourceDictionaryLocation.None,  
+    ResourceDictionaryLocation.SourceAssembly  
 )]
-
-
-// 程序集的版本信息由下列四个值组成: 
-//
-//      主版本
-//      次版本
-//      生成号
-//      修订号
-//
-//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
-//通过使用 "*",如下所示:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.9.0.0")]
-[assembly: AssemblyFileVersion("1.9.0.0")]
+ 
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 364 - 7
Demo/Examples/Examlpes.sln

@@ -5,7 +5,7 @@ VisualStudioVersion = 17.5.33516.290
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{43ED4BF9-5941-4F32-A9DC-016E94A0E74E}"
 	ProjectSection(SolutionItems) = preProject
-		license_key_win.xml = license_key_win.xml
+		license_key_windows.xml = license_key_windows.xml
 	EndProjectSection
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Viewer", "Viewer\Viewer.csproj", "{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}"
@@ -22,51 +22,408 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compdfkit_Tools", "Compdfki
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFViewer", "PDFViewer\PDFViewer.csproj", "{807EE747-34A1-4E03-8B72-9E9F6C3BB002}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestFile", "TestFile", "{0491A2B9-2C94-4D4F-9A7B-3B2B41631A28}"
-	ProjectSection(SolutionItems) = preProject
-		TestFile\developer_guide_windows.pdf = TestFile\developer_guide_windows.pdf
-		TestFile\Form_Widgets_Test.pdf = TestFile\Form_Widgets_Test.pdf
-		TestFile\PDF32000_2008.pdf = TestFile\PDF32000_2008.pdf
-	EndProjectSection
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{812D8275-2791-4CEF-A4E8-39A78E49D8FB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeaderFooterTest", "Samples\HeaderFooterTest\HeaderFooterTest.csproj", "{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BatesTest", "Samples\BatesTest\BatesTest.csproj", "{5CE5B624-B2B8-479C-8842-B70591B01124}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFRedactTest", "Samples\PDFRedactTest\PDFRedactTest.csproj", "{B18AD53B-9550-489B-A814-E2783D865D9C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFATest", "Samples\PDFATest\PDFATest.csproj", "{463C349B-D895-4191-B1FD-C507B16B6A8C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlattenTest", "Samples\FlattenTest\FlattenTest.csproj", "{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EncryptTest", "Samples\EncryptTest\EncryptTest.csproj", "{D225EA72-F34A-4AC6-9016-91F99D30DB81}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookmarkTest", "Samples\BookmarkTest\BookmarkTest.csproj", "{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageExtractTest", "Samples\ImageExtractTest\ImageExtractTest.csproj", "{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFPageTest", "Samples\PDFPageTest\PDFPageTest.csproj", "{B776A04B-C674-4A8B-88FC-2431034E8F78}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDFToImageTest", "Samples\PDFToImage\PDFToImageTest.csproj", "{82A11207-3CA9-47D2-9F1C-94FE057DABFE}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OutlineTest", "Samples\OutlineTest\OutlineTest.csproj", "{7323B63A-6073-4A22-82F5-29023702F2C1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentInfoTest", "Samples\DocumentInfoTest\DocumentInfoTest.csproj", "{274E1BD3-627D-46BC-8281-5440D7703EBF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatermarkTest", "Samples\WatermarkTest\WatermarkTest.csproj", "{8E440DCB-FCBC-4308-AB3D-50C38D017A40}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackgroundTest", "Samples\BackgroundTest\BackgroundTest.csproj", "{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnnotationTest", "Samples\AnnotationTest\AnnotationTest.csproj", "{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextSearchTest", "Samples\TextSearchTest\TextSearchTest.csproj", "{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnnotationImportExportTest", "Samples\AnnotationImportExportTest\AnnotationImportExportTest.csproj", "{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextExtractTest", "Samples\TextExtractTest\TextExtractTest.csproj", "{7D255150-76CB-4A65-AFEA-F88778ABF03B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentCompareTest", "Samples\DocumentCompare\DocumentCompareTest.csproj", "{0BB38D20-C3CF-47D7-8E2E-97195672AB67}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InteractiveFormsTest", "Samples\InteractiveFormsTest\InteractiveFormsTest.csproj", "{FB4B7306-DECC-457C-8F4C-6CE946F753D6}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Debug|x64.Build.0 = Debug|Any CPU
+		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Debug|x86.Build.0 = Debug|Any CPU
 		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Release|x64.ActiveCfg = Release|Any CPU
+		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Release|x64.Build.0 = Release|Any CPU
+		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Release|x86.ActiveCfg = Release|Any CPU
+		{A25DD47F-1FDF-48A1-8D0E-8CFF2C066A74}.Release|x86.Build.0 = Release|Any CPU
 		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Debug|x64.Build.0 = Debug|Any CPU
+		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Debug|x86.Build.0 = Debug|Any CPU
 		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Release|Any CPU.Build.0 = Release|Any CPU
+		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Release|x64.ActiveCfg = Release|Any CPU
+		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Release|x64.Build.0 = Release|Any CPU
+		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Release|x86.ActiveCfg = Release|Any CPU
+		{03BC0C60-9D99-41D5-8116-F2516CBFCE54}.Release|x86.Build.0 = Release|Any CPU
 		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Debug|x64.Build.0 = Debug|Any CPU
+		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Debug|x86.Build.0 = Debug|Any CPU
 		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Release|x64.ActiveCfg = Release|Any CPU
+		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Release|x64.Build.0 = Release|Any CPU
+		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Release|x86.ActiveCfg = Release|Any CPU
+		{0F35ACB7-E10B-4AAE-AA77-88E4602C3EFB}.Release|x86.Build.0 = Release|Any CPU
 		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Debug|x64.Build.0 = Debug|Any CPU
+		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Debug|x86.Build.0 = Debug|Any CPU
 		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Release|Any CPU.Build.0 = Release|Any CPU
+		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Release|x64.ActiveCfg = Release|Any CPU
+		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Release|x64.Build.0 = Release|Any CPU
+		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Release|x86.ActiveCfg = Release|Any CPU
+		{018AF31A-EDFB-42B1-A9DF-ECF950CA62B1}.Release|x86.Build.0 = Release|Any CPU
 		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Debug|x64.Build.0 = Debug|Any CPU
+		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Debug|x86.Build.0 = Debug|Any CPU
 		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Release|x64.ActiveCfg = Release|Any CPU
+		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Release|x64.Build.0 = Release|Any CPU
+		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Release|x86.ActiveCfg = Release|Any CPU
+		{F7A2B42C-55CC-4E48-A4DC-5E3239F23203}.Release|x86.Build.0 = Release|Any CPU
 		{9363BCB1-3A67-446A-8093-5708B86BF418}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{9363BCB1-3A67-446A-8093-5708B86BF418}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9363BCB1-3A67-446A-8093-5708B86BF418}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{9363BCB1-3A67-446A-8093-5708B86BF418}.Debug|x64.Build.0 = Debug|Any CPU
+		{9363BCB1-3A67-446A-8093-5708B86BF418}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{9363BCB1-3A67-446A-8093-5708B86BF418}.Debug|x86.Build.0 = Debug|Any CPU
 		{9363BCB1-3A67-446A-8093-5708B86BF418}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{9363BCB1-3A67-446A-8093-5708B86BF418}.Release|Any CPU.Build.0 = Release|Any CPU
+		{9363BCB1-3A67-446A-8093-5708B86BF418}.Release|x64.ActiveCfg = Release|Any CPU
+		{9363BCB1-3A67-446A-8093-5708B86BF418}.Release|x64.Build.0 = Release|Any CPU
+		{9363BCB1-3A67-446A-8093-5708B86BF418}.Release|x86.ActiveCfg = Release|Any CPU
+		{9363BCB1-3A67-446A-8093-5708B86BF418}.Release|x86.Build.0 = Release|Any CPU
 		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Debug|x64.Build.0 = Debug|Any CPU
+		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Debug|x86.Build.0 = Debug|Any CPU
 		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Release|Any CPU.Build.0 = Release|Any CPU
+		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Release|x64.ActiveCfg = Release|Any CPU
+		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Release|x64.Build.0 = Release|Any CPU
+		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Release|x86.ActiveCfg = Release|Any CPU
+		{807EE747-34A1-4E03-8B72-9E9F6C3BB002}.Release|x86.Build.0 = Release|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Debug|x64.Build.0 = Debug|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Debug|x86.Build.0 = Debug|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Release|x64.ActiveCfg = Release|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Release|x64.Build.0 = Release|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Release|x86.ActiveCfg = Release|Any CPU
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9}.Release|x86.Build.0 = Release|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Debug|x64.Build.0 = Debug|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Debug|x86.Build.0 = Debug|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Release|x64.ActiveCfg = Release|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Release|x64.Build.0 = Release|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Release|x86.ActiveCfg = Release|Any CPU
+		{5CE5B624-B2B8-479C-8842-B70591B01124}.Release|x86.Build.0 = Release|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Debug|x64.Build.0 = Debug|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Debug|x86.Build.0 = Debug|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Release|x64.ActiveCfg = Release|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Release|x64.Build.0 = Release|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Release|x86.ActiveCfg = Release|Any CPU
+		{B18AD53B-9550-489B-A814-E2783D865D9C}.Release|x86.Build.0 = Release|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Debug|x64.Build.0 = Debug|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Debug|x86.Build.0 = Debug|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Release|x64.ActiveCfg = Release|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Release|x64.Build.0 = Release|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Release|x86.ActiveCfg = Release|Any CPU
+		{463C349B-D895-4191-B1FD-C507B16B6A8C}.Release|x86.Build.0 = Release|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Debug|x64.Build.0 = Debug|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Debug|x86.Build.0 = Debug|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Release|x64.ActiveCfg = Release|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Release|x64.Build.0 = Release|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Release|x86.ActiveCfg = Release|Any CPU
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E}.Release|x86.Build.0 = Release|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Debug|x64.Build.0 = Debug|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Debug|x86.Build.0 = Debug|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Release|x64.ActiveCfg = Release|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Release|x64.Build.0 = Release|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Release|x86.ActiveCfg = Release|Any CPU
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81}.Release|x86.Build.0 = Release|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Debug|x64.Build.0 = Debug|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Debug|x86.Build.0 = Debug|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Release|Any CPU.Build.0 = Release|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Release|x64.ActiveCfg = Release|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Release|x64.Build.0 = Release|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Release|x86.ActiveCfg = Release|Any CPU
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}.Release|x86.Build.0 = Release|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Debug|x64.Build.0 = Debug|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Debug|x86.Build.0 = Debug|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Release|x64.ActiveCfg = Release|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Release|x64.Build.0 = Release|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Release|x86.ActiveCfg = Release|Any CPU
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F}.Release|x86.Build.0 = Release|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Debug|x64.Build.0 = Debug|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Debug|x86.Build.0 = Debug|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Release|x64.ActiveCfg = Release|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Release|x64.Build.0 = Release|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Release|x86.ActiveCfg = Release|Any CPU
+		{B776A04B-C674-4A8B-88FC-2431034E8F78}.Release|x86.Build.0 = Release|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Debug|x64.Build.0 = Debug|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Debug|x86.Build.0 = Debug|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Release|Any CPU.Build.0 = Release|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Release|x64.ActiveCfg = Release|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Release|x64.Build.0 = Release|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Release|x86.ActiveCfg = Release|Any CPU
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE}.Release|x86.Build.0 = Release|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Debug|x64.Build.0 = Debug|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Debug|x86.Build.0 = Debug|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Release|x64.ActiveCfg = Release|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Release|x64.Build.0 = Release|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Release|x86.ActiveCfg = Release|Any CPU
+		{7323B63A-6073-4A22-82F5-29023702F2C1}.Release|x86.Build.0 = Release|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Debug|x64.Build.0 = Debug|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Debug|x86.Build.0 = Debug|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Release|x64.ActiveCfg = Release|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Release|x64.Build.0 = Release|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Release|x86.ActiveCfg = Release|Any CPU
+		{274E1BD3-627D-46BC-8281-5440D7703EBF}.Release|x86.Build.0 = Release|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Debug|x64.Build.0 = Debug|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Debug|x86.Build.0 = Debug|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Release|x64.ActiveCfg = Release|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Release|x64.Build.0 = Release|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Release|x86.ActiveCfg = Release|Any CPU
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40}.Release|x86.Build.0 = Release|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Debug|x64.Build.0 = Debug|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Debug|x86.Build.0 = Debug|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Release|x64.ActiveCfg = Release|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Release|x64.Build.0 = Release|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Release|x86.ActiveCfg = Release|Any CPU
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}.Release|x86.Build.0 = Release|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Debug|x64.Build.0 = Debug|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Debug|x86.Build.0 = Debug|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Release|Any CPU.Build.0 = Release|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Release|x64.ActiveCfg = Release|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Release|x64.Build.0 = Release|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Release|x86.ActiveCfg = Release|Any CPU
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}.Release|x86.Build.0 = Release|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Debug|x64.Build.0 = Debug|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Debug|x86.Build.0 = Debug|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Release|x64.ActiveCfg = Release|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Release|x64.Build.0 = Release|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Release|x86.ActiveCfg = Release|Any CPU
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04}.Release|x86.Build.0 = Release|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Debug|x64.Build.0 = Debug|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Debug|x86.Build.0 = Debug|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|x64.ActiveCfg = Release|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|x64.Build.0 = Release|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|x86.ActiveCfg = Release|Any CPU
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|x86.Build.0 = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|x64.Build.0 = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|x86.Build.0 = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|x64.ActiveCfg = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|x64.Build.0 = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|x86.ActiveCfg = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|x86.Build.0 = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|x64.Build.0 = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|x86.Build.0 = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|x64.ActiveCfg = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|x64.Build.0 = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|x86.ActiveCfg = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|x86.Build.0 = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|x64.Build.0 = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|x86.Build.0 = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|Any CPU.Build.0 = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|x64.ActiveCfg = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|x64.Build.0 = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|x86.ActiveCfg = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{5AF53BD9-A085-4550-8F78-98CCFFFDCDA9} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{5CE5B624-B2B8-479C-8842-B70591B01124} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{B18AD53B-9550-489B-A814-E2783D865D9C} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{463C349B-D895-4191-B1FD-C507B16B6A8C} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{34BE4547-F57E-473C-A4D9-2EFEDAC6B87E} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{D225EA72-F34A-4AC6-9016-91F99D30DB81} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{DEAF0496-2E3D-4A76-B24E-0E672B21ED3F} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{B776A04B-C674-4A8B-88FC-2431034E8F78} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{82A11207-3CA9-47D2-9F1C-94FE057DABFE} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{7323B63A-6073-4A22-82F5-29023702F2C1} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{274E1BD3-627D-46BC-8281-5440D7703EBF} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{8E440DCB-FCBC-4308-AB3D-50C38D017A40} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {8EE774F1-5FBF-482A-9A31-5ABDEC216DEF}
 	EndGlobalSection

+ 2 - 22
Demo/Examples/Forms/App.xaml.cs

@@ -1,4 +1,5 @@
 using ComPDFKit.NativeMethod;
+using Compdfkit_Tools.Helper;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -11,26 +12,6 @@ using System.Xml;
 
 namespace Forms
 {
-    public class SDKLicenseHelper
-    {
-        public string key = string.Empty;
-        public string secret = string.Empty;
-        public SDKLicenseHelper()
-        {
-
-            string sdkLicensePath = "license_key_win.xml";
-            Assembly assembly = Assembly.GetExecutingAssembly();
-            XmlDocument xmlDocument = new XmlDocument();
-            xmlDocument.Load(sdkLicensePath);
-            var node = xmlDocument.SelectSingleNode("License");
-            if (node != null)
-            {
-                key = node.Attributes["key"].Value;
-                secret = node.Attributes["secret"].Value;
-            }
-        }
-
-    }
 
     public partial class App : Application
     {
@@ -43,8 +24,7 @@ namespace Forms
 
         private static bool LicenseVerify()
         {
-            bool result = false;
-            result = CPDFSDKVerifier.LoadNativeLibrary();
+            bool result = CPDFSDKVerifier.LoadNativeLibrary();
             if (!result)
                 return false;
 

+ 1 - 1
Demo/Examples/Forms/Forms.csproj

@@ -117,7 +117,7 @@
   </ItemGroup>
   <ItemGroup>
     <Resource Include="ComPDFKit_Logo.ico" />
-    <None Include="..\license_key_win.xml">
+    <None Include="..\license_key_windows.xml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>

+ 58 - 27
Demo/Examples/Forms/MainWindow.xaml

@@ -6,7 +6,7 @@
         xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl;assembly=Compdfkit_Tools"
         xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common;assembly=Compdfkit_Tools"
         mc:Ignorable="d"
-        Title="Forms_ComPDFKit" Height="720" Width="1080"  WindowStartupLocation="CenterScreen">
+        Title="Forms_ComPDFKit V1.9.1" Height="720" Width="1080"  WindowStartupLocation="CenterScreen">
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
@@ -14,8 +14,61 @@
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
             </ResourceDictionary.MergedDictionaries>
+            <!-- Shortcut --> 
+            <RoutedUICommand x:Key="Open" Text="Open"/>
+            <RoutedUICommand x:Key="Save" Text="Right rotate"/>
+            <RoutedUICommand x:Key="SaveAs" Text="Delete"/>
+            <RoutedUICommand x:Key="Undo" Text="Undo"/>
+            <RoutedUICommand x:Key="Redo" Text="Redo"/>
+            <RoutedUICommand x:Key="ControlLeftPanel" Text="Control left panel"/>
+            <RoutedUICommand x:Key="ControlRightPanel" Text="Control right panel"/>
+            <RoutedUICommand x:Key="GoToBookmark" Text="Go to bookmark"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToOutline" Text="Go to outline"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToThumbnail" Text="Go to thumbnail"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToSearch" Text="Go to search"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleAdd" Text="Scale add"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleSubtract" Text="Scale reduce"></RoutedUICommand>
+            <RoutedUICommand x:Key="DisplaySettings" Text="Display settings"></RoutedUICommand>
+            <RoutedUICommand x:Key="DocumentInfo" Text="Document infomation"></RoutedUICommand>
         </ResourceDictionary>
     </Window.Resources>
+    
+    <Window.CommandBindings>
+        <CommandBinding Command="{StaticResource Open}" Executed="CommandBinding_Executed_Open"/>
+        <CommandBinding Command="{StaticResource Save}" Executed="CommandBinding_Executed_Save"/>
+        <CommandBinding Command="{StaticResource SaveAs}" Executed="CommandBinding_Executed_SaveAs"/>
+        <CommandBinding Command="{StaticResource Undo}" Executed="CommandBinding_Executed_Undo"/>
+        <CommandBinding Command="{StaticResource Redo}" Executed="CommandBinding_Executed_Redo"/>
+        <CommandBinding Command="{StaticResource ControlLeftPanel}" Executed="CommandBinding_Executed_ControlLeftPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource ControlRightPanel}" Executed="CommandBinding_Executed_ControlRightPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToBookmark}" Executed="CommandBinding_Executed_Bookmark"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToOutline}" Executed="CommandBinding_Executed_Outline"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToThumbnail}" Executed="CommandBinding_Executed_Thumbnail"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToSearch}" Executed="CommandBinding_Executed_Search"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleAdd}" Executed="CommandBinding_Executed_ScaleAdd"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleSubtract}" Executed="CommandBinding_Executed_ScaleSubtract"></CommandBinding>
+        <CommandBinding Command="{StaticResource DisplaySettings}" Executed="CommandBinding_Executed_DisplaySettings"></CommandBinding>
+        <CommandBinding Command="{StaticResource DocumentInfo}" Executed="CommandBinding_Executed_DocumentInfo"></CommandBinding>
+    </Window.CommandBindings>
+
+    <Window.InputBindings>
+        <KeyBinding Key="O" Modifiers="Control" Command="{StaticResource Open}"/>
+        <KeyBinding Key="S" Modifiers="Control" Command="{StaticResource Save}"/>
+        <KeyBinding Key="S" Modifiers="Control+Shift" Command="{StaticResource SaveAs}"/>
+        <KeyBinding Key="Z" Modifiers="Control" Command="{StaticResource Undo}"/>
+        <KeyBinding Key="Y" Modifiers="Control" Command="{StaticResource Redo}"/>
+        <KeyBinding Key="F4" Command="{StaticResource ControlLeftPanel}"/>
+        <KeyBinding Key="F4" Modifiers="Control" Command="{StaticResource ControlRightPanel}"/>
+        <KeyBinding Key="B" Modifiers="Control" Command="{StaticResource GoToBookmark}"></KeyBinding>
+        <KeyBinding Key="O" Modifiers="Control+Shift" Command="{StaticResource GoToOutline}"></KeyBinding>
+        <KeyBinding Key="T" Modifiers="Control" Command="{StaticResource GoToThumbnail}"></KeyBinding>
+        <KeyBinding Key="F" Modifiers="Control" Command="{StaticResource GoToSearch}"></KeyBinding>
+        <KeyBinding Key="Add" Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
+        <KeyBinding Key="Subtract" Modifiers="Control" Command="{StaticResource ScaleSubtract}"></KeyBinding>
+        <KeyBinding Key="D" Modifiers="Control" Command="{StaticResource DisplaySettings}"></KeyBinding>
+        <KeyBinding Key="I" Modifiers="Control" Command="{StaticResource DocumentInfo}"></KeyBinding>
+    </Window.InputBindings>
+    
     <Grid>
         <Grid>
             <Grid.RowDefinitions>
@@ -89,8 +142,8 @@
                             <ToolTip Content="Save"></ToolTip>
                         </Button.ToolTip>
                     </Button>
- 
-                    <ToggleButton Name="ToolExpandBtn" Margin="13,0,0,0" BorderThickness="0" Width="30" Height="30" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="ToolExpand_Click">
+
+                    <ToggleButton Name="LeftToolPanelButton" Margin="13,0,0,0" BorderThickness="0" Width="30" Height="30" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="LeftToolPanelButton_Click">
                         <ToggleButton.Content>
                             <Path Fill="#43474D" Width="30" Height="30">
                                 <Path.Data>
@@ -166,7 +219,7 @@
                         </ToggleButton.Content>
                     </ToggleButton>
 
-                    <ToggleButton  x:Name="FormBarBtn" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="FormBarBtn_Click">
+                    <ToggleButton  x:Name="RightPanelButton" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="RightPanelButton_Click">
                         <ToggleButton.Content>
                             <Path Fill="#43474D" Width="30" Height="30">
                                 <Path.Data>
@@ -323,30 +376,8 @@
 
         <Border Name="PopupBorder" Background="#A0000000" Visibility="Collapsed">
             <Grid>
- 
-                <Grid Name="FileInfoUI"  Width="422" Height="680" HorizontalAlignment="Center" VerticalAlignment="Center" Background="White" Visibility="Collapsed">
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                    </Grid.ColumnDefinitions>
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="auto"></RowDefinition>
-                        <RowDefinition Height="*"></RowDefinition>
-                    </Grid.RowDefinitions>
+                <cpdftools:CPDFInfoControl x:Name="CPDFInfoControl" Visibility="Collapsed"></cpdftools:CPDFInfoControl>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
-                    <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
-                        <Button.Content>
-                            <Path Fill="Black">
-                                <Path.Data>
-                                    M6.69495 6L11.5 1.19495L10.805 0.5L6 5.30505L1.19495 0.5L0.5 1.19495L5.30505 6L0.5 10.805L1.19495 11.5L6 6.69495L10.805 11.5L11.5 10.805L6.69495 6Z
-                                </Path.Data>
-                            </Path>
-                        </Button.Content>
-                    </Button>
-                    <cpdftools:CPDFInfoControl Grid.Row="1" Margin="25,10,25,0" Grid.ColumnSpan="2" Name="FileInfoControl"></cpdftools:CPDFInfoControl>
-                </Grid>
- 
                 <cpdfcommon:PasswordDialog x:Name="PasswordUI" Visibility="Collapsed"></cpdfcommon:PasswordDialog>
             </Grid>
 

+ 211 - 52
Demo/Examples/Forms/MainWindow.xaml.cs

@@ -19,6 +19,7 @@ using ComPDFKit.PDFPage;
 using ComPDFKitViewer.PdfViewer;
 using System.ComponentModel;
 using System.Runtime.CompilerServices;
+using Compdfkit_Tools.Edit;
 
 namespace Forms
 {
@@ -28,7 +29,7 @@ namespace Forms
         private PDFViewControl passwordViewer;
         private PDFViewControl pdfViewControl;
         private CPDFSearchControl searchControl = null;
-        private FromPropertyControl fromPropertyControl;
+        private FromPropertyControl formPropertyControl;
 
         bool LoadPDFFormTool = false;
 
@@ -72,7 +73,7 @@ namespace Forms
 
         public event PropertyChangedEventHandler PropertyChanged;
         #endregion
-         
+
         public MainWindow()
         {
             InitializeComponent();
@@ -84,7 +85,7 @@ namespace Forms
         private void MainWindow_Loaded(object sender, RoutedEventArgs e)
         {
             BotaSideTool.AddBOTAContent(BOTATools.Thumbnail | BOTATools.Outline | BOTATools.Bookmark | BOTATools.Search);
-            fromPropertyControl = new FromPropertyControl();
+            formPropertyControl = new FromPropertyControl();
             LoadDefaultDocument();
         }
 
@@ -140,18 +141,21 @@ namespace Forms
             pdfViewControl.PDFView.InitDocument(defaultFilePath);
             LoadDocument();
         }
-         
+
         public void InitialPDFViewControl(PDFViewControl newPDFViewer)
         {
-            PDFFormTool.InitWithPDFViewer(newPDFViewer.PDFView, fromPropertyControl);
-            fromPropertyControl.SetPDFViewer(newPDFViewer.PDFView);
+            PDFFormTool.InitWithPDFViewer(newPDFViewer.PDFView, formPropertyControl);
+            formPropertyControl.SetPDFViewer(newPDFViewer.PDFView);
             PDFFormTool.ClearAllToolState();
             newPDFViewer.PDFView.AnnotEditHandler += PDFView_AnnotEditHandler;
             newPDFViewer.PDFView.AnnotActiveHandler += PDFView_AnnotActiveHandler;
             newPDFViewer.CustomSignHandle = true;
             newPDFViewer.PDFView.WidgetClickHandler += PDFView_WidgetClickHandler;
         }
-         
+
+        /// <summary>
+        /// Save the file in the current path.
+        /// </summary>
         private void SaveFile()
         {
             if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
@@ -175,6 +179,27 @@ namespace Forms
             }
         }
 
+        /// <summary>
+        /// Save the file to another PDF file.
+        /// </summary>
+        public void SaveAsFile()
+        {
+            {
+                if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
+                {
+                    CPDFDocument pdfDoc = pdfViewControl.PDFView.Document;
+                    SaveFileDialog saveDialog = new SaveFileDialog();
+                    saveDialog.Filter = "(*.pdf)|*.pdf";
+                    saveDialog.DefaultExt = ".pdf";
+                    saveDialog.OverwritePrompt = true;
+
+                    if (saveDialog.ShowDialog() == true)
+                    {
+                        pdfDoc.WriteToFilePath(saveDialog.FileName);
+                    }
+                }
+            }
+        }
         #endregion
 
         #region Property changed 
@@ -367,6 +392,7 @@ namespace Forms
                     PasswordUI.ClearPassword();
                     PasswordUI.Visibility = Visibility.Collapsed;
                     PopupBorder.Visibility = Visibility.Collapsed;
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                 }
@@ -392,6 +418,27 @@ namespace Forms
 
         #region Expand and collapse panel 
 
+        private void ControlRightPanel()
+        {
+            if (RightPanelButton != null)
+            {
+                if (RightPanelButton.IsChecked == true)
+                {
+
+                    ExpandRightPropertyPanel(formPropertyControl, Visibility.Visible);
+
+                    if ((bool)ViewSettingBtn.IsChecked)
+                    {
+                        ViewSettingBtn.IsChecked = false;
+                    }
+                }
+                else
+                {
+                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                }
+            }
+        }
+
         private void ExpandLeftPanel(bool isExpand)
         {
             BotaSideTool.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
@@ -462,37 +509,40 @@ namespace Forms
             return standardZoom / 100;
         }
 
-        private void ToolExpand_Click(object sender, RoutedEventArgs e)
+        private void ControlLeftPanel()
         {
-            ToggleButton expandBtn = sender as ToggleButton;
-            if (expandBtn != null)
+            if (LeftToolPanelButton != null)
             {
-                bool isExpand = expandBtn.IsChecked == true;
+                bool isExpand = LeftToolPanelButton.IsChecked == true;
                 ExpandLeftPanel(isExpand);
             }
         }
 
+        private void LeftToolPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlLeftPanel();
+        }
+
         private void ExpandSearchBtn_Click(object sender, RoutedEventArgs e)
         {
             ExpandLeftPanel(true);
-            ToolExpandBtn.IsChecked = true;
+            LeftToolPanelButton.IsChecked = true;
             BotaSideTool.SelectBotaTool(BOTATools.Search);
         }
 
-        private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
+        private void ShowViewSettings()
         {
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
+            if (ViewSettingBtn != null)
             {
-                if (toggleButton.IsChecked == true)
+                if (ViewSettingBtn.IsChecked == true)
                 {
                     CPDFDisplaySettingsControl displayPanel = new CPDFDisplaySettingsControl();
                     displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
                     PropertyContainer.Child = displayPanel;
                     PropertyContainer.Visibility = Visibility.Visible;
-                    if ((bool)FormBarBtn.IsChecked)
+                    if ((bool)RightPanelButton.IsChecked)
                     {
-                        FormBarBtn.IsChecked = false;
+                        RightPanelButton.IsChecked = false;
                     }
                 }
                 else
@@ -503,25 +553,14 @@ namespace Forms
             }
         }
 
-        private void FormBarBtn_Click(object sender, RoutedEventArgs e)
+        private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
         {
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
-            {
-                if (toggleButton.IsChecked == true)
-                {
+            ShowViewSettings();
+        }
 
-                    ExpandRightPropertyPanel(fromPropertyControl, Visibility.Visible);
-                    if ((bool)ViewSettingBtn.IsChecked)
-                    {
-                        ViewSettingBtn.IsChecked = false;
-                    }
-                }
-                else
-                {
-                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
-                }
-            }
+        private void RightPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlRightPanel();
         }
 
         private void NextPageBorder_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
@@ -537,17 +576,19 @@ namespace Forms
         private void PageInfoBtn_Click(object sender, RoutedEventArgs e)
         {
             PasswordUI.Visibility = Visibility.Collapsed;
-            FileInfoUI.Visibility = Visibility.Visible;
-            FileInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.Visibility = Visibility.Visible;
+            CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+            CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
             PopupBorder.Visibility = Visibility.Visible;
         }
 
-        private void FileInfoCloseBtn_Click(object sender, RoutedEventArgs e)
+        private void CPDFInfoControl_CloseInfoEvent(object sender, EventArgs e)
         {
             PopupBorder.Visibility = Visibility.Collapsed;
         }
 
-        private void OpenFile_Click(object sender, RoutedEventArgs e)
+        private void OpenFile()
         {
             string filePath = CommonHelper.GetFilePathOrEmpty();
             if (!string.IsNullOrEmpty(filePath) && pdfViewControl != null)
@@ -578,12 +619,18 @@ namespace Forms
                 }
                 else
                 {
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                 }
             }
         }
 
+        private void OpenFile_Click(object sender, RoutedEventArgs e)
+        {
+            OpenFile();
+        }
+
         private void SaveFileBtn_Click(object sender, RoutedEventArgs e)
         {
             SaveFile();
@@ -665,10 +712,10 @@ namespace Forms
                     pdfViewControl.PDFView?.ReloadDocument();
                     if (PropertyContainer != null)
                     {
-                        fromPropertyControl.CleanProperty();
+                        formPropertyControl.CleanProperty();
                         PropertyContainer.Child = null;
                         ViewSettingBtn.IsChecked = false;
-                        FormBarBtn.IsChecked = false;
+                        RightPanelButton.IsChecked = false;
                     }
                     return;
                 }
@@ -683,10 +730,10 @@ namespace Forms
                     pdfViewControl.PDFView?.ReloadDocument();
                     if (PropertyContainer != null)
                     {
-                        fromPropertyControl.CleanProperty();
+                        formPropertyControl.CleanProperty();
                         PropertyContainer.Child = null;
                         ViewSettingBtn.IsChecked = false;
-                        FormBarBtn.IsChecked = false;
+                        RightPanelButton.IsChecked = false;
                     }
                 }
             }
@@ -699,13 +746,13 @@ namespace Forms
         {
             if (e is WidgetSignArgs)
             {
-                FormBarBtn.IsChecked = true;
-                ExpandRightPropertyPanel(fromPropertyControl, Visibility.Visible);
-                fromPropertyControl.SetPropertyForType(e, null);
+                RightPanelButton.IsChecked = true;
+                ExpandRightPropertyPanel(formPropertyControl, Visibility.Visible);
+                formPropertyControl.SetPropertyForType(e, null);
             }
             else
             {
-                FormBarBtn.IsChecked = false;
+                RightPanelButton.IsChecked = false;
                 ExpandRightPropertyPanel(null, Visibility.Collapsed);
             }
         }
@@ -714,7 +761,7 @@ namespace Forms
         {
             if (e == null || e.IsAnnotCreateReset)
             {
-                fromPropertyControl.SetPropertyForType(null, null);
+                formPropertyControl.SetPropertyForType(null, null);
             }
             else
             {
@@ -727,17 +774,17 @@ namespace Forms
                             case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_PUSHBUTTON:
                             case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_COMBOBOX:
                             case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_LISTBOX:
-                                ExpandRightPropertyPanel(fromPropertyControl, Visibility.Visible);
+                                ExpandRightPropertyPanel(formPropertyControl, Visibility.Visible);
                                 if ((bool)ViewSettingBtn.IsChecked)
                                 {
                                     ViewSettingBtn.IsChecked = false;
                                 }
-                                FormBarBtn.IsChecked = true;
+                                RightPanelButton.IsChecked = true;
                                 break;
                             default:
                                 break;
                         }
-                        fromPropertyControl.SetPropertyForType(formArgs, e);
+                        formPropertyControl.SetPropertyForType(formArgs, e);
                         break;
                 }
             }
@@ -795,7 +842,7 @@ namespace Forms
                 }
                 else if (editEvent.EditAction == ActionType.Del)
                 {
-                    fromPropertyControl.CleanProperty();
+                    formPropertyControl.CleanProperty();
                 }
             }
         }
@@ -822,5 +869,117 @@ namespace Forms
             }
         }
         #endregion
+
+        #region Shortcut
+        private void CommandBinding_Executed_Open(object sender, ExecutedRoutedEventArgs e)
+        {
+            OpenFile();
+        }
+
+        private void CommandBinding_Executed_Save(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (CanSave)
+            {
+                SaveFile();
+            }
+        }
+
+        private void CommandBinding_Executed_SaveAs(object sender, ExecutedRoutedEventArgs e)
+        {
+            SaveAsFile();
+        }
+
+        private void CommandBinding_Executed_Undo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (pdfViewControl != null && pdfViewControl.PDFView != null && CanUndo)
+            {
+                pdfViewControl.PDFView.UndoManager?.Undo();
+            }
+        }
+
+        private void CommandBinding_Executed_Redo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (pdfViewControl != null && pdfViewControl.PDFView != null && CanRedo)
+            {
+                pdfViewControl.PDFView.UndoManager?.Redo();
+            }
+        }
+
+        private void CommandBinding_Executed_ControlLeftPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            LeftToolPanelButton.IsChecked = !LeftToolPanelButton.IsChecked;
+            ControlLeftPanel();
+        }
+
+        private void CommandBinding_Executed_ControlRightPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            RightPanelButton.IsChecked = !RightPanelButton.IsChecked;
+            ControlRightPanel();
+        }
+
+        private void CommandBinding_Executed_Bookmark(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Bookmark);
+        }
+
+        private void CommandBinding_Executed_Outline(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Outline);
+        }
+
+        private void CommandBinding_Executed_Thumbnail(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Thumbnail);
+        }
+
+        private void CommandBinding_Executed_Search(object sender, ExecutedRoutedEventArgs e)
+        {
+            ExpandLeftPanel(true);
+            LeftToolPanelButton.IsChecked = true;
+            BotaSideTool.SelectBotaTool(BOTATools.Search);
+        }
+
+        private void CommandBinding_Executed_ScaleAdd(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor + 0.01, true);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_ScaleSubtract(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor - 0.01, false);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_DisplaySettings(object sender, ExecutedRoutedEventArgs e)
+        {
+            ViewSettingBtn.IsChecked = !ViewSettingBtn.IsChecked;
+            ShowViewSettings();
+        }
+
+        private void CommandBinding_Executed_DocumentInfo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (PopupBorder.Visibility != Visibility.Visible)
+            {
+                PasswordUI.Visibility = Visibility.Collapsed;
+                CPDFInfoControl.Visibility = Visibility.Visible;
+                CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+                CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+                CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent; 
+                PopupBorder.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                CPDFInfoControl.Visibility = Visibility.Collapsed;
+                PopupBorder.Visibility = Visibility.Collapsed;
+            }
+        }
+        #endregion
     }
 }

+ 8 - 38
Demo/Examples/Forms/Properties/AssemblyInfo.cs

@@ -3,10 +3,7 @@ using System.Resources;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Windows;
-
-// 有关程序集的一般信息由以下
-// 控制。更改这些特性值可修改
-// 与程序集关联的信息。
+ 
 [assembly: AssemblyTitle("Forms_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
@@ -15,41 +12,14 @@ using System.Windows;
 [assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
-
-// 将 ComVisible 设置为 false 会使此程序集中的类型
-//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
-//请将此类型的 ComVisible 特性设置为 true。
+ 
 [assembly: ComVisible(false)]
-
-//若要开始生成可本地化的应用程序,请设置
-//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
-//例如,如果您在源文件中使用的是美国英语,
-//使用的是美国英语,请将 <UICulture> 设置为 en-US。  然后取消
-//对以下 NeutralResourceLanguage 特性的注释。  更新
-//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
+ 
 
 [assembly: ThemeInfo(
-    ResourceDictionaryLocation.None, //主题特定资源词典所处位置
-                                     //(未在页面中找到资源时使用,
-                                     //或应用程序资源字典中找到时使用)
-    ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
-                                              //(未在页面中找到资源时使用,
-                                              //、应用程序或任何主题专用资源字典中找到时使用)
+    ResourceDictionaryLocation.None,  
+    ResourceDictionaryLocation.SourceAssembly  
 )]
-
-
-// 程序集的版本信息由下列四个值组成: 
-//
-//      主版本
-//      次版本
-//      生成号
-//      修订号
-//
-//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
-//通过使用 "*",如下所示:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.9.0.0")]
-[assembly: AssemblyFileVersion("1.9.0.0")]
+ 
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 6 - 0
Demo/Examples/PDFATest/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+    </startup>
+</configuration>

+ 45 - 0
Demo/Examples/PDFATest/PDFATest.cs

@@ -0,0 +1,45 @@
+using ComPDFKit.PDFDocument;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDFATest
+{
+    internal class PDFATest
+    {
+        private static string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\PDFA";
+        public static bool CovertToPDFA(CPDFDocument document)
+        {
+            string convertToPDFAPath = outputPath + "\\ConvertToPDFATest.pdf";
+            document.WritePDFAToFilePath(CPDFType.CPDFTypePDFA1a, convertToPDFAPath);
+            return true;
+        }
+
+        public static bool CovertToPDFA1b(CPDFDocument document)
+        {
+            string convertToPDFA1bPath = outputPath + "\\ConvertToPDFA1bTest.pdf";
+            document.WritePDFAToFilePath(CPDFType.CPDFTypePDFA1a, convertToPDFA1bPath);
+            return false; 
+        }
+
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Running PDFA test sample…\r\n");
+
+            SDKLicenseHelper.LicenseVerify();
+             
+            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+
+            CovertToPDFA(document);
+            CovertToPDFA1b(document);
+        }
+    }
+}

+ 82 - 0
Demo/Examples/PDFATest/PDFATest.csproj

@@ -0,0 +1,82 @@
+<?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>{A104D585-61BB-4CAB-A968-876CCC8FA858}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>PDFATest</RootNamespace>
+    <AssemblyName>Viewer_ComPDFKit</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\Samples\LicenseKey.cs">
+      <Link>LicenseKey.cs</Link>
+    </Compile>
+    <Compile Include="PDFATest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

+ 36 - 0
Demo/Examples/PDFATest/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("PDFATest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("PDFATest")]
+[assembly: AssemblyCopyright("Copyright ©  2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a104d585-61bb-4cab-a968-876ccc8fa858")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 4 - 0
Demo/Examples/PDFATest/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="ComPDFKit.NetFramework" version="1.9.0" targetFramework="net461" />
+</packages>

+ 1 - 2
Demo/Examples/PDFViewer/App.xaml

@@ -1,7 +1,6 @@
 <Application x:Class="PDFViewer.App"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:local="clr-namespace:compdfkit"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
              xmlns:common="clr-namespace:Compdfkit_Tools.Common;assembly=Compdfkit_Tools"
              StartupUri="MainWindow.xaml">
     <Application.Resources>

+ 2 - 30
Demo/Examples/PDFViewer/App.xaml.cs

@@ -1,36 +1,10 @@
 using ComPDFKit.NativeMethod;
-using System;
+using Compdfkit_Tools.Helper;
 using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Reflection;
-using System.Threading.Tasks;
 using System.Windows;
-using System.Xml;
 
 namespace PDFViewer
 {
-    public class SDKLicenseHelper
-    {
-        public string key = string.Empty;
-        public string secret = string.Empty;
-        public SDKLicenseHelper()
-        {
-            string sdkLicensePath = "license_key_win.xml";
-            Assembly assembly = Assembly.GetExecutingAssembly();
-            XmlDocument xmlDocument = new XmlDocument();
-            xmlDocument.Load(sdkLicensePath);
-            var node = xmlDocument.SelectSingleNode("License");
-            if (node != null)
-            {
-                key = node.Attributes["key"].Value;
-                secret = node.Attributes["secret"].Value;
-            }
-        }
-
-    }
-
     /// <summary>
     /// Interaction logic for App.xaml
     /// </summary>
@@ -49,8 +23,7 @@ namespace PDFViewer
 
         private static bool LicenseVerify()
         {
-            bool result = false;
-            result = CPDFSDKVerifier.LoadNativeLibrary();
+            bool result = CPDFSDKVerifier.LoadNativeLibrary();
             if (!result)
                 return false;
             SDKLicenseHelper sdkLicenseHelper = new SDKLicenseHelper();
@@ -60,5 +33,4 @@ namespace PDFViewer
             return result;
         }
     }
-
 }

binární
Demo/Examples/PDFViewer/ComPDFKit.Desk.dll


binární
Demo/Examples/PDFViewer/ComPDFKit.Viewer.dll


+ 86 - 33
Demo/Examples/PDFViewer/MainPage.xaml

@@ -15,8 +15,78 @@
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
                 <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
             </ResourceDictionary.MergedDictionaries>
+            <!-- Shortcut -->
+            <RoutedUICommand x:Key="Open" Text="Open"/>
+            <RoutedUICommand x:Key="Save" Text="Right rotate"/>
+            <RoutedUICommand x:Key="SaveAs" Text="Delete"/>
+            <RoutedUICommand x:Key="Undo" Text="Undo"/>
+            <RoutedUICommand x:Key="Redo" Text="Redo"/>
+            <RoutedUICommand x:Key="ControlLeftPanel" Text="Control left panel"/>
+            <RoutedUICommand x:Key="ControlRightPanel" Text="Control right panel"/>
+            <RoutedUICommand x:Key="GoToBookmark" Text="Go to bookmark"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToOutline" Text="Go to outline"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToThumbnail" Text="Go to thumbnail"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToAnnotationList" Text="Go to annotation list"></RoutedUICommand>
+            <RoutedUICommand x:Key="GoToSearch" Text="Go to search"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleAdd" Text="Scale add"></RoutedUICommand>
+            <RoutedUICommand x:Key="ScaleSubtract" Text="Scale reduce"></RoutedUICommand>
+            <RoutedUICommand x:Key="DisplaySettings" Text="Display settings"></RoutedUICommand>
+            <RoutedUICommand x:Key="DocumentInfo" Text="Document infomation"></RoutedUICommand>
+            <RoutedUICommand x:Key="Highlight" Text="Highlight"></RoutedUICommand>
+            <RoutedUICommand x:Key="Underline" Text="Underline"></RoutedUICommand>
+            <RoutedUICommand x:Key="Strikeout" Text="Strikeout"></RoutedUICommand>
+            <RoutedUICommand x:Key="Squiggly" Text="Squiggly"></RoutedUICommand>
         </ResourceDictionary>
     </UserControl.Resources>
+
+    <UserControl.CommandBindings>
+        <CommandBinding Command="{StaticResource Open}" Executed="CommandBinding_Executed_Open"/>
+        <CommandBinding Command="{StaticResource Save}" Executed="CommandBinding_Executed_Save"/>
+        <CommandBinding Command="{StaticResource SaveAs}" Executed="CommandBinding_Executed_SaveAs"/>
+        <CommandBinding Command="{StaticResource Undo}" Executed="CommandBinding_Executed_Undo"/>
+        <CommandBinding Command="{StaticResource Redo}" Executed="CommandBinding_Executed_Redo"/>
+        <CommandBinding Command="{StaticResource ControlLeftPanel}" Executed="CommandBinding_Executed_ControlLeftPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource ControlRightPanel}" Executed="CommandBinding_Executed_ControlRightPanel"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToBookmark}" Executed="CommandBinding_Executed_Bookmark"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToOutline}" Executed="CommandBinding_Executed_Outline"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToThumbnail}" Executed="CommandBinding_Executed_Thumbnail"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToAnnotationList}" Executed="CommandBinding_Executed_Annotation"></CommandBinding>
+        <CommandBinding Command="{StaticResource GoToSearch}" Executed="CommandBinding_Executed_Search"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleAdd}" Executed="CommandBinding_Executed_ScaleAdd"></CommandBinding>
+        <CommandBinding Command="{StaticResource ScaleSubtract}" Executed="CommandBinding_Executed_ScaleSubtract"></CommandBinding>
+        <CommandBinding Command="{StaticResource DisplaySettings}" Executed="CommandBinding_Executed_DisplaySettings"></CommandBinding>
+        <CommandBinding Command="{StaticResource DocumentInfo}" Executed="CommandBinding_Executed_DocumentInfo"></CommandBinding>
+        <CommandBinding Command="{StaticResource Highlight}" Executed="CommandBinding_Executed_Highlight"></CommandBinding>
+        <CommandBinding Command="{StaticResource Underline}" Executed="CommandBinding_Executed_Underline"></CommandBinding>
+        <CommandBinding Command="{StaticResource Strikeout}" Executed="CommandBinding_Executed_Strikeout"></CommandBinding>
+        <CommandBinding Command="{StaticResource Squiggly}" Executed="CommandBinding_Executed_Squiggly"></CommandBinding>
+    </UserControl.CommandBindings>
+
+    <UserControl.InputBindings>
+        <KeyBinding Key="O" Modifiers="Control" Command="{StaticResource Open}"/>
+        <KeyBinding Key="S" Modifiers="Control" Command="{StaticResource Save}"/>
+        <KeyBinding Key="S" Modifiers="Control+Shift" Command="{StaticResource SaveAs}"/>
+        <KeyBinding Key="Z" Modifiers="Control" Command="{StaticResource Undo}"/>
+        <KeyBinding Key="Y" Modifiers="Control" Command="{StaticResource Redo}"/>
+        <KeyBinding Key="F4" Command="{StaticResource ControlLeftPanel}"/>
+        <KeyBinding Key="F4" Modifiers="Control" Command="{StaticResource ControlRightPanel}"/>
+        <KeyBinding Key="B" Modifiers="Control" Command="{StaticResource GoToBookmark}"></KeyBinding>
+        <KeyBinding Key="O" Modifiers="Control+Shift" Command="{StaticResource GoToOutline}"></KeyBinding>
+        <KeyBinding Key="T" Modifiers="Control" Command="{StaticResource GoToThumbnail}"></KeyBinding>
+        <KeyBinding Key="A" Modifiers="Control" Command="{StaticResource GoToAnnotationList}"></KeyBinding>
+        <KeyBinding Key="F" Modifiers="Control" Command="{StaticResource GoToSearch}"></KeyBinding>
+        <KeyBinding Key="Add"  Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
+        <KeyBinding Key="OemPlus"  Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
+        <KeyBinding Key="Subtract" Modifiers="Control" Command="{StaticResource ScaleSubtract}"></KeyBinding>
+        <KeyBinding Key="OemMinus" Modifiers="Control" Command="{StaticResource ScaleSubtract}"></KeyBinding>
+        <KeyBinding Key="D" Modifiers="Control" Command="{StaticResource DisplaySettings}"></KeyBinding>
+        <KeyBinding Key="I" Modifiers="Control" Command="{StaticResource DocumentInfo}"></KeyBinding>
+        <KeyBinding Key="H" Modifiers="Control+Alt" Command="{StaticResource Highlight}"></KeyBinding>
+        <KeyBinding Key="U" Modifiers="Control+Alt" Command="{StaticResource Underline}"></KeyBinding>
+        <KeyBinding Key="Q" Modifiers="Control+Alt" Command="{StaticResource Squiggly}"></KeyBinding>
+        <KeyBinding Key="S" Modifiers="Control+Alt" Command="{StaticResource Strikeout}"></KeyBinding>
+    </UserControl.InputBindings>
+    
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"></RowDefinition>
@@ -60,7 +130,7 @@
                         </Viewbox>
                     </Button.Content>
                     <Button.ToolTip>
-                        <ToolTip Content="Open..."></ToolTip>
+                        <ToolTip Content="Open...(Ctrl+O)"></ToolTip>
                     </Button.ToolTip>
                 </Button>
  
@@ -89,7 +159,7 @@
                         </Viewbox>
                     </Button.Content>
                     <Button.ToolTip>
-                        <ToolTip Content="Save"></ToolTip>
+                        <ToolTip Content="Save(Ctrl+S)"></ToolTip>
                     </Button.ToolTip>
                 </Button>
  
@@ -102,7 +172,7 @@
                         </Path>
                     </ToggleButton.Content>
                     <ToggleButton.ToolTip>
-                        <ToolTip Content="Panel"></ToolTip>
+                        <ToolTip Content="BOTAS Panel(F4)"></ToolTip>
                     </ToggleButton.ToolTip>
                 </ToggleButton>
 
@@ -134,7 +204,7 @@
                         </Path>
                     </Button.Content>
                     <Button.ToolTip>
-                        <ToolTip Content="Search"></ToolTip>
+                        <ToolTip Content="Search(Ctrl+F)"></ToolTip>
                     </Button.ToolTip>
                 </Button>
  
@@ -154,7 +224,7 @@
                         </Path>
                     </ToggleButton.Content>
                     <ToggleButton.ToolTip>
-                        <ToolTip Content="Page Display"></ToolTip>
+                        <ToolTip Content="Page Display(Ctrl+D)"></ToolTip>
                     </ToggleButton.ToolTip>
                 </ToggleButton>
  
@@ -167,7 +237,7 @@
                         </Path>
                     </ToggleButton.Content>
                     <ToggleButton.ToolTip>
-                        <ToolTip Content="Properties"></ToolTip>
+                        <ToolTip Content="Properties Panel(Ctrl+F4)"></ToolTip>
                     </ToggleButton.ToolTip>
                 </ToggleButton>
  
@@ -185,7 +255,7 @@
                         </Path>
                     </Button.Content>
                     <Button.ToolTip>
-                        <ToolTip Content="Document Info"></ToolTip>
+                        <ToolTip Content="Document Info(Ctrl+I)"></ToolTip>
                     </Button.ToolTip>
                 </Button>
             </StackPanel>
@@ -268,7 +338,7 @@
                                     </Path.Data>
                                 </Path>
                                 <Button.ToolTip>
-                                    <ToolTip Content="Undo"></ToolTip>
+                                    <ToolTip Content="Undo(Ctrl+Z)"></ToolTip>
                                 </Button.ToolTip>
                             </Button> 
                             <Button Style="{StaticResource LightButtonStyle}" BorderThickness="0" Width="40" Height="40" Margin="10,0,0,0"  IsEnabled="{Binding CanRedo,Mode=OneWay}" Click="RedoBtn_Click"
@@ -293,7 +363,7 @@
                                     </Path.Data>
                                 </Path>
                                 <Button.ToolTip>
-                                    <ToolTip Content="Redo"></ToolTip>
+                                    <ToolTip Content="Redo(Ctrl+Y)"></ToolTip>
                                 </Button.ToolTip>
                             </Button>
                         </StackPanel>
@@ -333,35 +403,18 @@
                     </Grid.ColumnDefinitions> 
                     <Border x:Name="PDFGrid" Background="#CECECE"></Border> 
                     <cpdfcommon:PageNumberControl Grid.Row="1" Name="FloatPageTool" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20"></cpdfcommon:PageNumberControl>
- 
-                    <Border Grid.Column="1" Name="PropertyContainer" Visibility="Collapsed"></Border>
+                    <Grid Grid.Column="1">
+                        <TextBlock x:Name="EmptyMessage" Text="The property panel is empty." Visibility="{Binding ElementName=PropertyContainer, Path=Visibility}" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
+
+                        <Border Name="PropertyContainer" Visibility="Collapsed"></Border>
+                    </Grid>
                 </Grid>
             </Grid>
         </Grid>
         <Border Name="PopupBorder" Background="#A0000000" Visibility="Collapsed" Grid.RowSpan="3" Grid.ColumnSpan="2">
-            <Grid> 
-                <Grid Name="FileInfoUI"  Width="422" Height="680" HorizontalAlignment="Center" VerticalAlignment="Center" Background="White" Visibility="Collapsed">
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                    </Grid.ColumnDefinitions>
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="auto"></RowDefinition>
-                        <RowDefinition Height="*"></RowDefinition>
-                    </Grid.RowDefinitions>
+            <Grid>
+                <cpdftools:CPDFInfoControl x:Name="CPDFInfoControl" Visibility="Collapsed"></cpdftools:CPDFInfoControl>
 
-                    <TextBlock Width="50" Height="20" FontSize="14" LineHeight="16" Margin="12,6,0,0" HorizontalAlignment="Left">FileInfo:</TextBlock>
-                    <Button Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Right" Margin="0,8,8,0" BorderThickness="0" Click="FileInfoCloseBtn_Click">
-                        <Button.Content>
-                            <Path Fill="Black">
-                                <Path.Data>
-                                    M6.69495 6L11.5 1.19495L10.805 0.5L6 5.30505L1.19495 0.5L0.5 1.19495L5.30505 6L0.5 10.805L1.19495 11.5L6 6.69495L10.805 11.5L11.5 10.805L6.69495 6Z
-                                </Path.Data>
-                            </Path>
-                        </Button.Content>
-                    </Button>
-                    <cpdftools:CPDFInfoControl Grid.Row="1" Margin="25,10,25,0" Grid.ColumnSpan="2" Name="FileInfoControl"></cpdftools:CPDFInfoControl>
-                </Grid> 
                 <cpdfcommon:PasswordDialog x:Name="PasswordUI" Visibility="Collapsed"></cpdfcommon:PasswordDialog>
             </Grid>
         </Border>

+ 494 - 101
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -1,5 +1,6 @@
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFPage;
+using ComPDFKit.PDFPage.Edit;
 using Compdfkit_Tools.Data;
 using Compdfkit_Tools.Edit;
 using Compdfkit_Tools.Helper;
@@ -16,18 +17,14 @@ using System.Drawing;
 using System.IO;
 using System.Linq;
 using System.Runtime.CompilerServices;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
-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 Path = System.IO.Path;
+using Point = System.Windows.Point;
 
 namespace PDFViewer
 {
@@ -39,12 +36,16 @@ namespace PDFViewer
         private PDFViewControl passwordViewer;
         private PDFViewControl pdfViewControl = new PDFViewControl();
         private CPDFAnnotationControl pdfAnnotationControl = null;
-        private UIElement pdfEditControl = null;
         private CPDFPageEditControl pageEditControl = null;
         private FromPropertyControl pdfFormControl = new FromPropertyControl();
-        private PDFImageEditControl imageEditControl = null;
-        private CPDFDisplaySettingsControl displayPanel = null;
-
+        private PDFContentEditControl pdfContentEditControl = new PDFContentEditControl();
+        private CPDFDisplaySettingsControl displayPanel = new CPDFDisplaySettingsControl();
+        private PDFEditEvent lastPDFEditEvent = null;
+        public event Func<string[], bool> CheckExistBeforeOpenFileEvent;
+        public event PropertyChangedEventHandler PropertyChanged;
+        public event EventHandler FileChangeEvent;
+        private PDFEditEvent pdfTextCreateParam;
+        private KeyEventHandler KeyDownHandler;
         private double[] zoomLevelList = { 1f, 8f, 12f, 25, 33f, 50, 66f, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
         public bool CanSave
         {
@@ -82,10 +83,7 @@ namespace PDFViewer
             }
         }
 
-        private PDFEditEvent lastPDFEditEvent = null;
-        public event Func<string[], bool> CheckExistBeforeOpenFileEvent;
-        public event PropertyChangedEventHandler PropertyChanged;
-        public event EventHandler FileChangeEvent;
+
         #endregion
 
         public MainPage()
@@ -105,6 +103,7 @@ namespace PDFViewer
             pdfAnnotationControl.SetPDFViewer(newPDFViewer.PDFView);
             FormBarControl.InitWithPDFViewer(newPDFViewer.PDFView, pdfFormControl);
             pdfFormControl.SetPDFViewer(newPDFViewer.PDFView);
+            pdfContentEditControl.InitWithPDFViewer(newPDFViewer.PDFView);
             pdfAnnotationControl.AnnotationCancel();
             AnnotationBarControl.ClearAllToolState();
             ExpandRightPropertyPanel(null, Visibility.Collapsed);
@@ -245,6 +244,7 @@ namespace PDFViewer
                     PasswordUI.ClearPassword();
                     PasswordUI.Visibility = Visibility.Collapsed;
                     PopupBorder.Visibility = Visibility.Collapsed;
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                     FileChangeEvent?.Invoke(null, EventArgs.Empty);
@@ -261,7 +261,6 @@ namespace PDFViewer
             SaveFile();
         }
 
-
         private void PageView_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
             UIElement pageView = sender as UIElement;
@@ -271,27 +270,21 @@ namespace PDFViewer
             }
             if (lastPDFEditEvent != null && lastPDFEditEvent.EditType == CPDFEditType.EditImage)
             {
-                if (imageEditControl == null)
-                {
-                    imageEditControl = new PDFImageEditControl();
-                }
-                imageEditControl.InitWithPDFViewer(pdfViewControl.PDFView);
-                imageEditControl.SetPDFImageEditData(lastPDFEditEvent);
-                pdfEditControl = imageEditControl as UIElement;
-                PropertyContainer.Child = pdfEditControl;
-                ExpandRightPropertyPanel(pdfEditControl, Visibility.Visible);
+                pdfContentEditControl.SetPDFImageEditData(lastPDFEditEvent);
             }
         }
 
         private void PageInfoBtn_Click(object sender, RoutedEventArgs e)
         {
             PasswordUI.Visibility = Visibility.Collapsed;
-            FileInfoUI.Visibility = Visibility.Visible;
-            FileInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.Visibility = Visibility.Visible;
+            CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+            CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
             PopupBorder.Visibility = Visibility.Visible;
         }
 
-        private void FileInfoCloseBtn_Click(object sender, RoutedEventArgs e)
+        private void CPDFInfoControl_CloseInfoEvent(object sender, EventArgs e)
         {
             PopupBorder.Visibility = Visibility.Collapsed;
         }
@@ -304,18 +297,52 @@ namespace PDFViewer
                 ClearPDFEditState(senderBtn);
                 if (senderBtn.IsChecked == true)
                 {
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.PanTool);
+                    PDFEditEvent createParam = new PDFEditEvent();
+                    createParam.EditType = CPDFEditType.EditText;
+                    createParam.IsBold = false;
+                    createParam.IsItalic = false;
+                    createParam.FontSize = 14;
+                    createParam.FontName = "Helvetica";
+                    createParam.FontColor = Colors.Black;
+                    createParam.TextAlign = TextAlignType.AlignLeft;
+                    createParam.Transparency = 255;
+
+                    if (pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
+                    {
+                        CPDFDocument pdfDoc = pdfViewControl.PDFView.Document;
+                        if (pdfDoc.PageCount > 0)
+                        {
+                            CPDFPage pdfPage = pdfDoc.PageAtIndex(0);
+                            CPDFEditPage editPage = pdfPage.GetEditPage();
+                            editPage.BeginEdit(CPDFEditType.EditText);
+                            createParam.SystemFontNameList.AddRange(editPage.GetFontList());
+                            editPage.EndEdit();
+                        }
+                    }
                     pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.EditText);
                     pdfViewControl.PDFView?.SetPDFEditCreateType(CPDFEditType.EditText);
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.PDFEdit);
-                    pdfViewControl.PDFView?.ReloadDocument();
+
+                    pdfViewControl.PDFView?.SetPDFEditParam(createParam);
+                    pdfContentEditControl.SetPDFTextEditData(createParam);
+                    ExpandRightPropertyPanel(pdfContentEditControl, Visibility.Visible);
+                    if ((bool)ViewSettingBtn.IsChecked)
+                    {
+                        ViewSettingBtn.IsChecked = false;
+                    }
+                    RightPanelButton.IsChecked = true;
+                    pdfTextCreateParam = createParam;
                 }
                 else
                 {
                     pdfViewControl.PDFView?.SetPDFEditCreateType(CPDFEditType.None);
                     pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.EditImage | CPDFEditType.EditText);
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.PDFEdit);
-                    pdfViewControl.PDFView?.ReloadDocument();
+                    RightPanelButton.IsChecked = false;
+                    if ((bool)ViewSettingBtn.IsChecked)
+                    {
+                        return;
+                    }
+                    pdfContentEditControl.ClearContentControl();
+                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
                 }
             }
         }
@@ -333,12 +360,15 @@ namespace PDFViewer
                     ClearPDFEditState(senderBtn);
                     pdfViewControl.PDFView?.ClearSelectPDFEdit();
                     pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.EditImage | CPDFEditType.EditText);
-                    pdfViewControl.PDFView?.SetMouseMode(MouseModes.PDFEdit);
-                    pdfViewControl.PDFView?.ReloadDocument();
 
-                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                    RightPanelButton.IsChecked = false;
+                    if (PropertyContainer.Child != null && !(bool)ViewSettingBtn.IsChecked)
+                    {
+                        ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                    }
                     pdfViewControl.PDFView?.SetPDFEditCreateType(CPDFEditType.EditImage);
                     pdfViewControl.PDFView?.AddPDFEditImage(openFileDialog.FileName);
+                    RightPanelButton.IsChecked = false;
                 }
             }
         }
@@ -629,7 +659,7 @@ namespace PDFViewer
                     {
                         lastPDFEditEvent.Rotate = -90;
                         lastPDFEditEvent.UpdatePDFEditByEventArgs();
-                        imageEditControl?.SetImageThumb();
+                        pdfContentEditControl.RefreshThumb();
                     }
                 };
                 editCommand.PopupMenu.Items.Add(rotateLeftMenu);
@@ -642,7 +672,7 @@ namespace PDFViewer
                     {
                         lastPDFEditEvent.Rotate = 90;
                         lastPDFEditEvent.UpdatePDFEditByEventArgs();
-                        imageEditControl?.SetImageThumb();
+                        pdfContentEditControl.RefreshThumb();
                     }
                 };
                 editCommand.PopupMenu.Items.Add(rotateRightMenu);
@@ -660,7 +690,7 @@ namespace PDFViewer
                             lastPDFEditEvent.ReplaceImagePath = openFileDialog.FileName;
                             lastPDFEditEvent.UpdatePDFEditByEventArgs();
                             pdfViewControl.PDFView?.ClearSelectPDFEdit();
-                            imageEditControl?.SetImageThumb();
+                            pdfContentEditControl.RefreshThumb();
                         }
                     }
                 };
@@ -742,6 +772,11 @@ namespace PDFViewer
                 editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
                 editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
                 editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
+                editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
+                if (editCommand.TextAreaCopied)
+                {
+                    editCommand.PopupMenu.Items.Add(new MenuItem() { Header = "Paste And Match Style", Command = CustomCommands.PasteMatchStyle, CommandTarget = (UIElement)sender });
+                }
             }
             else
             {
@@ -870,9 +905,11 @@ namespace PDFViewer
             pdfViewControl.PDFView.PDFEditCommandHandler -= PDFView_PDFEditCommandHandler;
             pdfViewControl.PDFView.PDFEditCommandHandler += PDFView_PDFEditCommandHandler;
 
+            //
             pdfViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
             pdfViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
 
+            //Can undo, can redo
             pdfViewControl.PDFView.UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
             pdfViewControl.PDFView.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
 
@@ -898,7 +935,14 @@ namespace PDFViewer
             ViewSettingBtn.IsChecked = false;
             PropertyContainer.Child = null;
             PropertyContainer.Visibility = Visibility.Collapsed;
+
             ModeComboBox.SelectedIndex = 0;
+            if (KeyDownHandler != null)
+            {
+                pdfViewControl.PDFView.RemoveHandler(KeyDownEvent, KeyDownHandler);
+            }
+            KeyDownHandler = new KeyEventHandler(PDFView_KeyDown);
+            pdfViewControl.PDFView.AddHandler(KeyDownEvent, KeyDownHandler, false, true);
         }
 
         /// <summary>
@@ -986,6 +1030,7 @@ namespace PDFViewer
                 }
                 else
                 {
+                    pdfViewControl.PDFView.Document.Release();
                     pdfViewControl = passwordViewer;
                     LoadDocument();
                     FileChangeEvent?.Invoke(null, EventArgs.Empty);
@@ -1016,16 +1061,59 @@ namespace PDFViewer
             }
         }
 
-        private void LeftToolPanelButton_Click(object sender, RoutedEventArgs e)
+        private void ControlLeftPanel()
         {
-            ToggleButton expandBtn = sender as ToggleButton;
-            if (expandBtn != null)
+            if (LeftToolPanelButton != null)
             {
-                bool isExpand = expandBtn.IsChecked == true;
+                bool isExpand = LeftToolPanelButton.IsChecked == true;
                 ExpandLeftPanel(isExpand);
             }
         }
 
+        private void ControlRightPanel()
+        {
+            if ((bool)ViewSettingBtn.IsChecked)
+            {
+                ViewSettingBtn.IsChecked = false;
+            }
+            if (RightPanelButton != null)
+            {
+                if (RightPanelButton.IsChecked == true)
+                {
+                    if (currentMode == "Annotation")
+                    {
+                        ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
+                    }
+                    else if (currentMode == "Edit")
+                    {
+                        ExpandRightPropertyPanel(pdfContentEditControl, Visibility.Visible);
+                    }
+                    else if (currentMode == "Forms")
+                    {
+                        ExpandRightPropertyPanel(pdfFormControl, Visibility.Visible);
+                    }
+                    else if (currentMode == "Content Editor")
+                    {
+                        ExpandRightPropertyPanel(pdfContentEditControl, Visibility.Visible);
+                    }
+                    else
+                    {
+                        ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
+
+                    }
+                }
+                else
+                {
+                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                }
+            }
+        }
+
+        private void LeftToolPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlLeftPanel();
+        }
+
         private void ExpandSearchBtn_Click(object sender, RoutedEventArgs e)
         {
             ExpandLeftPanel(true);
@@ -1033,17 +1121,12 @@ namespace PDFViewer
             BotaSideTool.SelectBotaTool(BOTATools.Search);
         }
 
-        private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
+        private void ShowViewSettings()
         {
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
+            if (ViewSettingBtn != null)
             {
-                if (toggleButton.IsChecked == true)
+                if (ViewSettingBtn.IsChecked == true)
                 {
-                    if (displayPanel == null)
-                    {
-                        displayPanel = new CPDFDisplaySettingsControl();
-                    }
                     displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
                     PropertyContainer.Child = displayPanel;
                     PropertyContainer.Visibility = Visibility.Visible;
@@ -1060,6 +1143,11 @@ namespace PDFViewer
             }
         }
 
+        private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
+        {
+            ShowViewSettings();
+        }
+
         public void ExpandRightPropertyPanel(UIElement properytPanel, Visibility visible)
         {
             PropertyContainer.Width = 260;
@@ -1073,37 +1161,7 @@ namespace PDFViewer
 
         private void RightPanelButton_Click(object sender, RoutedEventArgs e)
         {
-            ToggleButton toggleButton = sender as ToggleButton;
-            if (toggleButton != null)
-            {
-                if (toggleButton.IsChecked == true)
-                {
-                    if (currentMode == "Annotation")
-                    {
-                        ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
-                    }
-                    else if (currentMode == "Edit")
-                    {
-                        ExpandRightPropertyPanel(pdfEditControl, Visibility.Visible);
-                    }
-                    else if (currentMode == "Forms")
-                    {
-                        ExpandRightPropertyPanel(pdfFormControl, Visibility.Visible);
-                    }
-                    else
-                    {
-                        ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
-                    }
-                    if ((bool)ViewSettingBtn.IsChecked)
-                    {
-                        ViewSettingBtn.IsChecked = false;
-                    }
-                }
-                else
-                {
-                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
-                }
-            }
+            ControlRightPanel();
         }
         #endregion
 
@@ -1121,6 +1179,11 @@ namespace PDFViewer
 
         private void PDFView_AnnotActiveHandler(object sender, AnnotAttribEvent e)
         {
+            if ((bool)ViewSettingBtn.IsChecked)
+            {
+                ViewSettingBtn.IsChecked = false;
+                RightPanelButton.IsChecked = true;
+            }
             PropertyContainer.Child = pdfAnnotationControl;
             pdfAnnotationControl.SetAnnotEventData(e);
         }
@@ -1140,7 +1203,6 @@ namespace PDFViewer
             }
         }
 
-
         private void PDFView_PDFEditCommandHandler(object sender, PDFEditCommand e)
         {
             if (e == null)
@@ -1166,38 +1228,52 @@ namespace PDFViewer
         /// </summary>
         private void PDFView_PDFEditActiveHandler(object sender, ComPDFKitViewer.PDFEditEvent e)
         {
+            PropertyContainer.Child = pdfContentEditControl;
             lastPDFEditEvent = e;
-            ViewSettingBtn.IsChecked = false;
-            if (e == null)
+            if ((bool)ViewSettingBtn.IsChecked)
             {
-                pdfEditControl = null;
-                PropertyContainer.Child = pdfEditControl;
-                ExpandRightPropertyPanel(null, Visibility.Collapsed);
-                return;
+                ViewSettingBtn.IsChecked = false;
+                RightPanelButton.IsChecked = true;
+                ExpandRightPropertyPanel(pdfContentEditControl, Visibility.Visible);
             }
-            if (Mouse.RightButton == MouseButtonState.Pressed)
+
+            if (e == null)
             {
+                PropertyContainer.Child = pdfContentEditControl;
+
+                if (pdfTextCreateParam != null && pdfViewControl != null && pdfViewControl.PDFView != null)
+                {
+                    if (pdfViewControl.PDFView.GetPDFEditCreateType() == CPDFEditType.EditText)
+                    {
+                        pdfContentEditControl.SetPDFTextEditData(pdfTextCreateParam);
+                    }
+                    else if (pdfViewControl.PDFView.GetPDFEditCreateType() == CPDFEditType.None)
+                    {
+                        pdfContentEditControl.ClearContentControl();
+
+                    }
+                }
+                else
+                {
+                    pdfContentEditControl.ClearContentControl();
+                }
                 return;
             }
+
             if (e.EditType == CPDFEditType.EditText)
             {
-                RightPanelButton.IsChecked = true;
-                PDFTextEditControl textEditControl = new PDFTextEditControl();
-                textEditControl.SetPDFTextEditData(e);
-                pdfEditControl = textEditControl as UIElement;
-                PropertyContainer.Child = pdfEditControl;
-                ExpandRightPropertyPanel(pdfEditControl, Visibility.Visible);
+                pdfContentEditControl.SetPDFTextEditData(e, true);
                 return;
             }
 
             if (e.EditType == CPDFEditType.EditImage && pdfViewControl != null)
             {
-                RightPanelButton.IsChecked = true;
                 UIElement pageView = sender as UIElement;
                 if (pageView != null)
                 {
-                    pageView.MouseLeftButtonUp += PageView_MouseLeftButtonUp; ;
+                    pageView.MouseLeftButtonUp += PageView_MouseLeftButtonUp;
                 }
+                pdfContentEditControl.SetPDFImageEditData(e);
                 return;
             }
         }
@@ -1320,6 +1396,137 @@ namespace PDFViewer
         {
             OpenFile();
         }
+
+        public void PDFView_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (pdfViewControl.PDFView.MouseMode != MouseModes.PDFEdit)
+            {
+                return;
+            }
+
+            if (Keyboard.Modifiers == ModifierKeys.Control)
+            {
+                if (e.Key == Key.Left)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypePreWord, false);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Right)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeNextWord, false);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Up)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeSectionBegin, false);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Down)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeSectionEnd, false);
+                    e.Handled = true;
+                }
+            }
+
+            if (Keyboard.Modifiers == ModifierKeys.Shift)
+            {
+                if (e.Key == Key.Left)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypePreCharPlace, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Right)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeNextCharPlace, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Up)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeUpCharPlace, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Down)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeDownCharPlace, true);
+                    e.Handled = true;
+                }
+            }
+
+            if (Keyboard.Modifiers == ModifierKeys.Alt)
+            {
+                if (e.SystemKey == Key.Up)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLocationLineBegin, false);
+                    e.Handled = true;
+                }
+
+                if (e.SystemKey == Key.Down)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeLineEnd, false);
+                    e.Handled = true;
+                }
+            }
+
+            if (Keyboard.Modifiers == ModifierKeys.None)
+            {
+                if (e.Key == Key.Left)
+                {
+                    pdfViewControl.PDFView.MoveEditArea(new Point(-5, 0));
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Right)
+                {
+                    pdfViewControl.PDFView.MoveEditArea(new Point(5, 0));
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Up)
+                {
+                    pdfViewControl.PDFView.MoveEditArea(new Point(0, -5));
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Down)
+                {
+                    pdfViewControl.PDFView.MoveEditArea(new Point(0, 5));
+                    e.Handled = true;
+                }
+            }
+
+            if (Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift))
+            {
+                if (e.Key == Key.Left)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypePreWord, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Right)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeNextWord, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Up)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeSectionBegin, true);
+                    e.Handled = true;
+                }
+
+                if (e.Key == Key.Down)
+                {
+                    pdfViewControl.PDFView.JumpEditingLoction(CEditingLocation.CEditingLoadTypeSectionEnd, true);
+                    e.Handled = true;
+                }
+            }
+        }
         #endregion
 
         #region Change mode
@@ -1330,6 +1537,7 @@ namespace PDFViewer
         /// </summary>
         private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
+            pdfTextCreateParam = null;
             if (isFirstLoad)
             {
                 isFirstLoad = false;
@@ -1354,7 +1562,10 @@ namespace PDFViewer
                     AnnotationBarControl.Visibility = Visibility.Collapsed;
                     AnnotationBarControl.ClearAllToolState();
                     pdfAnnotationControl.ClearPanel();
-                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                    if (!(bool)ViewSettingBtn.IsChecked)
+                    {
+                        ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                    }
                     pdfViewControl.PDFView?.SetMouseMode(MouseModes.PanTool);
                     pdfViewControl.PDFView.AnnotEditHandler -= PDFView_AnnotEditHandler;
                     pdfAnnotationControl.ClearAnnotationBar -= PdfAnnotationControl_ClearAnnotationBar;
@@ -1381,13 +1592,17 @@ namespace PDFViewer
                     pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.None);
                     pdfViewControl.PDFView?.SetMouseMode(MouseModes.PanTool);
                     pdfViewControl.PDFView?.ReloadDocument();
+                    pdfContentEditControl.ClearPanel();
                     pdfViewControl.PDFView.PDFEditActiveHandler -= PDFView_PDFEditActiveHandler;
-                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                    if (!(bool)ViewSettingBtn.IsChecked)
+                    {
+                        ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                    }
                     ClearPDFEditState();
                     pdfViewControl.PDFView?.UndoManager.ClearHistory();
                     if (displayPanel != null)
                     {
-                        displayPanel.SetSplitContainerVisibility(Visibility.Visible);
+                        displayPanel.SetVisibilityWhenContentEdit(Visibility.Visible);
                     }
                     break;
                 /*
@@ -1398,7 +1613,10 @@ namespace PDFViewer
                  * Clear undo history
                  */
                 case "Forms":
-                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                    if (!(bool)ViewSettingBtn.IsChecked)
+                    {
+                        ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                    }
                     FormBarControl.ClearAllToolState();
                     FormBarControl.Visibility = Visibility.Collapsed;
                     pdfViewControl.PDFView?.SetMouseMode(MouseModes.PanTool);
@@ -1475,6 +1693,7 @@ namespace PDFViewer
                 PageEditBarControl.Visibility = Visibility.Collapsed;
 
                 pdfViewControl.PDFView?.SetPDFEditType(CPDFEditType.EditText | CPDFEditType.EditImage);
+                pdfViewControl.PDFView?.SetPDFEditCreateType(CPDFEditType.None);
                 pdfViewControl.PDFView?.SetMouseMode(MouseModes.PDFEdit);
                 pdfViewControl.PDFView?.ReloadDocument();
 
@@ -1482,7 +1701,7 @@ namespace PDFViewer
                 pdfViewControl.PDFView.SetSplitMode(SplitMode.None);
                 if (displayPanel != null)
                 {
-                    displayPanel.SetSplitContainerVisibility(Visibility.Collapsed);
+                    displayPanel.SetVisibilityWhenContentEdit(Visibility.Collapsed);
                 }
             }
 
@@ -1534,7 +1753,181 @@ namespace PDFViewer
 
             currentMode = (string)item.Content;
         }
+        #endregion
+
+        #region Shortcut  
+        private void CommandBinding_Executed_Open(object sender, ExecutedRoutedEventArgs e)
+        {
+            OpenFile();
+        }
+
+        private void CommandBinding_Executed_Save(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (CanSave)
+            {
+                SaveFile();
+            }
+        }
+
+        private void CommandBinding_Executed_SaveAs(object sender, ExecutedRoutedEventArgs e)
+        {
+            SaveAsFile();
+        }
 
+        private void CommandBinding_Executed_Undo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (pdfViewControl != null && pdfViewControl.PDFView != null && CanUndo)
+            {
+                pdfViewControl.PDFView.UndoManager?.Undo();
+            }
+        }
+
+        private void CommandBinding_Executed_Redo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (pdfViewControl != null && pdfViewControl.PDFView != null && CanRedo)
+            {
+                pdfViewControl.PDFView.UndoManager?.Redo();
+            }
+        }
+
+        private void CommandBinding_Executed_ControlLeftPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Docs Editor")
+            {
+                LeftToolPanelButton.IsChecked = !LeftToolPanelButton.IsChecked;
+                ControlLeftPanel();
+            }
+        }
+
+        private void CommandBinding_Executed_ControlRightPanel(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Docs Editor")
+            {
+                RightPanelButton.IsChecked = !RightPanelButton.IsChecked;
+                ControlRightPanel();
+            }
+        }
+
+        private void CommandBinding_Executed_Bookmark(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Docs Editor")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Bookmark);
+            }
+        }
+
+        private void CommandBinding_Executed_Outline(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Docs Editor")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Outline);
+            }
+        }
+        private void CommandBinding_Executed_Thumbnail(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Docs Editor")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Thumbnail);
+            }
+        }
+
+        private void CommandBinding_Executed_Annotation(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Docs Editor")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Annotation);
+            }
+        }
+
+        private void CommandBinding_Executed_Search(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Docs Editor")
+            {
+                ExpandLeftPanel(true);
+                LeftToolPanelButton.IsChecked = true;
+                BotaSideTool.SelectBotaTool(BOTATools.Search);
+            }
+        }
+
+        private void CommandBinding_Executed_ScaleAdd(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor + 0.01, true);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_ScaleSubtract(object sender, ExecutedRoutedEventArgs e)
+        {
+            double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor - 0.01, false);
+            pdfViewControl.PDFView?.Zoom(newZoom);
+        }
+
+        private void CommandBinding_Executed_DisplaySettings(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode != "Docs Editor")
+            {
+                ViewSettingBtn.IsChecked = !ViewSettingBtn.IsChecked;
+                ShowViewSettings();
+            }
+        }
+
+        private void CommandBinding_Executed_DocumentInfo(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (PopupBorder.Visibility != Visibility.Visible)
+            {
+                PasswordUI.Visibility = Visibility.Collapsed;
+                CPDFInfoControl.Visibility = Visibility.Visible;
+                CPDFInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
+                CPDFInfoControl.CloseInfoEvent -= CPDFInfoControl_CloseInfoEvent;
+                CPDFInfoControl.CloseInfoEvent += CPDFInfoControl_CloseInfoEvent;
+                PopupBorder.Visibility = Visibility.Visible;
+            }
+            else
+            {
+                CPDFInfoControl.Visibility = Visibility.Collapsed;
+                PopupBorder.Visibility = Visibility.Collapsed;
+                this.Focus();
+            }
+        }
+
+        private void CommandBinding_Executed_Highlight(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode == "Annotations")
+            {
+                AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Highlight);
+            }
+        }
+
+        private void CommandBinding_Executed_Underline(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode == "Annotations")
+            {
+                AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Underline);
+            }
+        }
+
+        private void CommandBinding_Executed_Strikeout(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode == "Annotations")
+            {
+                AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Strikeout);
+            }
+        }
+
+        private void CommandBinding_Executed_Squiggly(object sender, ExecutedRoutedEventArgs e)
+        {
+            if (currentMode == "Annotations")
+            {
+                AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Squiggly);
+            }
+        }
         #endregion
     }
 }

+ 1 - 1
Demo/Examples/PDFViewer/MainWindow.xaml

@@ -10,7 +10,7 @@
         SnapsToDevicePixels="True" 
         xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz"
         BorderThickness="{Binding RelativeSource={RelativeSource Mode=Self},Path=WindowState,Converter={StaticResource WindowStateToThicknessConverter}}"
-        Title="ComPDFKit"  Height="720" Width="1080"  WindowStartupLocation="CenterScreen">
+        Title="ComPDFKit V1.9.1"  Height="720" Width="1080"  WindowStartupLocation="CenterScreen">
     <WindowChrome.WindowChrome>
         <WindowChrome 
             CornerRadius="8"

+ 1 - 1
Demo/Examples/PDFViewer/PDFViewer.csproj

@@ -118,7 +118,7 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="..\license_key_win.xml">
+    <None Include="..\license_key_windows.xml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <Resource Include="ComPDFKit_Logo.ico" />

+ 2 - 2
Demo/Examples/PDFViewer/Properties/AssemblyInfo.cs

@@ -51,5 +51,5 @@ using System.Windows;
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.9.0.0")]
-[assembly: AssemblyFileVersion("1.9.0.0")]
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 111 - 0
Demo/Examples/Samples/AnnotationImportExportTest/AnnotationImportExportTest.cs

@@ -0,0 +1,111 @@
+using ComPDFKit.PDFDocument;
+using System;
+using System.IO; 
+
+namespace AnnotationImportExportTest
+{
+    internal class AnnotationImportExportTest
+    {
+        private static string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\AnnotationImportExportTest";
+        private static string tempPath = outputPath + "\\temp";
+
+        static void Main(string[] args)
+        {
+
+            Console.WriteLine("Running header and footer test sample…\r\n");
+
+            #region Preparation work
+
+            SDKLicenseHelper.LicenseVerify();
+             
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+            if (!Directory.Exists(tempPath))
+            {
+                Directory.CreateDirectory(tempPath);
+            }
+
+            #endregion
+
+            #region Sample 1: Export Annotation 
+
+            CPDFDocument annotationsDocument = CPDFDocument.InitWithFilePath("Annotations.pdf"); 
+            if (ExportAnnotaiton(annotationsDocument))
+            {
+                Console.WriteLine("Export annotaiton done.");
+            }
+            else
+            {
+                Console.WriteLine("Export annotaiton failed.");
+            } 
+            Console.WriteLine("--------------------");
+            
+            #endregion
+
+            #region Sample 2: Import Annotations
+
+            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf"); 
+            if (ImportAnnotaiton(document))
+            {
+                Console.WriteLine("Import annotaiton done.");
+            }
+            else
+            {
+                Console.WriteLine("Import annotaiton failed.");
+            }
+            Console.WriteLine("--------------------");
+            
+            #endregion
+             
+            Console.WriteLine("Done");
+            Console.WriteLine("--------------------");
+            Console.ReadLine();
+        }
+
+        /// <summary>
+        ///  Export the annotations in the document to XFDF format.
+        ///  Parameters in function "ImportAnnotationFromXFDFPath":
+        ///  1. path: The path to the exported XFDF file
+        ///  2. tempPath: The path for storing temporary files. 
+        /// </summary>
+        /// <param name="document">A document with multiple annotations</param>
+        /// <returns></returns>
+        static private bool ExportAnnotaiton(CPDFDocument document)
+        {
+            var path = outputPath + "\\ExportAnnotationTest.xfdf";
+            if (!document.ExportAnnotationToXFDFPath(path, tempPath))
+            {
+                return false;
+            }
+            Console.WriteLine("Xfdf file in " + path);
+
+            return true;
+        }
+
+        /// <summary>
+        ///  Importing XFDF into the document.
+        ///  Parameters in function "ImportAnnotationFromXFDFPath":
+        ///  1. The path to the XFDF file for importing.
+        ///  2. The path for storing temporary files.  
+        /// </summary>
+        /// <param name="document">A document without annotations used for importing XFDF.</param>
+        /// <returns></returns>
+        static private bool ImportAnnotaiton(CPDFDocument document)
+        {
+            var path = outputPath + "//ImportAnnotationTest.pdf";
+
+            if (!document.ImportAnnotationFromXFDFPath("Annotations.xfdf", tempPath))
+            {
+                return false;
+            }
+            if (!document.WriteToFilePath(path))
+            {
+                return false;
+            }
+            Console.WriteLine("Browse the changed file in " + path); 
+            return true;
+        }
+    }
+}

+ 136 - 0
Demo/Examples/Samples/AnnotationImportExportTest/AnnotationImportExportTest.csproj

@@ -0,0 +1,136 @@
+<?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>{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>AnnotationImportExportTest</RootNamespace>
+    <AssemblyName>Samples_ComPDFKit</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+    <TargetFrameworkProfile />
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.0</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <PublishWizardCompleted>true</PublishWizardCompleted>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestCertificateThumbprint>25DADB233E62F3B3C59C7DCD1B72EE4F90D61C27</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestKeyFile>AnnotationImportExportTest_TemporaryKey.pfx</ManifestKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <GenerateManifests>true</GenerateManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetZone>LocalIntranet</TargetZone>
+  </PropertyGroup>
+  <PropertyGroup />
+  <PropertyGroup>
+    <SignManifests>true</SignManifests>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\LicenseKey.cs">
+      <Link>LicenseKey.cs</Link>
+    </Compile>
+    <Compile Include="AnnotationImportExportTest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\TestFile\Annotations.pdf">
+      <Link>Annotations.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\Annotations.xfdf">
+      <Link>Annotations.xfdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="AnnotationImportExportTest_TemporaryKey.pfx" />
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.6">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4.6 %28x86 和 x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

+ 6 - 0
Demo/Examples/Samples/AnnotationImportExportTest/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
+    </startup>
+</configuration>

+ 36 - 0
Demo/Examples/Samples/AnnotationImportExportTest/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("AnnotationImportExportTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AnnotationImportExportTest")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("e2693237-d8f2-4e1c-b3c3-0b3acfb73728")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 4 - 0
Demo/Examples/Samples/AnnotationImportExportTest/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="ComPDFKit.NetFramework" version="1.9.0" targetFramework="net461" />
+</packages>

+ 328 - 0
Demo/Examples/Samples/AnnotationTest/AnnotationTest.cs

@@ -0,0 +1,328 @@
+using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation;
+using ComPDFKit.PDFDocument;
+using ComPDFKit.PDFPage;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+using System.Runtime.InteropServices;
+
+namespace AnnotationTest
+{
+    internal class AnnotationTest
+    {
+        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Annotations";
+
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Running Annotation test sample…\r\n");
+            SDKLicenseHelper.LicenseVerify();
+            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+
+            if (CreateAnnots(document))
+            {
+                Console.WriteLine("Create annots done.");
+            }
+            else
+            {
+                Console.WriteLine("Create annots failed.");
+            }
+            Console.WriteLine("--------------------");
+
+            CPDFDocument annotsDocument = CPDFDocument.InitWithFilePath("Annotations.pdf");
+            if (DeleteAnnotations(annotsDocument))
+            {
+                Console.WriteLine("Create annots done.");
+            }
+            else
+            {
+                Console.WriteLine("Create annots failed.");
+            }
+
+            Console.WriteLine("--------------------");
+            Console.WriteLine("Done");
+            Console.WriteLine("--------------------");
+
+            Console.ReadLine();
+        }
+
+        /// <summary>
+        /// Create freetext annotation
+        /// </summary>
+        static private void CreateFreetextAnnotation(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            string str = "ComPDFKit Samples";
+            CPDFFreeTextAnnotation freeText = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_FREETEXT) as CPDFFreeTextAnnotation;
+            freeText.SetContent(str);
+            freeText.SetRect(new CRect(0, 100, 160, 0));
+
+            CTextAttribute textAttribute = new CTextAttribute();
+            textAttribute.FontName = "Helvetica";
+            textAttribute.FontSize = 12;
+            byte[] fontColor = { 255, 0, 0 };
+            textAttribute.FontColor = fontColor;
+            freeText.SetFreetextDa(textAttribute);
+            freeText.SetFreetextAlignment(C_TEXT_ALIGNMENT.ALIGNMENT_CENTER);
+            freeText.UpdateAp();
+        }
+
+        /// <summary>
+        /// Create freehand annotations
+        /// </summary>
+        /// <param name="document"></param>
+        static private void CreateFreehandAnnotation(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFInkAnnotation ink = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_INK) as CPDFInkAnnotation;
+            ink.SetInkColor(new byte[] { 255, 0, 0 });
+            ink.SetBorderWidth(2);
+            ink.SetTransparency(128);
+            List<List<CPoint>> points = new List<List<CPoint>>();
+            ink.SetInkPath(points);
+            ink.SetThickness(8);
+
+            points.Clear();
+            points.Add(new List<CPoint>()
+            {
+                new CPoint(10,100),
+                new CPoint(100,10),
+            });
+            ink.SetInkPath(points);
+            ink.SetInkRect(new CRect(10, 10, 200, 200));
+
+            ink.UpdateAp();
+        }
+
+        /// <summary>
+        /// Create Shape annotations
+        /// Include:
+        /// Square, Circle, Line
+        /// </summary>
+        /// <param name="document"></param>
+        static private void CreateShapeAnnotation(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            float[] dashArray = { 2, 1 };
+            byte[] lineColor = { 255, 0, 0 };
+            byte[] bgColor = { 0, 255, 0 };
+
+            // Square
+            CPDFSquareAnnotation square = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE) as CPDFSquareAnnotation;
+            square.SetRect(new CRect(10, 250, 200, 200));
+            square.SetLineColor(lineColor);
+            square.SetBgColor(bgColor);
+            square.SetTransparency(120);
+            square.SetLineWidth(1);
+            square.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, dashArray);
+            square.UpdateAp();
+
+            // Circle
+            CPDFCircleAnnotation circle = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE) as CPDFCircleAnnotation;
+            circle.SetRect(new CRect(10, 300, 110, 410));
+            circle.SetLineColor(lineColor);
+            circle.SetBgColor(bgColor);
+            circle.SetTransparency(120);
+            circle.SetLineWidth(1);
+            circle.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, dashArray);
+            circle.UpdateAp();
+
+            // Line
+            CPDFLineAnnotation line = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_LINE) as CPDFLineAnnotation;
+            line.SetLinePoints(new CPoint(300, 300), new CPoint(350, 350));
+            line.SetLineType(C_LINE_TYPE.LINETYPE_NONE, C_LINE_TYPE.LINETYPE_CLOSEDARROW);
+            line.SetLineColor(lineColor);
+            line.SetTransparency(120);
+            line.SetLineWidth(1);
+            line.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, dashArray);
+            line.UpdateAp();
+        }
+
+        /// <summary>
+        /// Create note annotations
+        /// </summary>
+        /// <param name="document"></param>
+        static private void CreateNoteAnnotation(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFTextAnnotation textAnnotation = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_TEXT) as CPDFTextAnnotation;
+            textAnnotation.SetColor(new byte[] { 255, 0, 0 });
+            textAnnotation.SetTransparency(255);
+            textAnnotation.SetContent("ComPDFKit");
+            textAnnotation.SetRect(new CRect(300, 600, 350, 650));
+            textAnnotation.UpdateAp();
+        }
+
+        /// <summary>
+        /// Create sound annotations
+        /// </summary>
+        /// <param name="document"></param>
+        static private void CreateSoundAnnotation(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFSoundAnnotation sound = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_SOUND) as CPDFSoundAnnotation;
+            sound.SetRect(new CRect(400, 700, 450, 750));
+            sound.SetSoundPath("Bird.wav");
+            sound.UpdateAp();
+        }
+
+        /// <summary>
+        /// Create Markup annotations
+        /// </summary>
+        /// <param name="document"></param>
+        static private void CreateMarkupAnnotation(CPDFDocument document)
+        {
+            List<CRect> cRectList = new List<CRect>();
+            CRect rect = new CRect(300, 240, 400, 300);
+            cRectList.Add(rect);
+            byte[] color = { 255, 0, 0 };
+
+            //highlight
+            CPDFPage page1 = document.PageAtIndex(0);
+
+            CPDFHighlightAnnotation highlight = page1.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT) as CPDFHighlightAnnotation;
+            highlight.SetColor(color);
+            highlight.SetTransparency(120);
+            highlight.SetQuardRects(cRectList);
+            highlight.UpdateAp();
+
+            //underline
+            CPDFPage page2 = document.PageAtIndex(1);
+
+            CPDFUnderlineAnnotation underline = page2.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE) as CPDFUnderlineAnnotation;
+            underline.SetColor(color);
+            underline.SetTransparency(120);
+            underline.SetQuardRects(cRectList);
+            underline.UpdateAp();
+
+            //strikeout
+            CPDFPage page3 = document.PageAtIndex(2);
+
+            CPDFStrikeoutAnnotation strikeout = page3.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT) as CPDFStrikeoutAnnotation;
+            strikeout.SetColor(color);
+            strikeout.SetTransparency(120);
+            strikeout.SetQuardRects(cRectList);
+            strikeout.UpdateAp();
+
+            //squiggly
+            CPDFPage page4 = document.PageAtIndex(3);
+
+            CPDFSquigglyAnnotation squiggy = page4.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY) as CPDFSquigglyAnnotation;
+            squiggy.SetColor(color);
+            squiggy.SetTransparency(120);
+            squiggy.SetQuardRects(cRectList);
+            squiggy.UpdateAp();
+
+        }
+
+        public static byte[] BitmapToByteArray(Bitmap bitmap)
+        {
+
+            BitmapData bmpdata = null;
+
+            try
+            {
+                bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, bitmap.PixelFormat);
+                int numbytes = bmpdata.Stride * bitmap.Height;
+                byte[] bytedata = new byte[numbytes];
+                IntPtr ptr = bmpdata.Scan0;
+
+                Marshal.Copy(ptr, bytedata, 0, numbytes);
+
+                return bytedata;
+            }
+            finally
+            {
+                if (bmpdata != null)
+                    bitmap.UnlockBits(bmpdata);
+            }
+
+        }
+
+        /// <summary>
+        /// Create stamp annotation
+        /// </summary>
+        /// <param name="document"></param>
+        static private void CreateStampAnnotation(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            // Standard
+            CPDFStampAnnotation standard = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP) as CPDFStampAnnotation;
+            standard.SetStandardStamp("Approved");
+            standard.SetRect(new CRect(300, 100, 450, 160));
+            standard.UpdateAp();
+
+            // Text
+            CPDFStampAnnotation text = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP) as CPDFStampAnnotation;
+            text.SetTextStamp("test", "detail text", C_TEXTSTAMP_SHAPE.TEXTSTAMP_LEFT_TRIANGLE, C_TEXTSTAMP_COLOR.TEXTSTAMP_RED);
+            text.SetRect(new CRect(300, 220, 450, 300));
+
+            text.UpdateAp();
+
+            // Image
+            Bitmap bitmap = new Bitmap("logo.png");
+            CPDFStampAnnotation image = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP) as CPDFStampAnnotation;
+            image.SetImageStamp(BitmapToByteArray(bitmap), bitmap.Width, bitmap.Height);
+            image.SetRect(new CRect(300, 320, 380, 400));
+            image.SetTransparency(255);
+            image.UpdateAp();
+        }
+
+        /// <summary>
+        /// Create annotations
+        /// </summary>
+        /// <param name="document"></param>
+        /// <returns></returns>
+        static private bool CreateAnnots(CPDFDocument document)
+        {
+            CreateFreetextAnnotation(document);
+            CreateFreehandAnnotation(document);
+            CreateShapeAnnotation(document);
+            CreateNoteAnnotation(document);
+            CreateShapeAnnotation(document);
+            CreateSoundAnnotation(document);
+            CreateMarkupAnnotation(document);
+            CreateStampAnnotation(document);
+            string path = outputPath + "\\CreateAnnotsTest.pdf";
+            if (!document.WriteToFilePath(path))
+            {
+                return false;
+            }
+            Console.WriteLine("Browse the changed file in " + path);
+            return true;
+        }
+
+        /// <summary>
+        /// Delete the first annotation
+        /// </summary>
+        /// <param name="document"></param>
+        /// <returns></returns>
+        static private bool DeleteAnnotations(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+
+            List<CPDFAnnotation> annotList = page.GetAnnotations();
+            var annotNum = annotList.Count;
+             
+            if (!annotList[0].RemoveAnnot())
+            {
+                return false;
+            }
+
+            string path = outputPath + "\\DeleteAnnotsTest.pdf"; 
+            if (!document.WriteToFilePath(path))
+            {
+                return false;
+            }
+            Console.WriteLine("Browse the changed file in " + path);
+
+            return true;
+        }
+    }
+}

+ 124 - 0
Demo/Examples/Samples/AnnotationTest/AnnotationTest.csproj

@@ -0,0 +1,124 @@
+<?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>{ED8A0C73-FA4E-4FAC-93F7-27C67A940628}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>AnnotationTest</RootNamespace>
+    <AssemblyName>Samples_ComPDFKit</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.0</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\LicenseKey.cs">
+      <Link>LicenseKey.cs</Link>
+    </Compile>
+    <Compile Include="AnnotationTest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\TestFile\Annotations.pdf">
+      <Link>Annotations.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\Bird.wav">
+      <Link>Bird.wav</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\TestFile\logo.png">
+      <Link>logo.png</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4.6.1 %28x86 和 x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

+ 6 - 0
Demo/Examples/Samples/AnnotationTest/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+    </startup>
+</configuration>

+ 36 - 0
Demo/Examples/Samples/AnnotationTest/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("AnnotationTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AnnotationTest")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("ed8a0c73-fa4e-4fac-93f7-27c67a940628")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 4 - 0
Demo/Examples/Samples/AnnotationTest/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="ComPDFKit.NetFramework" version="1.9.0" targetFramework="net461" />
+</packages>

+ 6 - 0
Demo/Examples/Samples/BackgroundTest/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+    </startup>
+</configuration>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 194 - 0
Demo/Examples/Samples/BackgroundTest/BackgroundTest.cs


+ 122 - 0
Demo/Examples/Samples/BackgroundTest/BackgroundTest.csproj

@@ -0,0 +1,122 @@
+<?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>{0C6D494A-036A-4CB6-AB07-61D8AC8C70CB}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>BackgroundTest</RootNamespace>
+    <AssemblyName>Viewer_ComPDFKit</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.0</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\LicenseKey.cs">
+      <Link>LicenseKey.cs</Link>
+    </Compile>
+    <Compile Include="BackgroundTest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\TestFile\ColorBackground.pdf">
+      <Link>ColorBackground.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\ImageBackground.pdf">
+      <Link>ImageBackground.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\logo.png">
+      <Link>logo.png</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4.6.1 %28x86 和 x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

+ 36 - 0
Demo/Examples/Samples/BackgroundTest/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("BackgroundTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BackgroundTest")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("0c6d494a-036a-4cb6-ab07-61d8ac8c70cb")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 4 - 0
Demo/Examples/Samples/BackgroundTest/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="ComPDFKit.NetFramework" version="1.9.0" targetFramework="net461" />
+</packages>

+ 6 - 0
Demo/Examples/Samples/BatesTest/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+    </startup>
+</configuration>

+ 190 - 0
Demo/Examples/Samples/BatesTest/BatesTest.cs

@@ -0,0 +1,190 @@
+using ComPDFKit.PDFDocument;
+using System;
+using System.Collections.Generic;
+using System.IO; 
+
+namespace BatesTest
+{
+    internal class BatesTest
+    {
+        private static string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Bates";
+        
+        private static Dictionary<int, string> IntToLocationDic = new Dictionary<int, string>()
+        {
+            {0, "Top Left" },
+            {1, "Top Middle" },
+            {2, "Top Right" },
+            {3, "Bottom Left" },
+            {4, "Bottom Middle" },
+            {5, "Bottom Right" }
+        };
+
+        static void Main(string[] args)
+        {
+            #region Preparation work
+
+            Console.WriteLine("Running bates test sample…\r\n");
+            SDKLicenseHelper.LicenseVerify();
+
+
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+
+            #endregion
+
+            #region Sample 1: Add bates
+            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+
+            if (AddBates(document))
+            {
+                Console.WriteLine("Add bates done.");
+            }
+            else
+            {
+                Console.WriteLine("Add bates failed.");
+            }
+
+            document.Release();
+
+            Console.WriteLine("--------------------");
+            #endregion
+
+            #region Samles 2: Edit bates
+             document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+
+            if (EditBates(document))
+            {
+                Console.WriteLine("Edit bates done.");
+            }
+            else
+            {
+                Console.WriteLine("Edit bates failed.");
+            }
+
+            document.Release();
+
+            Console.WriteLine("--------------------");
+
+            #endregion
+
+            #region Sample 3: Clear bates
+            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+
+            if (ClearBates(document))
+            {
+                Console.WriteLine("Clear bates done.");
+            }
+            else
+            {
+                Console.WriteLine("Clear bates failed.");
+            }
+
+            document.Release();
+            Console.WriteLine("--------------------");
+
+            #endregion
+
+            Console.WriteLine("Done!");
+            Console.WriteLine("--------------------");
+             
+            Console.ReadLine();
+        }
+
+        /// <summary>
+        /// Add a new bates
+        /// </summary>
+        /// <param name="document">Regular document</param> 
+        private static bool AddBates(CPDFDocument document)
+        {
+            string addBatesPath = outputPath + "\\AddBatesTest.pdf";
+
+            CPDFBates bates = document.GetBates();
+            byte[] color = { 255, 0, 0 };
+             
+            bates.SetPages("0-" + (document.PageCount - 1));//Page numbering from 0
+
+            for (int i = 0; i <= 5; i++)
+            {
+                bates.SetText(i, @"<<#3#5#Prefix-#-Suffix>>");  //3 digits, starting from 5
+                bates.SetTextColor(i, color);
+                bates.SetFontSize(i, 14);
+                 
+                Console.WriteLine("Text: {0}", bates.GetText(i));
+                Console.WriteLine("Location: {0}\n", IntToLocationDic[i]);
+            }
+
+            bates.Update();
+
+            if (!document.WriteToFilePath(addBatesPath))
+            {
+                return false;
+            }
+            Console.WriteLine("Browse the changed file in " + addBatesPath);
+            return true;
+        }
+
+        /// <summary>
+        /// Edit bates, <<#3#5#Prefix-#-Suffix>> -> <<#3#1#ComPDFKit-#-ComPDFKit>>
+        /// get current bates,
+        /// then edit it
+        /// </summary>
+        /// <param name="document">documet with bates</param> 
+        private static bool EditBates(CPDFDocument document)
+        {
+
+            CPDFBates bates = document.GetBates();
+            if(bates.GetText(0) != string.Empty)
+            {
+                Console.WriteLine("Get old bates 0 done, text is {0}", bates.GetText(0));
+            }
+            else
+            {
+                Console.WriteLine("Get bates 0 failed, or it does not exist");
+                return false;
+            }
+
+            bates.SetText(0, @"<<#3#1#ComPDFKit-#-ComPDFKit>>");
+
+            bates.Update();
+             
+            Console.WriteLine("Change bates 0 done, new text is {0}", bates.GetText(0));
+
+            string editBatesPath = outputPath + "\\EditBatesTest.pdf";
+
+            if (document.WriteToFilePath(editBatesPath))
+            {
+                Console.WriteLine("Browse the changed file in " + editBatesPath);
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Clear bates.
+        /// </summary>
+        /// <param name="document">documet with bates</param> 
+        private static bool ClearBates(CPDFDocument document)
+        {
+            CPDFBates bates = document.GetBates();
+
+            bates.Clear();
+
+            string clearBatesPath = outputPath + "\\ClearBatesTest.pdf";
+
+            if (document.WriteToFilePath(clearBatesPath))
+            {
+                Console.WriteLine("Browse the changed file in " + clearBatesPath);
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+    }
+}

+ 78 - 0
Demo/Examples/Samples/BatesTest/BatesTest.csproj

@@ -0,0 +1,78 @@
+<?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>{5CE5B624-B2B8-479C-8842-B70591B01124}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>BatesTest</RootNamespace>
+    <AssemblyName>Samples_ComPDFKit</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\LicenseKey.cs" />
+    <Compile Include="BatesTest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="..\..\TestFile\CommonFivePage.pdf">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\license_key_windows.xml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

+ 37 - 0
Demo/Examples/Samples/BatesTest/LicenseKey.cs

@@ -0,0 +1,37 @@
+using ComPDFKit.NativeMethod;
+using System.Xml;
+
+public class SDKLicenseHelper
+{
+    public string key = string.Empty;
+    public string secret = string.Empty;
+
+    public SDKLicenseHelper()
+    {
+        string sdkLicensePath = "license_key_windows.xml";
+        XmlDocument xmlDocument = new XmlDocument();
+        xmlDocument.Load(sdkLicensePath);
+        var node = xmlDocument.SelectSingleNode("License");
+        if (node != null)
+        {
+            key = node.Attributes["key"].Value;
+            secret = node.Attributes["secret"].Value;
+        }
+    }
+
+    public static bool LicenseVerify()
+    {
+        bool result = false;
+
+        result = CPDFSDKVerifier.LoadNativeLibrary();
+        if (!result)
+            return false;
+
+        SDKLicenseHelper sdkLicenseHelper = new SDKLicenseHelper();
+
+        LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(sdkLicenseHelper.key, sdkLicenseHelper.secret);
+        if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
+            return false;
+        return result;
+    }
+}

+ 36 - 0
Demo/Examples/Samples/BatesTest/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("BatesTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BatesTest")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5ce5b624-b2b8-479c-8842-b70591b01124")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 2
Demo/Examples/license_key_win.xml


+ 4 - 0
Demo/Examples/Samples/BatesTest/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="ComPDFKit.NetFramework" version="1.9.0" targetFramework="net461" />
+</packages>

+ 6 - 0
Demo/Examples/Samples/BookmarkTest/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+    </startup>
+</configuration>

+ 159 - 0
Demo/Examples/Samples/BookmarkTest/BookmarkTest.cs

@@ -0,0 +1,159 @@
+using ComPDFKit.PDFDocument;
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+namespace BookmarkTest
+{
+    internal class BookmarkTest
+    {
+        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Bookmark";
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Running Bookmark test sample…\r\n");
+
+            SDKLicenseHelper.LicenseVerify();
+
+            CPDFDocument document = CPDFDocument.InitWithFilePath("ThreeBookmark.pdf");
+
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+
+            #region Sample 1: Access bookmark
+
+            if (AccessBookmark(document))
+            {
+                Console.WriteLine("Check bookmark list done.");
+            }
+            else
+            {
+                Console.WriteLine("Check bookmark list failed.");
+                Console.WriteLine("--------------------");
+                Console.WriteLine("Stop.");
+                Console.WriteLine("--------------------");
+                Console.ReadLine();
+                return;
+            }
+            document.Release();
+            Console.WriteLine("--------------------");
+             
+            #endregion
+
+            #region Sample 2: Create bookmark
+
+            document = CPDFDocument.InitWithFilePath("ThreeBookmark.pdf");
+
+            if (CreateBookmark(document))
+            {
+                Console.WriteLine("Add bookmark done.");
+            }
+            else
+            {
+                Console.WriteLine("Add bookmark failed.");
+            }
+            document.Release();
+            Console.WriteLine("--------------------");
+
+            #endregion
+
+            #region Sample 3: Create bookmark
+
+            document = CPDFDocument.InitWithFilePath("ThreeBookmark.pdf");
+
+            if (RemoveBookmark(document))
+            {
+                Console.WriteLine("Remove bookmark done.");
+            }
+            else
+            {
+                Console.WriteLine("Remove bookmark done.");
+            }
+
+            document.Release();
+            Console.WriteLine("--------------------");
+
+            #endregion
+            
+            Console.WriteLine("Done!");
+            Console.WriteLine("--------------------");
+            Console.ReadLine();
+        }
+
+        /// <summary>
+        /// Access bookmark
+        /// </summary> 
+        static private bool AccessBookmark(CPDFDocument document)
+        {
+            List<CPDFBookmark> bookmarkList = document.GetBookmarkList();
+            if (bookmarkList.Count == 3)
+            {
+                Console.WriteLine("Access bookmark list done.");
+            }
+            else
+            {
+                return false;
+            }
+            if (document.BookmarkForPageIndex(0).Title == "Bookmark1")
+            {
+                Console.WriteLine("Access bookmark for a page done.");
+            }
+            else
+            {
+                return false;
+            }
+            return true;
+        }
+
+        /// <summary>
+        /// Create bookmark
+        /// </summary> 
+        static private bool CreateBookmark(CPDFDocument document)
+        {
+            var bookmarkCount = document.GetBookmarkList().Count;
+            CPDFBookmark bookmark = new CPDFBookmark();
+            bookmark.Title = "new bookmark";
+            bookmark.PageIndex = 4;
+            document.AddBookmark(bookmark);
+            if (!(document.GetBookmarkList().Count - bookmarkCount == 1))
+            {
+                return false;
+            }
+            Console.WriteLine("Add bookmark in page {0}. ", bookmark.PageIndex + 1);
+            string addBookmarkPath = outputPath + "//AddBookmarkTest.pdf";
+            if (document.WriteToFilePath(addBookmarkPath))
+            {
+                Console.WriteLine("Browse the changed file in " + addBookmarkPath);
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Remove bookmark
+        /// </summary> 
+        static private bool RemoveBookmark(CPDFDocument document)
+        {
+            var bookmarkCount = document.GetBookmarkList().Count;
+            document.RemoveBookmark(0);
+            if (!(bookmarkCount - document.GetBookmarkList().Count == 1))
+            {
+                return false;
+            }
+            string removeBookmarkPath = outputPath + "//RemoveBookmarkTest.pdf";
+            if (document.WriteToFilePath(removeBookmarkPath))
+            {
+                Console.WriteLine("Browse the changed file in " + removeBookmarkPath);
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+    }
+}

+ 86 - 0
Demo/Examples/Samples/BookmarkTest/BookmarkTest.csproj

@@ -0,0 +1,86 @@
+<?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>{26E617CD-C1D7-4EC2-AC9F-E3F4546B2202}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>BookmarkTest</RootNamespace>
+    <AssemblyName>Samples_ComPDFKit</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\ComPDFKit.NetFramework.1.9.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\LicenseKey.cs">
+      <Link>LicenseKey.cs</Link>
+    </Compile>
+    <Compile Include="BookmarkTest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\ThreeBookmark.pdf">
+      <Link>ThreeBookmark.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

+ 36 - 0
Demo/Examples/Samples/BookmarkTest/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("BookmarkTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BookmarkTest")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("26e617cd-c1d7-4ec2-ac9f-e3f4546b2202")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.9.1.0")]
+[assembly: AssemblyFileVersion("1.9.1.0")]

+ 4 - 0
Demo/Examples/Samples/BookmarkTest/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="ComPDFKit.NetFramework" version="1.9.0" targetFramework="net461" />
+</packages>

+ 6 - 0
Demo/Examples/Samples/DocumentCompare/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+    </startup>
+</configuration>

+ 89 - 0
Demo/Examples/Samples/DocumentCompare/DocumentCompare.cs

@@ -0,0 +1,89 @@
+using ComPDFKit.Compare;
+using ComPDFKit.PDFDocument;
+using System; 
+using System.IO; 
+
+namespace DocumentCompareTest
+{
+    internal class DocumentCompare
+    {
+        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\DocumentCompare";
+
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Running PDFPage test sample…\r\n");
+
+            SDKLicenseHelper.LicenseVerify();
+            
+
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+
+            CPDFDocument document1 = CPDFDocument.InitWithFilePath("ElectricalDiagram.pdf");
+            CPDFDocument document2 = CPDFDocument.InitWithFilePath("ElectricalDiagram_New.pdf");
+            if (OverlayCompareDocument(document1, document2))
+            {
+                Console.WriteLine("Compare document done.");
+            }
+            else
+            {
+                Console.WriteLine("Compare document failed."); 
+            }
+            document1.Release();
+            document2.Release();
+            Console.WriteLine("--------------------");
+
+            CPDFDocument document3 = CPDFDocument.InitWithFilePath("Text.pdf");
+            CPDFDocument document4 = CPDFDocument.InitWithFilePath("TextChanged.pdf");
+            if (ContentCompareDocument(document3, document4))
+            {
+                Console.WriteLine("Compare document done.");
+            }
+            else
+            {
+                Console.WriteLine("Compare document failed.");
+            }
+            document3.Release();
+            document4.Release();
+            Console.WriteLine("--------------------");
+
+            Console.WriteLine("Done!");
+            Console.WriteLine("--------------------");
+            Console.ReadLine();
+        }
+
+        static private bool OverlayCompareDocument(CPDFDocument document1, CPDFDocument document2)
+        {
+            CPDFCompareOverlay compareOverlay = new CPDFCompareOverlay(document1, "1-5", document2, "1-5");
+            compareOverlay.Compare();
+            CPDFDocument comparisonDocument = compareOverlay.ComparisonDocument();
+            string path = outputPath + "\\CompareDocumentTest.pdf";
+            if (!comparisonDocument.WriteToFilePath(path))
+            {
+                return false;
+            }
+            Console.WriteLine("Browse the changed file in " + path);
+            return true;
+        }
+
+        static private bool ContentCompareDocument(CPDFDocument document, CPDFDocument documentNew)
+        {
+            CPDFCompareContent compareContent = new CPDFCompareContent(document, documentNew);
+            int pageCount = Math.Min(document.PageCount, documentNew.PageCount);
+            for (int i = 0; i < pageCount; i++)
+            {
+                Console.WriteLine("Page: {0}", i);
+
+                CPDFCompareResults compareResults = compareContent.Compare(i, i, CPDFCompareType.CPDFCompareTypeAll, true);
+                Console.WriteLine("Replace count: {0}", compareResults.ReplaceCount);
+                Console.WriteLine("TextResults count: {0}", compareResults.TextResults.Count);
+                Console.WriteLine("Delete count: {0}", compareResults.DeleteCount);
+                Console.WriteLine("Insert count: {0}", compareResults.InsertCount); 
+            }
+           
+            return true;
+        }
+    }
+}

+ 0 - 0
Demo/Examples/Samples/DocumentCompare/DocumentCompareTest.csproj


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů