Browse Source

Merge branch 'compdfkit_demo_windows' into compdfkit_demo_win_dev

# Conflicts:
#	Demo/Examples/Annotations/MainWindow.xaml
#	Demo/Examples/Compdfkit_Tools/PDFView/PDFDisplaySettings/PDFDisplaySettingsUI/CPDFViewModeUI.xaml
#	Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml
#	Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml.cs
#	Demo/Examples/Compdfkit_Tools/Properties/AssemblyInfo.cs
#	Demo/Examples/ContentEditor/MainWindow.xaml
#	Demo/Examples/DocsEditor/MainWindow.xaml
#	Demo/Examples/Forms/MainWindow.xaml
#	Demo/Examples/PDFViewer/MainPage.xaml
#	Demo/Examples/Viewer/MainWindow.xaml
#	Demo/Examples/Viewer/Properties/AssemblyInfo.cs
#	Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/build/x64/ComPDFKit.dll
#	Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/lib/ComPDFKit.Desk.dll
#	Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/lib/ComPDFKit.Viewer.dll
liuaoran 1 year ago
parent
commit
ca11419223
62 changed files with 1496 additions and 422 deletions
  1. 2 2
      Demo/Examples/Annotations/Annotations.csproj
  2. 4 0
      Demo/Examples/Annotations/MainWindow.xaml.cs
  3. 5 5
      Demo/Examples/Annotations/Properties/AssemblyInfo.cs
  4. 4 28
      Demo/Examples/Annotations/Properties/Resources.Designer.cs
  5. BIN
      Demo/Examples/ComPDFKit.NetFramework.1.9.0.nupkg
  6. 59 158
      Demo/Examples/Compdfkit_Tools/Common/Helper/CommonHelper.cs
  7. 2 2
      Demo/Examples/Compdfkit_Tools/Compdfkit_Tools.csproj
  8. 6 12
      Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml
  9. 149 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml
  10. 241 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml.cs
  11. 42 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageUI/CPDFImageFlipUI.xaml
  12. 37 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageUI/CPDFImageFlipUI.xaml.cs
  13. 55 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageUI/CPDFImageRotateUI.xaml
  14. 37 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageUI/CPDFImageRotateUI.xaml.cs
  15. 94 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditControl/PDFTextEditControl.xaml
  16. 202 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditControl/PDFTextEditControl.xaml.cs
  17. 60 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextAlignUI.xaml
  18. 86 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextAlignUI.xaml.cs
  19. 79 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextStyleUI.xaml
  20. 159 0
      Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextStyleUI.xaml.cs
  21. 1 2
      Demo/Examples/Compdfkit_Tools/PDFView/PDFInfo/CPDFCreateInfoControl.xaml
  22. 6 10
      Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml.cs
  23. 4 29
      Demo/Examples/Compdfkit_Tools/Properties/Resources.Designer.cs
  24. 2 2
      Demo/Examples/ContentEditor/ContentEditor.csproj
  25. 4 0
      Demo/Examples/ContentEditor/MainWindow.xaml.cs
  26. 6 6
      Demo/Examples/ContentEditor/Properties/AssemblyInfo.cs
  27. 4 30
      Demo/Examples/ContentEditor/Properties/Resources.Designer.cs
  28. 2 2
      Demo/Examples/DocsEditor/DocsEditor.csproj
  29. 4 0
      Demo/Examples/DocsEditor/MainWindow.xaml.cs
  30. 6 6
      Demo/Examples/DocsEditor/Properties/AssemblyInfo.cs
  31. 3 29
      Demo/Examples/DocsEditor/Properties/Resources.Designer.cs
  32. 2 2
      Demo/Examples/Forms/Forms.csproj
  33. 1 0
      Demo/Examples/Forms/MainWindow.xaml.cs
  34. 6 6
      Demo/Examples/Forms/Properties/AssemblyInfo.cs
  35. 4 29
      Demo/Examples/Forms/Properties/Resources.Designer.cs
  36. 61 1
      Demo/Examples/PDFViewer/MainPage.xaml.cs
  37. 2 2
      Demo/Examples/PDFViewer/PDFViewer.csproj
  38. 2 2
      Demo/Examples/Samples/AnnotationImportExportTest/AnnotationImportExportTest.csproj
  39. 2 2
      Demo/Examples/Samples/AnnotationTest/AnnotationTest.csproj
  40. 2 2
      Demo/Examples/Samples/BackgroundTest/BackgroundTest.csproj
  41. 2 2
      Demo/Examples/Samples/BatesTest/BatesTest.csproj
  42. 3 3
      Demo/Examples/Samples/BookmarkTest/BookmarkTest.csproj
  43. 6 10
      Demo/Examples/Samples/DocumentCompare/DocumentCompareTest.csproj
  44. 2 2
      Demo/Examples/Samples/DocumentInfoTest/DocumentInfoTest.csproj
  45. 2 2
      Demo/Examples/Samples/EncryptTest/EncryptTest.csproj
  46. 2 2
      Demo/Examples/Samples/FlattenTest/FlattenTest.csproj
  47. 2 2
      Demo/Examples/Samples/HeaderFooterTest/HeaderFooterTest.csproj
  48. 2 2
      Demo/Examples/Samples/ImageExtractTest/ImageExtractTest.csproj
  49. 2 2
      Demo/Examples/Samples/InteractiveFormsTest/InteractiveFormsTest.csproj
  50. 6 10
      Demo/Examples/Samples/OutlineTest/OutlineTest.csproj
  51. 2 2
      Demo/Examples/Samples/PDFATest/PDFATest.csproj
  52. 2 2
      Demo/Examples/Samples/PDFPageTest/PDFPageTest.csproj
  53. 2 2
      Demo/Examples/Samples/PDFRedactTest/PDFRedactTest.csproj
  54. 2 2
      Demo/Examples/Samples/PDFToImage/PDFToImageTest.csproj
  55. 2 2
      Demo/Examples/Samples/TextExtractTest/TextExtractTest.csproj
  56. 2 2
      Demo/Examples/Samples/TextSearchTest/TextSearchTest.csproj
  57. 2 2
      Demo/Examples/Samples/WatermarkTest/WatermarkTest.csproj
  58. 4 0
      Demo/Examples/Viewer/MainWindow.xaml.cs
  59. 2 2
      Demo/Examples/Viewer/Viewer.csproj
  60. BIN
      Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/ComPDFKit.NetFramework.1.9.0.nupkg
  61. BIN
      Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/lib/ComPDFKit.Desk.dll
  62. BIN
      Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/lib/ComPDFKit.Viewer.dll

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

@@ -42,10 +42,10 @@
     <ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="PresentationFramework.Aero2" />

+ 4 - 0
Demo/Examples/Annotations/MainWindow.xaml.cs

@@ -89,6 +89,10 @@ namespace Annotations
 
         private void LoadDocument()
         {
+            if (pdfViewControl.PDFView.Document == null)
+            {
+                return;
+            }
             pdfViewControl.PDFView?.Load();
             pdfViewControl.PDFView?.SetShowLink(true);
             PDFGrid.Child = pdfViewControl;

+ 5 - 5
Demo/Examples/Annotations/Properties/AssemblyInfo.cs

@@ -7,12 +7,12 @@ using System.Windows;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("annotation-ctrl-demo")]
+[assembly: AssemblyTitle("Annotations_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("annotation-ctrl-demo")]
-[assembly: AssemblyCopyright("Copyright ©  2023")]
+[assembly: AssemblyProduct("Annotations_ComPDFKit")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
@@ -51,5 +51,5 @@ using System.Windows;
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
 //通过使用 "*",如下所示:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.9.0.0")]
+[assembly: AssemblyFileVersion("1.9.0.0")]

+ 4 - 28
Demo/Examples/Annotations/Properties/Resources.Designer.cs

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

BIN
Demo/Examples/ComPDFKit.NetFramework.1.9.0.nupkg


+ 59 - 158
Demo/Examples/Compdfkit_Tools/Common/Helper/CommonHelper.cs

@@ -75,20 +75,10 @@ namespace Compdfkit_Tools.Helper
             }
             return selectedFilePath;
         }
-
-        /// <summary>
-        /// 校验PageRange 输入是否合法,且可返回List<int> Pages  存放的索引值
-        /// </summary>
-        /// <param name="pageList">返回的页面集合</param>
-        /// <param name="pageRange">需要判断的文本</param>
-        /// <param name="count">页面总数</param>
-        /// <param name="enumerationSeparator">例 new char[] { ',' }</param>
-        /// <param name="rangeSeparator">例 new char[] { '-' }</param>
-        /// <param name="inittag"></param>
-        /// <returns></returns>
+         
         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();
 
@@ -99,27 +89,25 @@ namespace Compdfkit_Tools.Helper
                 {
                     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]);
                             int end = int.Parse(limits[1]);
 
                             if ((start < starttag) || (end > count) || (start > end))
-                            {
-                                //throw new Exception(string.Format("Invalid page(s) in range {0} - {1}", start, end));
+                            { 
                                 return false;
                             }
 
                             for (int i = start; i <= end; ++i)
                             {
                                 if (pageList.Contains(i))
-                                {
-                                    // throw new Exception(string.Format("Invalid page(s) in range {0} - {1}", start, end));
+                                { 
                                     return false;
                                 }
 
@@ -129,30 +117,26 @@ namespace Compdfkit_Tools.Helper
                         }
                     }
                     catch (Exception ex)
-                    {
-                        //MessageBox.Show("请检查符号或页码范围是否正确。","提示",MessageBoxButton.OKCancel,MessageBoxImage.Warning);
+                    { 
                         return false;
                     }
                 }
                 int pageNr;
                 try
-                {
-                    // Single page
-                    pageNr = int.Parse(range);//单页
+                { 
+                    pageNr = int.Parse(range); 
                 }
-                catch (Exception)//格式不正确时
+                catch (Exception) 
                 {
                     return false;
                 }
                 if (pageNr < starttag || pageNr > count)
                 {
-                    return false;
-                    //throw new Exception(string.Format("Invalid page {0}", pageNr));
+                    return false; 
                 }
                 if (pageList.Contains(pageNr))
                 {
-                    return false;
-                    // throw new Exception(string.Format("Invalid page {0}", pageNr));
+                    return false; 
                 }
                 pageList.Add(pageNr - 1);
             }
@@ -160,8 +144,7 @@ namespace Compdfkit_Tools.Helper
         }
 
         internal static class PageEditHelper
-        {
-            //Find Child Element By Parents Element
+        { 
             public static T FindVisualParent<T>(DependencyObject obj) where T : class
             {
                 while (obj != null)
@@ -242,10 +225,7 @@ namespace Compdfkit_Tools.Helper
         }
 
         public class ArrowHelper
-        {
-            /// <summary>
-            /// 是否有开始箭头
-            /// </summary>
+        { 
             public bool HasStartArrow
             {
                 get
@@ -256,10 +236,8 @@ namespace Compdfkit_Tools.Helper
                     }
                     return false;
                 }
-            }
-            /// <summary>
-            /// 开始箭头是否封闭
-            /// </summary>
+            } 
+
             public bool IsStartClosed
             {
                 get
@@ -270,10 +248,8 @@ namespace Compdfkit_Tools.Helper
                     }
                     return false;
                 }
-            }
-            /// <summary>
-            /// 是否有结束箭头
-            /// </summary>
+            } 
+
             public bool HasEndArrow
             {
                 get
@@ -284,10 +260,8 @@ namespace Compdfkit_Tools.Helper
                     }
                     return false;
                 }
-            }
-            /// <summary>
-            /// 结束箭头是否封闭
-            /// </summary>
+            } 
+
             public bool IsEndClosed
             {
                 get
@@ -298,38 +272,15 @@ namespace Compdfkit_Tools.Helper
                     }
                     return false;
                 }
-            }
-            /// <summary>
-            /// 箭头角度
-            /// </summary>
-            public uint ArrowAngle { get; set; }
-            /// <summary>
-            /// 箭头长度
-            /// </summary>
-            public uint ArrowLength { get; set; }
-            /// <summary>
-            /// 起始点
-            /// </summary>
-            public Point? LineStart { get; set; }
-            /// <summary>
-            /// 结束点
-            /// </summary>
-            public Point? LineEnd { get; set; }
-            /// <summary>
-            /// 线段路径
-            /// </summary>
-            public PathGeometry Body { get; set; }
-            /// <summary>
-            /// 开始箭头形状
-            /// </summary>
-            public C_LINE_TYPE StartSharp { get; set; }
-            /// <summary>
-            /// 结束箭头形状
-            /// </summary>
-            public C_LINE_TYPE EndSharp { get; set; }
-            /// <summary>
-            /// 箭头帮助类
-            /// </summary>
+            } 
+
+            public uint ArrowAngle { get; set; } 
+            public uint ArrowLength { get; set; } 
+            public Point? LineStart { get; set; } 
+            public Point? LineEnd { get; set; } 
+            public PathGeometry Body { get; set; } 
+            public C_LINE_TYPE StartSharp { get; set; } 
+            public C_LINE_TYPE EndSharp { get; set; } 
             public ArrowHelper()
             {
                 Body = new PathGeometry();
@@ -340,13 +291,10 @@ namespace Compdfkit_Tools.Helper
             {
                 if (LineStart != null && LineEnd != null)
                 {
-                    PathFigure lineFigure = new PathFigure();
-                    // lineFigure.IsClosed = true;
+                    PathFigure lineFigure = new PathFigure(); 
                     lineFigure.StartPoint = (Point)LineStart;
                     LineSegment linePath = new LineSegment();
-                    linePath.Point = (Point)LineEnd;
-                    //linePath.IsSmoothJoin = true;
-                    //linePath.IsStroked = true;
+                    linePath.Point = (Point)LineEnd; 
                     lineFigure.Segments.Add(linePath);
                     return lineFigure;
                 }
@@ -407,11 +355,8 @@ namespace Compdfkit_Tools.Helper
                         break;
                 }
                 return null;
-            }
-            /// <summary>
-            /// 创建箭头路径
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             public PathGeometry BuildArrowBody()
             {
                 Body.Figures.Clear();
@@ -432,11 +377,7 @@ namespace Compdfkit_Tools.Helper
                 }
                 return Body;
             }
-
-            /// <summary>
-            /// 绘制开始箭头
-            /// </summary>
-            /// <returns></returns>
+             
             private PathFigure CreateStartOpenArrow()
             {
                 if (ArrowLength == 0 || !HasStartArrow || LineStart == null || LineEnd == null || ArrowAngle == 0)
@@ -458,11 +399,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.IsClosed = IsStartClosed;
                 arrowFigure.IsFilled = IsStartClosed;
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制结束箭头
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateEndOpenArrow()
             {
                 if (ArrowLength == 0 || !HasEndArrow || LineStart == null || LineEnd == null || ArrowAngle == 0)
@@ -484,11 +422,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.IsClosed = IsEndClosed;
                 arrowFigure.IsFilled = IsEndClosed;
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制开始箭头(逆向)
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateStartReverseArrow()
             {
                 if (ArrowLength == 0 || !HasStartArrow || LineStart == null || LineEnd == null || ArrowAngle == 0)
@@ -510,11 +445,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.IsClosed = IsStartClosed;
                 arrowFigure.IsFilled = IsStartClosed;
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制结束箭头(逆向)
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateEndReverseArrow()
             {
                 if (ArrowLength == 0 || !HasEndArrow || LineStart == null || LineEnd == null || ArrowAngle == 0)
@@ -537,11 +469,7 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.IsFilled = IsEndClosed;
                 return arrowFigure;
             }
-
-            /// <summary>
-            /// 绘制开始平头
-            /// </summary>
-            /// <returns></returns>
+             
             private PathFigure CreateStartButtArrow()
             {
                 if (ArrowLength == 0 || !HasStartArrow || LineStart == null || LineEnd == null)
@@ -560,11 +488,8 @@ namespace Compdfkit_Tools.Helper
                 buttSegment.Point = ((Point)LineStart + (lineVector * rotateMatrix));
                 arrowFigure.Segments.Add(buttSegment);
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制结束平头
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateEndButtArrow()
             {
                 if (ArrowLength == 0 || !HasEndArrow || LineStart == null || LineEnd == null)
@@ -584,11 +509,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.Segments.Add(buttSegment);
 
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制开始菱形
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateStartDiamondArrow()
             {
                 if (ArrowLength == 0 || !HasStartArrow || LineStart == null || LineEnd == null)
@@ -626,11 +548,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.IsClosed = IsStartClosed;
                 arrowFigure.IsFilled = IsStartClosed;
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制结束菱形
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateEndDiamondArrow()
             {
 
@@ -669,11 +588,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.IsClosed = IsEndClosed;
                 arrowFigure.IsFilled = IsEndClosed;
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制开始圆形
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateStartRoundArrow()
             {
                 if (ArrowLength == 0 || !HasStartArrow || LineStart == null || LineEnd == null)
@@ -699,11 +615,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.Segments.Add(circleSegment);
 
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制结束圆形
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateEndRoundArrow()
             {
                 if (ArrowLength == 0 || !HasEndArrow || LineStart == null || LineEnd == null)
@@ -729,11 +642,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.Segments.Add(circleSegment);
 
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制开始方形
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateStartSquareArrow()
             {
                 if (ArrowLength == 0 || !HasStartArrow || LineStart == null || LineEnd == null)
@@ -766,11 +676,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.Segments.Add(squreSegment);
 
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制结束方形
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateEndSquareArrow()
             {
 
@@ -804,11 +711,8 @@ namespace Compdfkit_Tools.Helper
                 arrowFigure.Segments.Add(squreSegment);
 
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制开始斜线
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateStartSlashArrow()
             {
                 if (ArrowLength == 0 || !HasStartArrow || LineStart == null || LineEnd == null)
@@ -827,11 +731,8 @@ namespace Compdfkit_Tools.Helper
                 buttSegment.Point = ((Point)LineStart + (lineVector * rotateMatrix));
                 arrowFigure.Segments.Add(buttSegment);
                 return arrowFigure;
-            }
-            /// <summary>
-            /// 绘制结束斜线
-            /// </summary>
-            /// <returns></returns>
+            } 
+
             private PathFigure CreateEndSlashArrow()
             {
                 if (ArrowLength == 0 || !HasEndArrow || LineStart == null || LineEnd == null)

+ 2 - 2
Demo/Examples/Compdfkit_Tools/Compdfkit_Tools.csproj

@@ -44,10 +44,10 @@
     <ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="PresentationFramework.Aero2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

+ 6 - 12
Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml

@@ -34,14 +34,11 @@
         <Border Background="White" Grid.Row="1" MinHeight="100" CornerRadius="5" Margin="0,16,0,0" BorderThickness="1" BorderBrush="#E2E3E6">
             <Image Name="ImageThumbUI" MaxHeight="80" MaxWidth="230" Stretch="Uniform"></Image>
         </Border>
-        
-        <!--图片旋转-->
+         
         <local:CPDFImageRotateUI x:Name="RotateUI" Grid.Row="2" FontSize="16" Margin="0,33,0,0"></local:CPDFImageRotateUI>
-        
-        <!--图片翻转-->
+         
         <local:CPDFImageFlipUI x:Name="FlipUI" Grid.Row="3" FontSize="16" Margin="0,10,0,0"></local:CPDFImageFlipUI>
-        
-        <!--透明度-->
+         
         <Grid Grid.Row="4" Margin="0,20,0,0">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="*"></ColumnDefinition>
@@ -96,8 +93,7 @@
             <TextBlock VerticalAlignment="Center" FontSize="14" Foreground="#43474D">Tool</TextBlock>
 
             <Border  Grid.Row="1" BorderThickness="1" BorderBrush="#E1E3E5"  Margin="0,14,0,0" Width="120" HorizontalAlignment="Left">
-                <StackPanel Orientation="Horizontal">
-                    <!--图片替换-->
+                <StackPanel Orientation="Horizontal"> 
                     <Button Width="40" Height="25" BorderThickness="0" Click="ImageReplaceBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}">
                         <Button.Content>
                             <Path Fill="#43474D">
@@ -113,8 +109,7 @@
                             </Path>
                         </Button.Content>
                     </Button>
-
-                    <!--图片导出-->
+ 
                     <Button Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageExportBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}">
                         <Button.Content>
                             <Path Fill="#43474D">
@@ -126,8 +121,7 @@
                             </Path>
                         </Button.Content>
                     </Button>
-
-                    <!--图片裁剪-->
+ 
                     <Button Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageClipBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}">
                         <Button.Content>
                             <Path Fill="#43474D">

+ 149 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml

@@ -0,0 +1,149 @@
+<UserControl x:Class="Compdfkit_Tools.Edit.PDFImageEditControl"
+             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"
+             xmlns:common="clr-namespace:Compdfkit_Tools.Common"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800" MinWidth="260" Padding="10">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../../../Asset/Styles/SliderStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition Height="auto"></RowDefinition>
+        </Grid.RowDefinitions>
+
+        <Border Background="White" Height="36">
+            <TextBlock FontSize="14" FontWeight="Bold" HorizontalAlignment="Center" Foreground="#42464D" VerticalAlignment="Center">Image Properties</TextBlock>
+        </Border>
+
+        <Border Background="White" Grid.Row="1" MinHeight="100" CornerRadius="5" Margin="0,16,0,0" BorderThickness="1" BorderBrush="#E2E3E6">
+            <Image Name="ImageThumbUI" MaxHeight="80" MaxWidth="230" Stretch="Uniform"></Image>
+        </Border>
+        
+        <!--图片旋转-->
+        <local:CPDFImageRotateUI x:Name="RotateUI" Grid.Row="2" FontSize="16" Margin="0,33,0,0"></local:CPDFImageRotateUI>
+        
+        <!--图片翻转-->
+        <local:CPDFImageFlipUI x:Name="FlipUI" Grid.Row="3" FontSize="16" Margin="0,10,0,0"></local:CPDFImageFlipUI>
+        
+        <!--透明度-->
+        <Grid Grid.Row="4" Margin="0,20,0,0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+            </Grid.RowDefinitions>
+
+            <TextBlock FontSize="14" Foreground="#43474D">Opacity:</TextBlock>
+
+            <Slider Style="{StaticResource SliderStyle}" Grid.Row="1" Width="148" Height="28"
+                    Name="ImasgeOpacitySlider" 
+                    Value="14"  
+                    IsSelectionRangeEnabled="True" 
+                    IsMoveToPointEnabled="True" 
+                    Margin="2,20,2,0"  
+                    Maximum="1" 
+                    Minimum="0" 
+                    TickFrequency="0.01"
+                    IsSnapToTickEnabled="True" 
+                    Thumb.DragCompleted="SliderOpacity_DragCompleted"
+                    Thumb.DragStarted="Slider_DragStarted"
+                    ValueChanged="SliderOpacity_ValueChanged"
+                    Tag="true"
+                    />
+
+            <Grid Grid.Row="1" Grid.Column="1" Margin="0,10,0,0">
+                <ComboBox Name="OpacityComboBox" VerticalContentAlignment="Center" Width="72" Height="28" Foreground="#43474D" FontSize="14"
+                              SelectionChanged="OpacityComboBox_SelectionChanged" BorderBrush="#1E000000">
+                    <ComboBoxItem>25%</ComboBoxItem>
+                    <ComboBoxItem>50%</ComboBoxItem>
+                    <ComboBoxItem>75%</ComboBoxItem>
+                    <ComboBoxItem>100%</ComboBoxItem>
+                </ComboBox>
+                <TextBox Name="OpacityTextBox" IsHitTestVisible="False" Width="72" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
+                             IsReadOnly="True" Background="White" Padding="0,0,15,0" FontSize="14">100%</TextBox>
+                <Path Fill="#43474D" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" IsHitTestVisible="False">
+                    <Path.Data>
+                        M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
+                    </Path.Data>
+                </Path>
+            </Grid>
+        </Grid>
+    
+        <Grid Grid.Row="5" Margin="0,20,0,0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+            </Grid.RowDefinitions>
+            <TextBlock VerticalAlignment="Center" FontSize="14" Foreground="#43474D">Tool</TextBlock>
+
+            <Border  Grid.Row="1" BorderThickness="1" BorderBrush="#E1E3E5"  Margin="0,14,0,0" Width="120" HorizontalAlignment="Left">
+                <StackPanel Orientation="Horizontal">
+                    <!--图片替换-->
+                    <Button Width="40" Height="25" BorderThickness="0" Click="ImageReplaceBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}">
+                        <Button.Content>
+                            <Path Fill="#43474D">
+                                <Path.Data>
+                                    M1.12988 1.88037H0.379883V2.63037V14.3971V15.1471H1.12988H4.47057V16.2589V17.7589H5.97057H11.9871V16.915L11.9995 16L8.64639 
+                                14.3971L5.97057 15.9838V7.49225H18.0035V12.7161H19.5035V7.49225V5.99225H18.0035H16.9129V2.63037V1.88037H16.1629H1.12988ZM15.4129 
+                                5.99225V3.38037H1.87988V13.6471H4.47057V7.49225V5.99225H5.97057H15.4129ZM14.6574 10.5265C15.2097 10.5265 15.6574 10.0759 15.6574 
+                                9.5201C15.6574 8.9643 15.2097 8.51373 14.6574 8.51373C14.1051 8.51373 13.6574 8.9643 13.6574 9.5201C13.6574 10.0759 14.1051 10.5265 
+                                14.6574 10.5265ZM15.3635 12.4771L14.8863 11.8985L16.0436 10.9442L16.5208 11.5229L17.9828 13.2959L18.9947 
+                                14.5231H17.4042H12.9994H12.2494V13.0231H12.9994H15.8136L15.3635 12.4771ZM15.8007 17.2959L16.2779 17.8746L15.1206 18.8289L14.6434 
+                                18.2502L13.1814 16.4771L12.1695 15.25H13.76H18.1648H18.9148V16.75H18.1648H15.3506L15.8007 17.2959Z
+                                </Path.Data>
+                            </Path>
+                        </Button.Content>
+                    </Button>
+
+                    <!--图片导出-->
+                    <Button Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageExportBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}">
+                        <Button.Content>
+                            <Path Fill="#43474D">
+                                <Path.Data>
+                                    M12.3597 7.35973L8.75 10.9694L8.75 1V0.25H7.25V1L7.25 10.9694L3.6403 7.35973L3.10997 6.8294L2.04931 7.89006L2.57964 8.42039L7.46967 
+                                    13.3104C7.76256 13.6033 8.23744 13.6033 8.53033 13.3104L13.4204 8.42039L13.9507 7.89006L12.89 6.8294L12.3597 7.35973ZM1 
+                                    15.1538H0.25V16.6538H1H15.3077H16.0577V15.1538H15.3077H1Z
+                                </Path.Data>
+                            </Path>
+                        </Button.Content>
+                    </Button>
+
+                    <!--图片裁剪-->
+                    <Button Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageClipBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}">
+                        <Button.Content>
+                            <Path Fill="#43474D">
+                                <Path.Data>
+                                    M4.75 15.75V4.25H14.4074L13.9517 4.73826L15.0483 5.76174L15.25 5.54562V15.75H4.75ZM3.25 
+                                16.5V4.25H0V2.75H3.25V0.5H4.75V2.75H16H16.75V3.5V15.75H20V17.25H16.75V19.5H15.25V17.25H4H3.25V16.5ZM17.8483 2.76174L18.5483 
+                                2.01174L17.4517 0.988261L16.7517 1.73826L17.8483 2.76174ZM12.2483 8.76174L13.6483 7.26174L12.5517 6.23826L11.1517 7.73826L12.2483 
+                                8.76174ZM9.44829 11.7617L10.8483 10.2617L9.75171 9.23826L8.35171 10.7383L9.44829 11.7617ZM6.64829 14.7617L8.04829 13.2617L6.95171 
+                                12.2383L5.55171 13.7383L6.64829 14.7617Z
+                                </Path.Data>
+                            </Path>
+                        </Button.Content>
+                    </Button>
+                </StackPanel>
+            </Border>
+          
+        </Grid>
+     
+    </Grid>
+</UserControl>

+ 241 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml.cs

@@ -0,0 +1,241 @@
+using ComPDFKitViewer.PdfViewer;
+using ComPDFKitViewer;
+using System;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media.Imaging;
+using ComPDFKit.PDFPage;
+using System.Windows.Controls.Primitives;
+using Microsoft.Win32;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+
+namespace Compdfkit_Tools.Edit
+{
+    public partial class PDFImageEditControl : UserControl
+    {
+        public CPDFViewer PDFView { get; private set; }
+        public PDFEditEvent EditEvent { get; set; }
+
+        public PDFImageEditControl()
+        {
+            InitializeComponent();
+            Loaded += PDFImageEditControl_Loaded;
+            Unloaded += PDFImageEditControl_Unloaded;
+        }
+
+        private void PDFImageEditControl_Unloaded(object sender, RoutedEventArgs e)
+        {
+            RotateUI.RotationChanged -= RotateUI_RotationChanged;
+            FlipUI.FlipChanged -= FlipUI_FlipChanged;
+        }
+
+        public void InitWithPDFViewer(CPDFViewer newPDFView)
+        {
+            PDFView = newPDFView;
+        }
+
+        public void SetPDFImageEditData(PDFEditEvent newEvent)
+        {
+            EditEvent = null;
+            if (newEvent != null && newEvent.EditType == CPDFEditType.EditImage)
+            {
+                SetImageTransparency(newEvent.Transparency);
+            }
+            EditEvent = newEvent;
+            SetImageThumb();
+        }
+
+        private void PDFImageEditControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            RotateUI.RotationChanged += RotateUI_RotationChanged;
+            FlipUI.FlipChanged += FlipUI_FlipChanged;
+        }
+
+        private void FlipUI_FlipChanged(object sender, bool e)
+        {
+            if (EditEvent != null)
+            {
+                if(e)
+                {
+                    EditEvent.VerticalMirror = true;
+                }
+                else
+                {
+                    EditEvent.HorizontalMirror = true;
+                }
+              
+                EditEvent.UpdatePDFEditByEventArgs();
+                SetImageThumb();
+            }
+        }
+
+        private void RotateUI_RotationChanged(object sender, double e)
+        {
+            if (EditEvent != null)
+            {
+                EditEvent.Rotate = (int)e;
+                EditEvent.UpdatePDFEditByEventArgs();
+                SetImageThumb();
+            }
+        }
+
+        private void Slider_DragStarted(object sender, DragStartedEventArgs e)
+        {
+            Slider slider = sender as Slider;
+            if (slider != null)
+            {
+                slider.Tag = "false";
+            }
+        }
+
+        private void SliderOpacity_DragCompleted(object sender, DragCompletedEventArgs e)
+        {
+            Slider slider = sender as Slider;
+            if (slider != null)
+            {
+                slider.Tag = "true";
+            }
+            if (EditEvent != null)
+            {
+                EditEvent.Transparency = (int)(ImasgeOpacitySlider.Value * 255);
+                EditEvent.UpdatePDFEditByEventArgs();
+                SetImageThumb();
+            }
+        }
+
+        private void SliderOpacity_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+        {
+            Slider slider = sender as Slider;
+            if(OpacityTextBox != null)
+            {
+                OpacityTextBox.Text = string.Format("{0}%", (int)(ImasgeOpacitySlider.Value * 100));
+            }
+          
+            if (slider != null && slider.Tag != null && slider.Tag.ToString() == "false")
+            {
+                return;
+            }
+
+            if (EditEvent != null)
+            {
+                EditEvent.Transparency = (int)(ImasgeOpacitySlider.Value * 255);
+                EditEvent.UpdatePDFEditByEventArgs();
+                SetImageThumb();
+            }
+        }
+
+        private void ImageReplaceBtn_Click(object sender, RoutedEventArgs e)
+        {
+            if (EditEvent != null)
+            {
+                OpenFileDialog openFileDialog = new OpenFileDialog();
+                openFileDialog.Filter = "Image Files(*.jpg;*.jpeg;*.png;*.bmp)|*.jpg;*.jpeg;*.png;*.bmp;";
+                if (openFileDialog.ShowDialog() == true)
+                {
+                    EditEvent.ReplaceImagePath = openFileDialog.FileName;
+                    EditEvent.UpdatePDFEditByEventArgs();
+                    EditEvent = null;
+                }
+            }
+        }
+
+        private void ImageExportBtn_Click(object sender, RoutedEventArgs e)
+        {
+            if (PDFView != null)
+            {
+                Dictionary<int, List<Bitmap>> imageDict = PDFView.GetSelectedImages();
+                if (imageDict != null && imageDict.Count > 0)
+                {
+                    System.Windows.Forms.FolderBrowserDialog folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
+                    if (folderBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                    {
+                        string choosePath = folderBrowser.SelectedPath;
+                        string openPath = choosePath;
+                        try
+                        {
+                            foreach (int pageIndex in imageDict.Keys)
+                            {
+                                List<Bitmap> imageList = imageDict[pageIndex];
+                                foreach (Bitmap image in imageList)
+                                {
+                                    string savePath = System.IO.Path.Combine(choosePath, Guid.NewGuid() + ".jpg");
+                                    image.Save(savePath, System.Drawing.Imaging.ImageFormat.Jpeg);
+                                    openPath = savePath;
+                                }
+                            }
+                            Process.Start("explorer", "/select,\"" + openPath + "\"");
+                        }
+                        catch (Exception ex)
+                        {
+
+                        }
+                    }
+                }
+            }
+        }
+
+        private void ImageClipBtn_Click(object sender, RoutedEventArgs e)
+        {
+            if (EditEvent != null)
+            {
+                EditEvent.ClipImage = true;
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void OpacityComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            ComboBoxItem selectItem = OpacityComboBox.SelectedItem as ComboBoxItem;
+            if (selectItem != null && selectItem.Content != null)
+            {
+                if (double.TryParse(selectItem.Content.ToString().TrimEnd('%'), out double newOpacity))
+                {
+                    OpacityTextBox.Text = selectItem.Content.ToString();
+                    ImasgeOpacitySlider.Value = newOpacity / 100.0;
+                }
+            }
+        }
+
+        public void SetImageThumb()
+        {
+            if (PDFView != null && EditEvent!=null)
+            {
+                try
+                {
+                    Dictionary<int, List<Bitmap>> imageDict = PDFView.GetSelectedImages();
+                    foreach (int pageIndex in imageDict.Keys)
+                    {
+                        List<Bitmap> imageList = imageDict[pageIndex];
+                        if (imageList.Count > 0)
+                        {
+                            Bitmap bitmapImage = imageList[0];
+                            MemoryStream memoryStream = new MemoryStream();
+
+                            bitmapImage.Save(memoryStream, bitmapImage.RawFormat);
+                            BitmapImage imageShow = new BitmapImage();
+                            imageShow.BeginInit();
+                            imageShow.StreamSource = memoryStream;
+                            imageShow.EndInit();
+                            ImageThumbUI.Source = imageShow;
+                            break;
+                        }
+                    }
+
+                }
+                catch (Exception ex)
+                {
+
+                }
+            }
+        }
+
+        public void SetImageTransparency(double transparency)
+        {
+            ImasgeOpacitySlider.Value = transparency / 255D;
+            OpacityTextBox.Text = string.Format("{0}%", (int)(Math.Ceiling(ImasgeOpacitySlider.Value * 100)));
+        }
+    }
+}

+ 42 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageUI/CPDFImageFlipUI.xaml

@@ -0,0 +1,42 @@
+<UserControl x:Class="Compdfkit_Tools.Edit.CPDFImageFlipUI"
+             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="150" d:DesignWidth="300">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    
+    <StackPanel Name="ImageFlipUI">
+        <Grid>
+            <TextBlock VerticalAlignment="Center"  Margin="0,10,10,0" FontSize="14" Foreground="#43474D">Flip</TextBlock>
+        </Grid>
+
+        <StackPanel Margin="0,14,0,0" Orientation="Horizontal">
+            <Button Padding="0,5,0,5" Width="50" BorderThickness="1" Click="FlipHorizontal_Click" Style="{StaticResource LightButtonStyle}" Background="White" BorderBrush="#1A000000">
+                <Button.Content>
+                    <Path Fill="#43474D">
+                        <Path.Data>
+                            M7.52941 13.5H0L7.52941 0.5V13.5ZM9.47059 12.5H14.2652L9.47059 4.2218V12.5ZM16 13.5H14.8444H9.47059H8.47059V12.5V2.49524V0.5L9.47059 2.22656L15.4208 12.5L16 13.5Z
+                        </Path.Data>
+                    </Path>
+                </Button.Content>
+            </Button>
+            <Button  Padding="0,5,0,5" Width="50" BorderThickness="1" Click="FlipVertical_Click" Style="{StaticResource LightButtonStyle}" Background="White" BorderBrush="#1A000000">
+                <Path Fill="#43474D">
+                    <Path.Data>
+                        M15.5 7.5H13.1353H1.5H0.5V6.5V1.60353V0.5L1.5 0.966667L13.3571 6.5L15.5 7.5ZM10.9924 6.5H1.5V2.0702L10.9924 6.5ZM15.5 8.5H0.5V15.5L15.5 8.5Z
+                    </Path.Data>
+                </Path>
+            </Button>
+        </StackPanel>
+    </StackPanel>
+    
+</UserControl>

+ 37 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageUI/CPDFImageFlipUI.xaml.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Compdfkit_Tools.Edit
+{
+    public partial class CPDFImageFlipUI : UserControl
+    {
+        public event EventHandler<bool> FlipChanged;
+        public CPDFImageFlipUI()
+        {
+            InitializeComponent();
+        }
+
+        public Orientation Orientation
+        {
+            get
+            {
+                return ImageFlipUI.Orientation;
+            }
+            set
+            {
+                ImageFlipUI.Orientation = value;
+            }
+        }
+
+        private void FlipVertical_Click(object sender, RoutedEventArgs e)
+        {
+            FlipChanged?.Invoke(this, true);
+        }
+
+        private void FlipHorizontal_Click(object sender, RoutedEventArgs e)
+        {
+            FlipChanged?.Invoke(this, false);
+        }
+    }
+}

+ 55 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageUI/CPDFImageRotateUI.xaml

@@ -0,0 +1,55 @@
+<UserControl x:Class="Compdfkit_Tools.Edit.CPDFImageRotateUI"
+             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="150" d:DesignWidth="300">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    
+    <StackPanel Name="ImageRotateUI">
+        <Grid>
+            <TextBlock VerticalAlignment="Center"  Margin="0,10,10,0" FontSize="14" Foreground="#43474D">Rotate</TextBlock>
+        </Grid>
+
+        <Grid Margin="0,14,0,0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Button Style="{StaticResource LightButtonStyle}" Background="White" BorderBrush="#1A000000" Margin="0,0,10,0" Padding="0,5,0,5" BorderThickness="1" Click="RotateLeftBtn_Click">
+                <StackPanel Orientation="Horizontal">
+                    <Path Fill="#43474D">
+                        <Path.Data>
+                            M6.14645 2.2678L5.79289 2.62136L6.14645 2.97491L8.26777 5.09623L8.97487 4.38912L7.63584 3.05009L7.94232 3.07352C10.8082 3.5253 13 6.00716 
+                            13 9.00002C13 12.3137 10.3137 15 7 15C3.68629 15 1 12.3137 1 9.00002C1 7.015 1.96344 5.25508 3.45037 4.16211L2.85811 3.35637C1.12586 
+                            4.62966 0 6.6834 0 9.00002C0 12.866 3.13401 16 7 16C10.866 16 14 12.866 14 9.00002C14 5.49979 11.4314 2.6004 8.0763 2.08232C7.97978 
+                            2.06742 7.88263 2.05449 7.78489 2.04358L8.97487 0.853591L8.26777 0.146484L6.14645 2.2678Z
+                        </Path.Data>
+                    </Path>
+                    <TextBlock FontSize="14" Foreground="#43474D" Margin="8,0,0,0">Left</TextBlock>
+                </StackPanel>
+            </Button>
+            <Button Style="{StaticResource LightButtonStyle}" Background="White" BorderBrush="#1A000000" Grid.Column="1" Margin="10,0,0,0" Padding="0,5,0,5" BorderThickness="1" Click="RotateRightBtn_Click">
+                <StackPanel Orientation="Horizontal">
+                    <Path Fill="#43474D">
+                        <Path.Data>
+                            M8.35355 2.2678L8.70711 2.62136L8.35355 2.97491L6.23223 5.09623L5.52513 4.38912L6.86416 3.05009L6.55768 3.07352C3.69176 3.5253 1.5 6.00716 1.5 
+                            9.00002C1.5 12.3137 4.18629 15 7.5 15C10.8137 15 13.5 12.3137 13.5 9.00002C13.5 7.015 12.5366 5.25508 11.0496 4.16211L11.6419 3.35637C13.3741 
+                            4.62966 14.5 6.6834 14.5 9.00002C14.5 12.866 11.366 16 7.5 16C3.63401 16 0.5 12.866 0.5 9.00002C0.5 5.49979 3.06855 2.6004 6.4237 2.08232C6.52022 
+                            2.06742 6.61737 2.05449 6.71511 2.04358L5.52513 0.853591L6.23223 0.146484L8.35355 2.2678Z
+                        </Path.Data>
+                    </Path>
+                    <TextBlock FontSize="14" Foreground="#43474D" Margin="8,0,0,0">Right</TextBlock>
+                </StackPanel>
+            </Button>
+        </Grid>
+    </StackPanel>
+</UserControl>

+ 37 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFImageEdit/PDFImageUI/CPDFImageRotateUI.xaml.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Compdfkit_Tools.Edit
+{
+    public partial class CPDFImageRotateUI : UserControl
+    {
+        public event EventHandler<double> RotationChanged;
+        public CPDFImageRotateUI()
+        {
+            InitializeComponent();
+        }
+
+        public Orientation Orientation
+        {
+            get
+            {
+                return ImageRotateUI.Orientation;
+            }
+            set
+            {
+                ImageRotateUI.Orientation = value;
+            }
+        }
+
+        private void RotateLeftBtn_Click(object sender, RoutedEventArgs e)
+        {
+            RotationChanged?.Invoke(this, -90);
+        }
+
+        private void RotateRightBtn_Click(object sender, RoutedEventArgs e)
+        {
+            RotationChanged?.Invoke(this, 90);
+        }
+    }
+}

+ 94 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditControl/PDFTextEditControl.xaml

@@ -0,0 +1,94 @@
+<UserControl x:Class="Compdfkit_Tools.Edit.PDFTextEditControl"
+             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"
+             xmlns:common="clr-namespace:Compdfkit_Tools.Common"
+             mc:Ignorable="d" 
+             d:DesignHeight="800" d:DesignWidth="292" Width="260" Padding="16,0,16,0"  Background="#FAFCFF">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Asset/Styles/SliderStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition Height="auto"></RowDefinition>
+        </Grid.RowDefinitions>
+        
+        <Border Height="36" Background="White">
+            <TextBlock FontSize="14" FontWeight="Bold" HorizontalAlignment="Center" LineHeight="17" VerticalAlignment="Center">Text Properties</TextBlock>
+        </Border>
+
+        <Grid Grid.Row="1">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+            </Grid.RowDefinitions>
+
+            <TextBlock Margin="0,20,0,0" Foreground="#0E1114" FontSize="14">Font Color:</TextBlock>
+
+            <common:ColorPickerControl x:Name="FontColorUI" Grid.Row="1" Margin="0,20,0,0" TransparentBtnProperty="Collapsed"></common:ColorPickerControl>
+
+            <Grid Grid.Row="2" Margin="0,20,0,0" Visibility="Visible">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="*"></ColumnDefinition>
+                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="auto"></RowDefinition>
+                    <RowDefinition Height="auto"></RowDefinition>
+                </Grid.RowDefinitions>
+
+                <TextBlock FontSize="14" Foreground="#43474D">Opacity:</TextBlock>
+
+                <Slider Style="{StaticResource SliderStyle}" Grid.Row="1" Width="148" Height="28"
+                    Name="FontOpacitySlider" 
+                    Value="14"  
+                    IsSelectionRangeEnabled="True" 
+                    IsMoveToPointEnabled="True" 
+                    Margin="2,20,2,0"  
+                    Maximum="1" 
+                    Minimum="0" 
+                    TickFrequency="0.01"
+                    IsSnapToTickEnabled="True" 
+                    Thumb.DragCompleted="SliderOpacity_DragCompleted"
+                    Thumb.DragStarted="Slider_DragStarted"
+                    ValueChanged="SliderOpacity_ValueChanged"
+                    Tag="true"
+                    />
+
+                <Grid Grid.Row="1" Grid.Column="1" Margin="0,10,0,0">
+                    <ComboBox Name="OpacityComboBox" VerticalContentAlignment="Center" Width="72" Height="28" Foreground="#43474D" FontSize="14"
+                              SelectionChanged="OpacityComboBox_SelectionChanged" BorderBrush="#1E000000">
+                        <ComboBoxItem>25%</ComboBoxItem>
+                        <ComboBoxItem>50%</ComboBoxItem>
+                        <ComboBoxItem>75%</ComboBoxItem>
+                        <ComboBoxItem>100%</ComboBoxItem>
+                    </ComboBox>
+                    <TextBox Name="OpacityTextBox" IsHitTestVisible="False" Width="72" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
+                             IsReadOnly="True" Background="White" Padding="0,0,15,0" FontSize="14">100%</TextBox>
+                    <Path Fill="#43474D" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" IsHitTestVisible="False">
+                        <Path.Data>
+                            M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
+                        </Path.Data>
+                    </Path>
+                </Grid>
+            </Grid>
+
+            <local:CPDFTextStyleUI x:Name="TextStyleUI" Grid.Row="3" FontSize="16" Margin="0,20,0,0"></local:CPDFTextStyleUI>
+
+            <local:CPDFTextAlignUI x:Name="TextAlignUI" Grid.Row="4" FontSize="16" Margin="0,20,0,0" Width="150" HorizontalAlignment="Left"></local:CPDFTextAlignUI>
+            
+        </Grid>
+
+    </Grid>
+</UserControl>

+ 202 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditControl/PDFTextEditControl.xaml.cs

@@ -0,0 +1,202 @@
+using ComPDFKit.PDFPage;
+using ComPDFKit.PDFPage.Edit;
+using ComPDFKitViewer;
+using ComPDFKitViewer.PdfViewer;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Media;
+
+namespace Compdfkit_Tools.Edit
+{
+    public partial class PDFTextEditControl : UserControl
+    {
+        public CPDFViewer PDFView { get;private set; }
+        public PDFEditEvent EditEvent { get; set; }
+        public PDFTextEditControl()
+        {
+            InitializeComponent();
+            Loaded += PDFTextEditControl_Loaded;
+        }
+
+        public void InitWithPDFViewer(CPDFViewer newPDFView)
+        {
+            PDFView = newPDFView;
+        }
+
+        public void SetPDFTextEditData(PDFEditEvent newEvent)
+        {
+            EditEvent = null;
+            if (newEvent!=null && newEvent.EditType==CPDFEditType.EditText)
+            {
+                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.SetFontSize(newEvent.FontSize);
+                OpacityTextBox.Text = string.Format("{0}%", (int)(Math.Ceiling(newEvent.Transparency * 100/255D)));
+                TextAlignUI.SetFontAlign(newEvent.TextAlign);
+                FontColorUI.SetCheckedForColor(newEvent.FontColor);
+            }
+            EditEvent = newEvent;
+        }
+
+        private void Slider_DragCompleted(object sender, DragCompletedEventArgs e)
+        {
+            Slider slider = sender as Slider;
+            if (slider != null)
+            {
+                slider.Tag = "true";
+            }
+            if (EditEvent != null)
+            {
+                EditEvent.FontSize = slider.Value;
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void SliderOpacity_DragCompleted(object sender, DragCompletedEventArgs e)
+        {
+            Slider slider = sender as Slider;
+            if (slider != null)
+            {
+                slider.Tag = "true";
+            }
+            if (EditEvent != null)
+            {
+                EditEvent.Transparency = (int)(FontOpacitySlider.Value * 255);
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void SliderOpacity_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+        {
+            Slider slider = sender as Slider;
+            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;
+            }
+
+            if (EditEvent != null)
+            {
+                EditEvent.Transparency = (int)(FontOpacitySlider.Value * 255);
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void Slider_DragStarted(object sender, DragStartedEventArgs e)
+        {
+            Slider slider = sender as Slider;
+            if (slider != null)
+            {
+                slider.Tag = "false";
+            }
+        }
+
+        private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+        {
+            Slider slider = sender as Slider;
+            if (slider != null && slider.Tag != null && slider.Tag.ToString() == "false")
+            {
+                return;
+            }
+
+            if (EditEvent != null)
+            {
+                EditEvent.FontSize = slider.Value;
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void PDFTextEditControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            TextStyleUI.TextFontChanged += TextStyleUI_TextFontChanged;
+            TextStyleUI.TextBoldChanged += TextStyleUI_TextBoldChanged;
+            TextStyleUI.TextItalicChanged += TextStyleUI_TextItalicChanged;
+            TextStyleUI.TextSizeChanged += TextStyleUI_TextSizeChanged;
+            TextAlignUI.TextAlignChanged += TextAlignUI_TextAlignChanged;
+            FontColorUI.ColorChanged += FontColorUI_ColorChanged;
+        }
+
+        private void TextStyleUI_TextSizeChanged(object sender, double e)
+        {
+            if (EditEvent != null)
+            {
+                EditEvent.FontSize = e;
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void FontColorUI_ColorChanged(object sender, EventArgs e)
+        {
+            if (EditEvent != null)
+            {
+                SolidColorBrush newBrush = FontColorUI.Brush as SolidColorBrush;
+                if (newBrush != null)
+                {
+                    EditEvent.FontColor = newBrush.Color;
+                    EditEvent.UpdatePDFEditByEventArgs();
+                }
+            }
+        }
+
+        private void TextAlignUI_TextAlignChanged(object sender,TextAlignType e)
+        {
+            if (EditEvent != null)
+            {
+                EditEvent.TextAlign = e;
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void TextStyleUI_TextItalicChanged(object sender, bool e)
+        {
+            if(EditEvent!=null)
+            {
+                EditEvent.IsItalic = e;
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void TextStyleUI_TextBoldChanged(object sender, bool e)
+        {
+            if (EditEvent != null)
+            {
+                EditEvent.IsBold = e;
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void TextStyleUI_TextFontChanged(object sender, string e)
+        {
+            if (EditEvent != null)
+            {
+                EditEvent.FontName = e;
+                EditEvent.UpdatePDFEditByEventArgs();
+            }
+        }
+
+        private void OpacityComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            ComboBoxItem selectItem = OpacityComboBox.SelectedItem as ComboBoxItem;
+            if (selectItem != null && selectItem.Content != null)
+            {
+                if (double.TryParse(selectItem.Content.ToString().TrimEnd('%'), out double newOpacity))
+                {
+                    OpacityTextBox.Text = selectItem.Content.ToString();
+                    FontOpacitySlider.Value = newOpacity/100.0;
+                }
+            }
+        }
+    }
+}

+ 60 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextAlignUI.xaml

@@ -0,0 +1,60 @@
+<UserControl x:Class="Compdfkit_Tools.Edit.CPDFTextAlignUI"
+             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="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Asset/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Border  BorderBrush="#E2E3E6" BorderThickness="1">
+
+        <StackPanel Name="AlignPanel" Orientation="Horizontal">
+            <ToggleButton Name="AlignLeftBtn" Width="50" Height="30" BorderThickness="0" Tag="AlignLeft" Style="{StaticResource ToggleButtonStyle}" Click="TextAlignBtn_Click"
+                          Background="White">
+                <ToggleButton.Content>
+                    <Path Name="AlignLeftPath" Fill="Black">
+                        <Path.Data>
+                            M13 4V3H0V4H13ZM16 8V7H0V8H16ZM10 11V12H0V11H10Z
+                        </Path.Data>
+                    </Path>
+                </ToggleButton.Content>
+            </ToggleButton>
+
+            <Line X1="0" Y1="8" X2="0" Y2="22" Stroke="#E2E3E6" StrokeThickness="1"></Line>
+
+            <ToggleButton Name="AlignCenterBtn" Width="50" Height="30" BorderThickness="0" Tag="AlignCenter" Style="{StaticResource ToggleButtonStyle}" Click="TextAlignBtn_Click"
+                          Background="White">
+                <ToggleButton.Content>
+                    <Path Name="AlignCenterPath" Fill="Black">
+                        <Path.Data>
+                            M16.6665 4V3H0.666504V4H16.6665ZM16.6665 12V11H0.666504V12H16.6665ZM13.6665 7V8H3.6665V7H13.6665Z
+                        </Path.Data>
+                    </Path>
+                </ToggleButton.Content>
+            </ToggleButton>
+            
+            <Line X1="0" Y1="8" X2="0" Y2="22" Stroke="#E2E3E6" StrokeThickness="1"></Line>
+            
+            <ToggleButton Name="AlignRightBtn" Width="50" Height="30" BorderThickness="0" Tag="AlignRight" Style="{StaticResource ToggleButtonStyle}" Click="TextAlignBtn_Click"
+                          Background="White">
+                <ToggleButton.Content>
+                    <Path Name="AlignRightPath" Fill="Black">
+                        <Path.Data>
+                            M16.3335 4V3H3.33429V4H16.3335ZM16.3335 8V7H0.334473V8H16.3335ZM16.3335 11V12H6.33411V11H16.3335Z
+                        </Path.Data>
+                    </Path>
+                </ToggleButton.Content>
+            </ToggleButton>
+            
+        </StackPanel>
+        
+    </Border>
+</UserControl>

+ 86 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextAlignUI.xaml.cs

@@ -0,0 +1,86 @@
+using ComPDFKit.PDFPage.Edit;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Media;
+
+namespace Compdfkit_Tools.Edit
+{
+    public partial class CPDFTextAlignUI : UserControl
+    {
+        public event EventHandler<TextAlignType> TextAlignChanged;
+        public CPDFTextAlignUI()
+        {
+            InitializeComponent();
+        }
+
+        public TextAlignType Alignment { get;private set; }
+
+        public void SetFontAlign(TextAlignType newAlign)
+        {
+            ClearAlign();
+            Alignment = newAlign;
+            switch (newAlign)
+            {
+                case TextAlignType.AlignLeft:
+                    AlignLeftBtn.IsChecked = true;
+                    AlignLeftPath.Fill = Brushes.Blue;
+                    break;
+                case TextAlignType.AlignMiddle:
+                    AlignCenterBtn.IsChecked = true; 
+                    AlignCenterPath.Fill = Brushes.Blue;
+                    break;
+                case TextAlignType.AlignRight:
+                    AlignRightBtn.IsChecked = true;
+                    AlignRightPath.Fill = Brushes.Blue;
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        public void ClearAlign()
+        {
+            Alignment = TextAlignType.AlignNone;
+            AlignLeftPath.Fill = Brushes.Gray;
+            AlignCenterPath.Fill= Brushes.Gray;
+            AlignRightPath.Fill= Brushes.Gray;
+            AlignLeftBtn.IsChecked = false;
+            AlignCenterBtn.IsChecked = false;
+            AlignRightBtn.IsChecked= false; 
+        }
+
+        private void TextAlignBtn_Click(object sender, RoutedEventArgs e)
+        {
+            ClearAlign();
+            ToggleButton clickBtn = sender as ToggleButton;
+            if (clickBtn != null && clickBtn.Tag!=null)
+            {
+                clickBtn.IsChecked = true;
+                TextAlignType newAlign = Alignment;
+
+                switch(clickBtn.Tag.ToString())
+                {
+                    case "AlignLeft":
+                        newAlign = TextAlignType.AlignLeft;
+                        break;
+                    case "AlignCenter":
+                        newAlign = TextAlignType.AlignMiddle;
+                        break;
+                    case "AlignRight":
+                        newAlign= TextAlignType.AlignRight;
+                        break;
+                    default:
+                        break;
+                }
+
+                if(newAlign!=Alignment)
+                {
+                    SetFontAlign(newAlign);
+                    TextAlignChanged?.Invoke(this, newAlign);
+                }
+            }
+        }
+    }
+}

+ 79 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextStyleUI.xaml

@@ -0,0 +1,79 @@
+<UserControl x:Class="Compdfkit_Tools.Edit.CPDFTextStyleUI"
+             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="260">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="auto"></RowDefinition>
+            <RowDefinition Height="*"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Border>
+            <TextBlock VerticalAlignment="Center" Margin="0,10,10,0" FontSize="14" Foreground="#43474D">Font Style:</TextBlock>
+        </Border>
+      
+        <Grid Grid.Row="1" Margin="0,10,0,0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+            </Grid.RowDefinitions>
+
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            
+            <ComboBox Grid.ColumnSpan="2" Name="FontNameComboBox" Width="228" Height="28" FontSize="14" SelectionChanged="FontNameComboBox_SelectionChanged" BorderThickness="1"
+                      VerticalContentAlignment="Center" Foreground="#43474D" Style="{StaticResource ComboBoxStyle1}" >
+            </ComboBox>
+
+            <ComboBox Name="FontStyleBox" Width="148" Height="28" Grid.Row="1" Margin="0,8,0,0" BorderThickness="1" Foreground="#43474D" FontSize="14" 
+                       SelectionChanged="FontStyleBox_SelectionChanged" Style="{StaticResource ComboBoxStyle1}" >
+                <ComboBoxItem IsSelected="True">Regular</ComboBoxItem>
+                <ComboBoxItem>Bold</ComboBoxItem>
+                <ComboBoxItem>Italic</ComboBoxItem>
+                <ComboBoxItem>Bold Italic</ComboBoxItem>
+            </ComboBox>
+
+            <Grid Grid.Row="1" Grid.Column="1" Margin="8,8,0,0">
+                <ComboBox Name="FontSizeComboBox" Width="72" Height="28" BorderThickness="1" MaxDropDownHeight="200" Foreground="#43474D" FontSize="14"
+                          SelectionChanged="FontSizeComboBox_SelectionChanged" Style="{StaticResource ComboBoxStyle1}" >
+                    <ComboBoxItem>6</ComboBoxItem>
+                    <ComboBoxItem>8</ComboBoxItem>
+                    <ComboBoxItem>9</ComboBoxItem>
+                    <ComboBoxItem>10</ComboBoxItem>
+                    <ComboBoxItem>12</ComboBoxItem>
+                    <ComboBoxItem>14</ComboBoxItem>
+                    <ComboBoxItem>18</ComboBoxItem>
+                    <ComboBoxItem>20</ComboBoxItem>
+                    <ComboBoxItem>22</ComboBoxItem>
+                    <ComboBoxItem>24</ComboBoxItem>
+                    <ComboBoxItem>26</ComboBoxItem>
+                    <ComboBoxItem>28</ComboBoxItem>
+                    <ComboBoxItem>32</ComboBoxItem>
+                    <ComboBoxItem>36</ComboBoxItem>
+                    <ComboBoxItem>48</ComboBoxItem>
+                    <ComboBoxItem>72</ComboBoxItem>
+                </ComboBox>
+                <TextBox Name="FontSizeTextBox" IsHitTestVisible="False" Width="72" Height="28" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" BorderThickness="1"
+                             IsReadOnly="True"  Padding="0,0,15,0" FontSize="14"></TextBox>
+                <Path Fill="#43474D" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" IsHitTestVisible="False">
+                    <Path.Data>
+                        M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
+                    </Path.Data>
+                </Path>
+            </Grid>
+
+        </Grid>
+    </Grid>
+</UserControl>

+ 159 - 0
Demo/Examples/Compdfkit_Tools/PDFView/Edit/PDFTextEdit/PDFTextEditUI/CPDFTextStyleUI.xaml.cs

@@ -0,0 +1,159 @@
+using System;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Compdfkit_Tools.Edit
+{
+    public partial class CPDFTextStyleUI : UserControl
+    {
+        public event EventHandler<string> TextFontChanged;
+        public event EventHandler<bool> TextBoldChanged;
+        public event EventHandler<bool> TextItalicChanged;
+        public event EventHandler<double> TextSizeChanged;
+        public CPDFTextStyleUI()
+        {
+            InitializeComponent();
+        }
+
+        public void SetFontNames(List<string> fontNames)
+        {
+            FontNameComboBox.ItemsSource = null;
+            if (fontNames != null && fontNames.Count > 0)
+            {
+                List<ComboBoxItem> fontNameList = new List<ComboBoxItem>();
+                foreach (string fontName in fontNames)
+                {
+                    fontNameList.Add(new ComboBoxItem()
+                    {
+                        Content = fontName,
+                        VerticalContentAlignment=VerticalAlignment.Center,
+                        HorizontalContentAlignment=HorizontalAlignment.Left
+                    });
+                }
+                FontNameComboBox.ItemsSource = fontNameList;
+            }
+        }
+
+        public void SelectFontName(string fontName)
+        {
+            if(string.IsNullOrEmpty(fontName))
+            {
+                return;
+            }
+
+            List<ComboBoxItem> fontNameList = FontNameComboBox.ItemsSource as List<ComboBoxItem>;
+            if (fontNameList != null && fontNameList.Count>0)
+            {
+                int selectIndex = -1;
+                for(int i=0;i<fontNameList.Count; i++)
+                {
+                    ComboBoxItem checkItem= fontNameList[i];
+                    if(checkItem.Content!=null && checkItem.Content.ToString().ToLower()==fontName.ToLower() )
+                    {
+                        selectIndex=i; 
+                        break;
+                    }
+                }
+
+                FontNameComboBox.SelectedIndex = selectIndex;
+            }
+        }
+
+        public void SetFontStyle(bool isBold,bool isItalic)
+        {
+            if (isBold == false && isItalic == false)
+            {
+                FontStyleBox.SelectedIndex = 0;
+                return;
+            }
+
+            if (isBold && isItalic == false)
+            {
+                FontStyleBox.SelectedIndex = 1;
+                return;
+            }
+
+            if (isBold == false && isItalic)
+            {
+                FontStyleBox.SelectedIndex = 0;
+                return;
+            }
+
+            if (isBold  && isItalic )
+            {
+                FontStyleBox.SelectedIndex = 3;
+             
+            }
+        }
+
+        public void SetFontSize(double newFontSize)
+        {
+            if (FontSizeTextBox != null)
+            {
+                if (newFontSize - (int)(newFontSize) > 0)
+                {
+                    FontSizeTextBox.Text = ((int)newFontSize).ToString();
+                }
+                else
+                {
+                    FontSizeTextBox.Text = ((int)(newFontSize)).ToString();
+                }
+            }
+        }
+
+        private void FontNameComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if(FontNameComboBox.SelectedIndex==-1)
+            {
+                TextFontChanged?.Invoke(this,string.Empty);
+                return;
+            }
+
+            ComboBoxItem selectItem= FontNameComboBox.SelectedItem as ComboBoxItem;
+            if(selectItem != null && selectItem.Content != null)
+            {
+                TextFontChanged?.Invoke(this, selectItem.Content.ToString());
+            }
+        }
+
+        private void FontStyleBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            int selectIndex = Math.Max(0, FontStyleBox.SelectedIndex);
+            switch(selectIndex)
+            {
+                case 0:
+                    TextBoldChanged?.Invoke(this,false);
+                    TextItalicChanged?.Invoke(this, false);
+                    break;
+                case 1:
+                    TextBoldChanged?.Invoke(this, true);
+                    TextItalicChanged?.Invoke(this, false);
+                    break;
+                case 2:
+                    TextBoldChanged?.Invoke(this, false);
+                    TextItalicChanged?.Invoke(this, true);
+                    break;
+                case 3:
+                    TextBoldChanged?.Invoke(this, true);
+                    TextItalicChanged?.Invoke(this, true);
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        private void FontSizeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            ComboBoxItem selectItem = FontSizeComboBox.SelectedItem as ComboBoxItem;
+            if (selectItem != null && selectItem.Content != null)
+            {
+                if (int.TryParse(selectItem.Content.ToString(), out int newFontSize))
+                {
+                    FontSizeTextBox.Text = (newFontSize).ToString();
+                    TextSizeChanged?.Invoke(this, newFontSize);
+                }
+            }
+        }
+    }
+}

+ 1 - 2
Demo/Examples/Compdfkit_Tools/PDFView/PDFInfo/CPDFCreateInfoControl.xaml

@@ -2,8 +2,7 @@
              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"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
              mc:Ignorable="d">
     <GroupBox Header="Create Information">
         <StackPanel Orientation="Vertical" Margin="19,12,0,0">

+ 6 - 10
Demo/Examples/Compdfkit_Tools/PageEdit/PDFPageEdit/CPDFPageEditControl.xaml.cs

@@ -1292,7 +1292,7 @@ namespace Compdfkit_Tools.PDFControl
                 if (sv == null) return;
 
                 if (VisualTreeHelper.GetParent(this) == null)
-                    return;
+                    return; 
 
                 var range = GetRoughViewportRange(PageEditListBox, (PageEditListBox.Items[0] as ListBoxItem).DesiredSize, new Thickness(6, 10, 6, 10));
                 for (int i = 0; i < PageEditListBox.Items.Count; ++i)
@@ -2124,12 +2124,10 @@ namespace Compdfkit_Tools.PDFControl
         }
 
         private void ShowAlertWithTimeout(AlertType alertType)
-        {
-            // Reset the status of the AlertBorder control.
+        { 
             AlertBorder.Visibility = Visibility.Visible;
             AlertBorder.Opacity = 1.0;
-
-            // Check the alert type and set the text of the AlertTextBlock control accordingly.
+             
             if (alertType == AlertType.EmptyPageAlert)
             {
                 AlertTextBlock.Text = "Please select at least one page.";
@@ -2142,13 +2140,11 @@ namespace Compdfkit_Tools.PDFControl
             {
                 AlertTextBlock.Text = "Please don't select all pages";
             }
-
-            // Animate the opacity of the AlertBorder control to 0.0 over a period of 3 seconds.
+             
             DoubleAnimation animation = new DoubleAnimation();
             animation.From = 1.0;
             animation.To = 0.0;
-            animation.Duration = TimeSpan.FromSeconds(3);
-            // Start the animation.
+            animation.Duration = TimeSpan.FromSeconds(3); 
             AlertBorder.BeginAnimation(OpacityProperty, animation);
         }
         #endregion
@@ -2161,7 +2157,7 @@ namespace Compdfkit_Tools.PDFControl
         private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
         {
             DoSelectItems();
-            ItemsInViewHitTest();//Scollchange, triggered on the first load, directly refreshes the interface and reduces the whiteboard display time
+            ItemsInViewHitTest(); 
         }
     }
 

+ 4 - 29
Demo/Examples/Compdfkit_Tools/Properties/Resources.Designer.cs

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

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

@@ -42,10 +42,10 @@
     <ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="PresentationFramework.Aero2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

+ 4 - 0
Demo/Examples/ContentEditor/MainWindow.xaml.cs

@@ -113,6 +113,10 @@ namespace ContentEditor
         #region Load document
         private void LoadDocument()
         {
+            if (pdfViewControl.PDFView.Document == null)
+            {
+                return;
+            }
             pdfViewControl.PDFView?.Load();
             PDFGrid.Child = pdfViewControl;
             pdfViewControl.PDFView.InfoChanged -= PdfViewer_InfoChanged;

+ 6 - 6
Demo/Examples/ContentEditor/Properties/AssemblyInfo.cs

@@ -7,12 +7,12 @@ using System.Windows;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("edit-ctrl-demo")]
+[assembly: AssemblyTitle("Content Editor_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
-[assembly: AssemblyProduct("edit-ctrl-demo")]
-[assembly: AssemblyCopyright("Copyright © HP Inc. 2023")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Content Editor_ComPDFKit")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
@@ -51,5 +51,5 @@ using System.Windows;
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
 //通过使用 "*",如下所示:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.9.0.0")]
+[assembly: AssemblyFileVersion("1.9.0.0")]

+ 4 - 30
Demo/Examples/ContentEditor/Properties/Resources.Designer.cs

@@ -1,24 +1,5 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
-//
-//     对此文件的更改可能导致不正确的行为,如果
-//     重新生成代码,则所做更改将丢失。
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace ContentEditor.Properties
-{
-
-
-    /// <summary>
-    ///   强类型资源类,用于查找本地化字符串等。
-    /// </summary>
-    // 此类是由 StronglyTypedResourceBuilder
-    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
-    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
-    // (以 /str 作为命令选项),或重新生成 VS 项目。
+ namespace ContentEditor.Properties
+{ 
     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@@ -32,11 +13,8 @@ namespace ContentEditor.Properties
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
         internal Resources()
         {
-        }
+        } 
 
-        /// <summary>
-        ///   返回此类使用的缓存 ResourceManager 实例。
-        /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
         internal static global::System.Resources.ResourceManager ResourceManager
         {
@@ -50,11 +28,7 @@ namespace ContentEditor.Properties
                 return resourceMan;
             }
         }
-
-        /// <summary>
-        ///   重写当前线程的 CurrentUICulture 属性,对
-        ///   使用此强类型资源类的所有资源查找执行重写。
-        /// </summary>
+         
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
         internal static global::System.Globalization.CultureInfo Culture
         {

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

@@ -40,10 +40,10 @@
     <ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="PresentationFramework.Aero2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

+ 4 - 0
Demo/Examples/DocsEditor/MainWindow.xaml.cs

@@ -82,6 +82,10 @@ namespace DocsEditor
 
         private void LoadDocument()
         {
+            if (pdfViewControl.PDFView.Document == null)
+            {
+                return;
+            }
             pdfViewControl.PDFView?.SetMouseMode(MouseModes.Viewer);
             pdfViewControl.PDFView?.Load();
             pdfViewControl.PDFView?.SetShowLink(true);

+ 6 - 6
Demo/Examples/DocsEditor/Properties/AssemblyInfo.cs

@@ -7,12 +7,12 @@ using System.Windows;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("pageedit-ctrl-demo")]
+[assembly: AssemblyTitle("Docs Editor_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
-[assembly: AssemblyProduct("pageedit-ctrl-demo")]
-[assembly: AssemblyCopyright("Copyright © HP Inc. 2023")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Docs Editor_ComPDFKit")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
@@ -51,5 +51,5 @@ using System.Windows;
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
 //通过使用 "*",如下所示:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.9.0.0")]
+[assembly: AssemblyFileVersion("1.9.0.0")]

+ 3 - 29
Demo/Examples/DocsEditor/Properties/Resources.Designer.cs

@@ -1,24 +1,5 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
-//
-//     对此文件的更改可能导致不正确的行为,如果
-//     重新生成代码,则所做更改将丢失。
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace DocsEditor.Properties
+ namespace DocsEditor.Properties
 {
-
-
-    /// <summary>
-    ///   强类型资源类,用于查找本地化字符串等。
-    /// </summary>
-    // 此类是由 StronglyTypedResourceBuilder
-    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
-    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
-    // (以 /str 作为命令选项),或重新生成 VS 项目。
     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@@ -33,10 +14,7 @@ namespace DocsEditor.Properties
         internal Resources()
         {
         }
-
-        /// <summary>
-        ///   返回此类使用的缓存 ResourceManager 实例。
-        /// </summary>
+         
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
         internal static global::System.Resources.ResourceManager ResourceManager
         {
@@ -50,11 +28,7 @@ namespace DocsEditor.Properties
                 return resourceMan;
             }
         }
-
-        /// <summary>
-        ///   重写当前线程的 CurrentUICulture 属性,对
-        ///   使用此强类型资源类的所有资源查找执行重写。
-        /// </summary>
+         
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
         internal static global::System.Globalization.CultureInfo Culture
         {

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

@@ -41,10 +41,10 @@
     <ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="PresentationFramework.Aero2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

+ 1 - 0
Demo/Examples/Forms/MainWindow.xaml.cs

@@ -785,6 +785,7 @@ namespace Forms
                 }
             }
         }
+
         private string GetTime()
         {
             DateTime dateTime = DateTime.Now;

+ 6 - 6
Demo/Examples/Forms/Properties/AssemblyInfo.cs

@@ -7,12 +7,12 @@ using System.Windows;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("form-ctrl-demo")]
+[assembly: AssemblyTitle("Forms_ComPDFKit")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
-[assembly: AssemblyProduct("form-ctrl-demo")]
-[assembly: AssemblyCopyright("Copyright © HP Inc. 2023")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Forms_ComPDFKit")]
+[assembly: AssemblyCopyright("Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
@@ -51,5 +51,5 @@ using System.Windows;
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
 //通过使用 "*",如下所示:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.9.0.0")]
+[assembly: AssemblyFileVersion("1.9.0.0")]

+ 4 - 29
Demo/Examples/Forms/Properties/Resources.Designer.cs

@@ -1,24 +1,6 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
-//
-//     对此文件的更改可能导致不正确的行为,如果
-//     重新生成代码,则所做更改将丢失。
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Forms.Properties
+ namespace Forms.Properties
 {
-
-
-    /// <summary>
-    ///   强类型资源类,用于查找本地化字符串等。
-    /// </summary>
-    // 此类是由 StronglyTypedResourceBuilder
-    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
-    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
-    // (以 /str 作为命令选项),或重新生成 VS 项目。
+     
     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@@ -33,10 +15,7 @@ namespace Forms.Properties
         internal Resources()
         {
         }
-
-        /// <summary>
-        ///   返回此类使用的缓存 ResourceManager 实例。
-        /// </summary>
+         
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
         internal static global::System.Resources.ResourceManager ResourceManager
         {
@@ -50,11 +29,7 @@ namespace Forms.Properties
                 return resourceMan;
             }
         }
-
-        /// <summary>
-        ///   重写当前线程的 CurrentUICulture 属性,对
-        ///   使用此强类型资源类的所有资源查找执行重写。
-        /// </summary>
+         
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
         internal static global::System.Globalization.CultureInfo Culture
         {

+ 61 - 1
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -159,6 +159,13 @@ namespace PDFViewer
         #endregion
 
         #region  UI 
+
+        private string GetTime()
+        {
+            DateTime dateTime = DateTime.Now;
+            return " " + dateTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
+        }
+
         /// <summary>
         /// InfoChanged
         /// When the PDF zoom ratio changes, the value of the zoom control also changes.
@@ -478,7 +485,7 @@ namespace PDFViewer
                             e.Handle = true;
                             e.PopupMenu = new ContextMenu();
 
-                            if (currentMode == "Annotations")
+                            if (currentMode == "Annotations" || currentMode == "Forms")
                             {
                                 e.PopupMenu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
                                 e.PopupMenu.Items.Add(new Separator());
@@ -586,6 +593,15 @@ namespace PDFViewer
                         }
                     }
 
+                    else if (e.CommandTarget == TargetType.WidgetView)
+                    {
+                        e.Handle = true;
+                        e.PopupMenu = new ContextMenu();
+                        e.PopupMenu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
+                        e.PopupMenu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
+                        e.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
+                    }
+
                     else if (e.CommandTarget == TargetType.ImageSelection)
                     {
                         if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.GetSelectImageCount() > 0)
@@ -884,6 +900,11 @@ namespace PDFViewer
 
         private void LoadDocument()
         {
+            if (pdfViewControl.PDFView.Document == null)
+            {
+                return;
+            }
+
             //Load the Document
             pdfViewControl.PDFView?.Load();
 
@@ -1304,8 +1325,47 @@ namespace PDFViewer
                 AnnotEditEvent editEvent = e[e.Count - 1];
                 if (editEvent.EditAction == ActionType.Add)
                 {
+                    if (pdfViewControl.PDFView.ToolManager.CurrentAnnotArgs != null)
+                    {
+                        WidgetArgs widgetArgs = pdfViewControl.PDFView.ToolManager.CurrentAnnotArgs as WidgetArgs;
+                        if (widgetArgs != null)
+                        {
+                            switch (widgetArgs.WidgeType)
+                            {
+                                case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_PUSHBUTTON:
+                                    widgetArgs.FieldName = "Button" + GetTime();
+                                    break;
+                                case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_CHECKBOX:
+                                    widgetArgs.FieldName = "Checkbox" + GetTime();
+                                    break;
+                                case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_RADIOBUTTON:
+                                    widgetArgs.FieldName = "Radio button" + GetTime();
+                                    break;
+                                case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_TEXTFIELD:
+                                    widgetArgs.FieldName = "Text" + GetTime();
+                                    break;
+                                case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_COMBOBOX:
+                                    widgetArgs.FieldName = "Combobox" + GetTime();
+                                    break;
+                                case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_LISTBOX:
+                                    widgetArgs.FieldName = "List" + GetTime();
+                                    break;
+                                case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS:
+                                    widgetArgs.FieldName = "Signature" + GetTime();
+                                    break;
+                                case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_UNKNOWN:
+                                    break;
+                                default:
+                                    break;
+                            }
+                        }
+                    }
                     pdfViewControl.PDFView.SelectAnnotation(editEvent.PageIndex, editEvent.AnnotIndex);
                 }
+                else if (editEvent.EditAction == ActionType.Del)
+                {
+                    pdfFormControl.CleanProperty();
+                }
             }
         }
 

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

@@ -41,10 +41,10 @@
     <ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="Dragablz, Version=0.0.3.223, Culture=neutral, processorArchitecture=MSIL">

+ 2 - 2
Demo/Examples/Samples/AnnotationImportExportTest/AnnotationImportExportTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/AnnotationTest/AnnotationTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/BackgroundTest/BackgroundTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/BatesTest/BatesTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 3 - 3
Demo/Examples/Samples/BookmarkTest/BookmarkTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />
@@ -61,7 +61,7 @@
     <None Include="..\..\TestFile\CommonFivePage.pdf">
       <Link>CommonFivePage.pdf</Link>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>    
+    </None>
     <None Include="..\..\TestFile\ThreeBookmark.pdf">
       <Link>ThreeBookmark.pdf</Link>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

+ 6 - 10
Demo/Examples/Samples/DocumentCompare/DocumentCompareTest.csproj

@@ -35,6 +35,12 @@
     <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" />
@@ -69,16 +75,6 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\..\compdfkit\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
-      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
-      <Name>ComPDFKit.Desk</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\..\..\compdfkit\ComPDFKit\ComPDFKitDesktop\ComPDFKit.Viewer\ComPDFKit.Viewer.csproj">
-      <Project>{18ec356d-8130-49d4-b4e6-ac290e1065b7}</Project>
-      <Name>ComPDFKit.Viewer</Name>
-    </ProjectReference>
-  </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">

+ 2 - 2
Demo/Examples/Samples/DocumentInfoTest/DocumentInfoTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/EncryptTest/EncryptTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/FlattenTest/FlattenTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/HeaderFooterTest/HeaderFooterTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/ImageExtractTest/ImageExtractTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="PresentationCore" />

+ 2 - 2
Demo/Examples/Samples/InteractiveFormsTest/InteractiveFormsTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 6 - 10
Demo/Examples/Samples/OutlineTest/OutlineTest.csproj

@@ -35,6 +35,12 @@
     <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" />
@@ -65,16 +71,6 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\..\compdfkit\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
-      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
-      <Name>ComPDFKit.Desk</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\..\..\compdfkit\ComPDFKit\ComPDFKitDesktop\ComPDFKit.Viewer\ComPDFKit.Viewer.csproj">
-      <Project>{18ec356d-8130-49d4-b4e6-ac290e1065b7}</Project>
-      <Name>ComPDFKit.Viewer</Name>
-    </ProjectReference>
-  </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">

+ 2 - 2
Demo/Examples/Samples/PDFATest/PDFATest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/PDFPageTest/PDFPageTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/PDFRedactTest/PDFRedactTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/PDFToImage/PDFToImageTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="PresentationCore" />

+ 2 - 2
Demo/Examples/Samples/TextExtractTest/TextExtractTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/TextSearchTest/TextSearchTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 2 - 2
Demo/Examples/Samples/WatermarkTest/WatermarkTest.csproj

@@ -35,10 +35,10 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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" />

+ 4 - 0
Demo/Examples/Viewer/MainWindow.xaml.cs

@@ -63,6 +63,10 @@ namespace Viewer
         #region Load Document
         private void LoadDocument()
         {
+            if (pdfViewControl.PDFView.Document == null)
+            {
+                return;
+            }
             pdfViewControl.PDFView?.SetMouseMode(MouseModes.Viewer);
             pdfViewControl.PDFView?.Load();
             pdfViewControl.PDFView?.SetShowLink(true);

+ 2 - 2
Demo/Examples/Viewer/Viewer.csproj

@@ -41,10 +41,10 @@
     <ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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.8.1.0, Culture=neutral, processorArchitecture=MSIL">
+    <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="PresentationFramework.Aero2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

BIN
Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/ComPDFKit.NetFramework.1.9.0.nupkg


BIN
Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/lib/ComPDFKit.Desk.dll


BIN
Demo/Examples/packages/ComPDFKit.NetFramework.1.9.0/lib/ComPDFKit.Viewer.dll