Browse Source

compdfkit(win) - Samples注释

liuaoran 1 year ago
parent
commit
ccb225fe4a

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

@@ -9,8 +9,7 @@ namespace Compdfkit_Tools.PDFControl
 
         public CPDFInfoControl()
         {
-            InitializeComponent();
-
+            InitializeComponent(); 
         }
 
         public void InitWithPDFViewer(CPDFViewer pdfViewer)

+ 3 - 1
Demo/Examples/PDFViewer/MainPage.xaml

@@ -75,8 +75,10 @@
         <KeyBinding Key="T" Modifiers="Control" Command="{StaticResource GoToThumbnail}"></KeyBinding>
         <KeyBinding Key="A" Modifiers="Control" Command="{StaticResource GoToAnnotationList}"></KeyBinding>
         <KeyBinding Key="F" Modifiers="Control" Command="{StaticResource GoToSearch}"></KeyBinding>
-        <KeyBinding Key="Add" Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
+        <KeyBinding Key="Add"  Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
+        <KeyBinding Key="OemPlus"  Modifiers="Control" Command="{StaticResource ScaleAdd}"></KeyBinding>
         <KeyBinding Key="Subtract" Modifiers="Control" Command="{StaticResource ScaleSubtract}"></KeyBinding>
+        <KeyBinding Key="OemMinus" Modifiers="Control" Command="{StaticResource ScaleSubtract}"></KeyBinding>
         <KeyBinding Key="D" Modifiers="Control" Command="{StaticResource DisplaySettings}"></KeyBinding>
         <KeyBinding Key="I" Modifiers="Control" Command="{StaticResource DocumentInfo}"></KeyBinding>
         <KeyBinding Key="H" Modifiers="Control+Alt" Command="{StaticResource Highlight}"></KeyBinding>

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

@@ -1897,6 +1897,7 @@ namespace PDFViewer
             {
                 FileInfoUI.Visibility = Visibility.Collapsed;
                 PopupBorder.Visibility = Visibility.Collapsed;
+                this.Focus();
             }
         }
 

+ 3 - 4
Demo/Examples/Samples/AnnotationImportExportTest/AnnotationImportExportTest.cs

@@ -62,8 +62,7 @@ namespace AnnotationImportExportTest
             Console.WriteLine("--------------------");
             
             #endregion
-
-            //---------- Finished ----------
+             
             Console.WriteLine("Done");
             Console.WriteLine("--------------------");
             Console.ReadLine();
@@ -72,8 +71,8 @@ namespace AnnotationImportExportTest
         /// <summary>
         ///  Export the annotations in the document to XFDF format.
         ///  Parameters in function "ImportAnnotationFromXFDFPath":
-        ///  1. The path to the exported XFDF file
-        ///  2. The path for storing temporary files. 
+        ///  1. path: The path to the exported XFDF file
+        ///  2. tempPath: The path for storing temporary files. 
         /// </summary>
         /// <param name="document">A document with multiple annotations</param>
         /// <returns></returns>

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

@@ -77,6 +77,10 @@ namespace AnnotationTest
             freeText.UpdateAp();
         }
 
+        /// <summary>
+        /// Create freehand annotations
+        /// </summary>
+        /// <param name="document"></param>
         static private void CreateFreehandAnnotation(CPDFDocument document)
         {
             CPDFPage page = document.PageAtIndex(0);
@@ -100,6 +104,12 @@ namespace AnnotationTest
             ink.UpdateAp();
         }
 
+        /// <summary>
+        /// Create Shape annotations
+        /// Include:
+        /// Square, Circle, Line
+        /// </summary>
+        /// <param name="document"></param>
         static private void CreateShapeAnnotation(CPDFDocument document)
         {
             CPDFPage page = document.PageAtIndex(0);
@@ -138,6 +148,10 @@ namespace AnnotationTest
             line.UpdateAp();
         }
 
+        /// <summary>
+        /// Create note annotations
+        /// </summary>
+        /// <param name="document"></param>
         static private void CreateNoteAnnotation(CPDFDocument document)
         {
             CPDFPage page = document.PageAtIndex(0);
@@ -149,6 +163,10 @@ namespace AnnotationTest
             textAnnotation.UpdateAp();
         }
 
+        /// <summary>
+        /// Create sound annotations
+        /// </summary>
+        /// <param name="document"></param>
         static private void CreateSoundAnnotation(CPDFDocument document)
         {
             CPDFPage page = document.PageAtIndex(0);
@@ -158,6 +176,10 @@ namespace AnnotationTest
             sound.UpdateAp();
         }
 
+        /// <summary>
+        /// Create Markup annotations
+        /// </summary>
+        /// <param name="document"></param>
         static private void CreateMarkupAnnotation(CPDFDocument document)
         {
             List<CRect> cRectList = new List<CRect>();
@@ -227,6 +249,10 @@ namespace AnnotationTest
 
         }
 
+        /// <summary>
+        /// Create stamp annotation
+        /// </summary>
+        /// <param name="document"></param>
         static private void CreateStampAnnotation(CPDFDocument document)
         {
             CPDFPage page = document.PageAtIndex(0);
@@ -252,6 +278,11 @@ namespace AnnotationTest
             image.UpdateAp();
         }
 
+        /// <summary>
+        /// Create annotations
+        /// </summary>
+        /// <param name="document"></param>
+        /// <returns></returns>
         static private bool CreateAnnots(CPDFDocument document)
         {
             CreateFreetextAnnotation(document);
@@ -271,6 +302,11 @@ namespace AnnotationTest
             return true;
         }
 
+        /// <summary>
+        /// Delete the first annotation
+        /// </summary>
+        /// <param name="document"></param>
+        /// <returns></returns>
         static private bool DeleteAnnotations(CPDFDocument document)
         {
             CPDFPage page = document.PageAtIndex(0);

File diff suppressed because it is too large
+ 43 - 13
Demo/Examples/Samples/BackgroundTest/BackgroundTest.cs


+ 40 - 14
Demo/Examples/Samples/BatesTest/BatesTest.cs

@@ -24,6 +24,8 @@ namespace BatesTest
 
         static void Main(string[] args)
         {
+            #region Preparation work
+
             Console.WriteLine("Running bates test sample…\r\n");
             SDKLicenseHelper.LicenseVerify();
 
@@ -34,7 +36,9 @@ namespace BatesTest
                 Directory.CreateDirectory(outputPath);
             }
 
-            #region Add bates
+            #endregion
+            
+            #region Sample 1: Add bates
             if (AddBates(document))
             {
                 Console.WriteLine("Add bates done.");
@@ -43,10 +47,13 @@ namespace BatesTest
             {
                 Console.WriteLine("Add bates failed.");
             }
-            #endregion
+
+            document.Release();
+
             Console.WriteLine("--------------------");
+            #endregion
 
-            #region Edit bates
+            #region Samles 2: Edit bates
             if (EditBates(document))
             {
                 Console.WriteLine("Edit bates done.");
@@ -55,10 +62,14 @@ namespace BatesTest
             {
                 Console.WriteLine("Edit bates failed.");
             }
-            #endregion
+
+            document.Release();
+
             Console.WriteLine("--------------------");
 
-            #region Clear bates
+            #endregion
+
+            #region Sample 3: Clear bates
             if (ClearBates(document))
             {
                 Console.WriteLine("Clear bates done.");
@@ -67,14 +78,22 @@ namespace BatesTest
             {
                 Console.WriteLine("Clear bates failed.");
             }
-            #endregion
+
+            document.Release();
             Console.WriteLine("--------------------");
+
+            #endregion
+
             Console.WriteLine("Done!");
             Console.WriteLine("--------------------");
              
             Console.ReadLine();
         }
 
+        /// <summary>
+        /// Add a new bates
+        /// </summary>
+        /// <param name="document">Regular document</param> 
         private static bool AddBates(CPDFDocument document)
         {
             string addBatesPath = outputPath + "\\AddBatesTest.pdf";
@@ -82,11 +101,11 @@ namespace BatesTest
             CPDFBates bates = document.GetBates();
             byte[] color = { 255, 0, 0 };
              
-            bates.SetPages("0-" + (document.PageCount - 1));
+            bates.SetPages("0-" + (document.PageCount - 1));//Page numbering from 0
 
             for (int i = 0; i <= 5; i++)
             {
-                bates.SetText(i, @"<<#3#5#Prefix-#-Suffix>>"); 
+                bates.SetText(i, @"<<#3#5#Prefix-#-Suffix>>");  //3 digits, starting from 5
                 bates.SetTextColor(i, color);
                 bates.SetFontSize(i, 14);
                  
@@ -96,17 +115,20 @@ namespace BatesTest
 
             bates.Update();
 
-            if (document.WriteToFilePath(addBatesPath))
-            {
-                Console.WriteLine("Browse the changed file in " + addBatesPath);
-                return true;
-            }
-            else
+            if (!document.WriteToFilePath(addBatesPath))
             {
                 return false;
             }
+            Console.WriteLine("Browse the changed file in " + addBatesPath);
+            return true;
         }
 
+        /// <summary>
+        /// Edit bates, <<#3#5#Prefix-#-Suffix>> -> <<#3#1#ComPDFKit-#-ComPDFKit>>
+        /// get current bates,
+        /// then edit it
+        /// </summary>
+        /// <param name="document">documet with bates</param> 
         private static bool EditBates(CPDFDocument document)
         {
 
@@ -140,6 +162,10 @@ namespace BatesTest
             }
         }
 
+        /// <summary>
+        /// Clear bates.
+        /// </summary>
+        /// <param name="document">documet with bates</param> 
         private static bool ClearBates(CPDFDocument document)
         {
             CPDFBates bates = document.GetBates();

+ 39 - 4
Demo/Examples/Samples/DocumentCompare/DocumentCompare.cs

@@ -19,15 +19,16 @@ namespace DocumentCompareTest
             Console.WriteLine("Running PDFPage test sample…\r\n");
 
             SDKLicenseHelper.LicenseVerify();
-            CPDFDocument document1 = CPDFDocument.InitWithFilePath("ElectricalDiagram.pdf");
-            CPDFDocument document2 = CPDFDocument.InitWithFilePath("ElectricalDiagram_New.pdf");
+            
 
             if (!Directory.Exists(outputPath))
             {
                 Directory.CreateDirectory(outputPath);
             }
 
-            if (CompareDocument(document1, document2))
+            CPDFDocument document1 = CPDFDocument.InitWithFilePath("ElectricalDiagram.pdf");
+            CPDFDocument document2 = CPDFDocument.InitWithFilePath("ElectricalDiagram_New.pdf");
+            if (OverlayCompareDocument(document1, document2))
             {
                 Console.WriteLine("Compare document done.");
             }
@@ -35,13 +36,29 @@ namespace DocumentCompareTest
             {
                 Console.WriteLine("Compare document failed."); 
             }
+            document1.Release();
+            document2.Release();
             Console.WriteLine("--------------------");
+
+            CPDFDocument document3 = CPDFDocument.InitWithFilePath("Text.pdf");
+            CPDFDocument document4 = CPDFDocument.InitWithFilePath("TextChanged.pdf");
+            if (ContentCompareDocument(document3, document4))
+            {
+                Console.WriteLine("Compare document done.");
+            }
+            else
+            {
+                Console.WriteLine("Compare document failed.");
+            }
+            document1.Release();
+            document2.Release();
+
             Console.WriteLine("Done!");
             Console.WriteLine("--------------------");
             Console.ReadLine();
         }
 
-        static private bool CompareDocument(CPDFDocument document1, CPDFDocument document2)
+        static private bool OverlayCompareDocument(CPDFDocument document1, CPDFDocument document2)
         {
             CPDFCompareOverlay compareOverlay = new CPDFCompareOverlay(document1, "1-5", document2, "1-5");
             compareOverlay.Compare();
@@ -54,5 +71,23 @@ namespace DocumentCompareTest
             Console.WriteLine("Browse the changed file in " + path);
             return true;
         }
+
+        static private bool ContentCompareDocument(CPDFDocument document, CPDFDocument documentNew)
+        {
+            CPDFCompareContent compareContent = new CPDFCompareContent(document, documentNew);
+            int pageCount = Math.Min(document.PageCount, documentNew.PageCount);
+            for (int i = 0; i < pageCount; i++)
+            {
+                Console.WriteLine("Page: {0}", i);
+
+                CPDFCompareResults compareResults = compareContent.Compare(i, i, CPDFCompareType.CPDFCompareTypeAll, true);
+                Console.WriteLine("Replace count: {0}", compareResults.ReplaceCount);
+                Console.WriteLine("TextResults count: {0}", compareResults.TextResults.Count);
+                Console.WriteLine("Delete count: {0}", compareResults.DeleteCount);
+                Console.WriteLine("Insert count: {0}", compareResults.InsertCount); 
+            }
+           
+            return true;
+        }
     }
 }

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

@@ -66,8 +66,15 @@
       <Link>ElectricalDiagram_New.pdf</Link>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="..\..\TestFile\Text.pdf">
+      <Link>Text.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
     <None Include="App.config" />
     <None Include="packages.config" />
+    <None Include="TextChanged.pdf">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\license_key_win.xml">

BIN
Demo/Examples/Samples/DocumentCompare/TextChanged.pdf


+ 8 - 2
Demo/Examples/Samples/DocumentInfoTest/DocumentInfoTest.cs

@@ -14,10 +14,13 @@ namespace DocumentInfoTest
         { 
             Console.WriteLine("Running DocumentInfo test sample…\r\n");
             SDKLicenseHelper.LicenseVerify();
-            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
-            PrintDocumentInfo(document);
 
+            #region Sample 1: Print information
+            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+            PrintDocumentInfo(document); 
             Console.WriteLine("--------------------");
+            #endregion
+
             Console.WriteLine("Done.");
             Console.WriteLine("--------------------");
 
@@ -74,6 +77,9 @@ namespace DocumentInfoTest
             return "0B";
         }
 
+        /// <summary>
+        /// Print all of the infomations
+        /// </summary> 
         static private void PrintDocumentInfo(CPDFDocument document)
         {
             Console.WriteLine("File Name: {0}", document.FileName);

+ 72 - 20
Demo/Examples/Samples/EncryptTest/EncryptTest.cs

@@ -16,17 +16,23 @@ namespace EncryptTest
 
         static void Main(string[] args)
         {
+            #region Perparation work
+
             Console.WriteLine("Running Encrypt test sample…\r\n");
 
             SDKLicenseHelper.LicenseVerify();
 
-            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
-
             if (!Directory.Exists(outputPath))
             {
                 Directory.CreateDirectory(outputPath);
             }
 
+            #endregion
+
+            #region Sample 1: Encrypt by user password
+
+            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+
             if (EncryptByUserPassword(document))
             {
                 Console.WriteLine("Encrypt by user password done.");
@@ -37,10 +43,14 @@ namespace EncryptTest
             }
 
             document.Release();
-            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
-
             Console.WriteLine("--------------------");
 
+            #endregion
+
+            #region Sample 2:  Encrypt by owner password
+
+            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+
             if (EncryptByOwnerPassword(document))
             {
                 Console.WriteLine("Encrypt by owner password done.");
@@ -49,11 +59,16 @@ namespace EncryptTest
             {
                 Console.WriteLine("Encrypt by owner password failed.");
             }
+            document.Release();
 
             Console.WriteLine("--------------------");
 
-            document.Release();
+            #endregion
+
+            #region Sample 3: Encrypt by all passwords
+
             document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+
             if (EncryptByAllPasswords(document))
             {
                 Console.WriteLine("Encrypt by Both user and owner passwords done.");
@@ -63,10 +78,13 @@ namespace EncryptTest
                 Console.WriteLine("Encrypt by Both user and owner passwords failed.");
             }
 
+            document.Release();
+
             Console.WriteLine("--------------------");
 
+            #endregion
 
-            document.Release();
+            #region Sample 4: Unlock
             document = CPDFDocument.InitWithFilePath("AllPasswords.pdf");
             if (Unlock(document))
             {
@@ -76,10 +94,14 @@ namespace EncryptTest
             {
                 Console.WriteLine("Unlock failed.");
             }
+            document.Release();
 
             Console.WriteLine("--------------------");
 
-            document.Release();
+            #endregion
+
+            #region Sample 5: Decrypt
+
             document = CPDFDocument.InitWithFilePath("AllPasswords.pdf");
             if (Decrypt(document))
             {
@@ -89,8 +111,11 @@ namespace EncryptTest
             {
                 Console.WriteLine("Decrypt failed.");
             }
-
+            document.Release();
             Console.WriteLine("--------------------");
+
+            #endregion
+
             Console.WriteLine("Done!");
             Console.WriteLine("--------------------");
             Console.ReadLine();
@@ -199,6 +224,12 @@ namespace EncryptTest
             return true;
         }
 
+        /// <summary>
+        /// Using RC4, AES128, AES256, NoEncrypt algorithm to encrypt document. 
+        /// User password: User
+        /// No owner password
+        /// </summary>
+        /// <param name="document">Regular document</param>
         static private bool EncryptByUserPassword(CPDFDocument document)
         {
             bool result = true;
@@ -249,6 +280,12 @@ namespace EncryptTest
             return result;
         }
 
+        /// <summary>
+        /// Encrypt by owner password
+        /// No user password
+        /// Owner password: Owner
+        /// </summary>
+        /// <param name="document">Regular document</param> 
         static private bool EncryptByOwnerPassword(CPDFDocument document)
         {
             userPassword = null;
@@ -279,6 +316,12 @@ namespace EncryptTest
             return true;
         }
 
+        /// <summary>
+        /// Encrypt by all passwords
+        /// User password: User
+        /// Owner password: owner
+        /// </summary>
+        /// <param name="document">Regular document</param> 
         static private bool EncryptByAllPasswords(CPDFDocument document)
         {
             userPassword = "User";
@@ -310,6 +353,10 @@ namespace EncryptTest
             return true;
         }
 
+        /// <summary>
+        /// Print printing and copying permissions info.
+        /// </summary>
+        /// <param name="permissionsInfo">Permissions info about a document</param>
         static private void PrintPermissionsInfo(CPDFPermissionsInfo permissionsInfo)
         {
             Console.Write("AllowsPrinting: ");
@@ -318,31 +365,36 @@ namespace EncryptTest
             Console.Write(permissionsInfo.AllowsCopying == true ? "Yes\n" : "No\n");
         }
 
+        /// <summary>
+        /// Unlock document
+        /// 
+        /// </summary>
+        /// <param name="document"></param>
         static private bool Unlock(CPDFDocument document)
         {
             userPassword = "User";
             ownerPassword = "Owner";
+            //Check if document is locked
             if (document.IsLocked)
             {
                 Console.WriteLine("Document is locked");
             }
-            Console.WriteLine("Unlock with user password");
-            document.UnlockWithPassword(userPassword);
-            if (!document.IsLocked)
-            {
-                Console.WriteLine("Document is unlocked");
-            }
-            else
-            {
-                return false;
-            }
+             
+
             PrintPermissionsInfo(document.GetPermissionsInfo());
+             
             Console.WriteLine("Unlock with owner password");
-            document.CheckOwnerPassword(ownerPassword);
+            //
+            document.CheckOwnerPassword("123");
+            //Check permissions info.
             PrintPermissionsInfo(document.GetPermissionsInfo());
             return true;
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="document"></param>
         static private bool Decrypt(CPDFDocument document)
         {
             userPassword = "User";
@@ -361,7 +413,7 @@ namespace EncryptTest
             else
             {
                 Console.WriteLine("Document decrypt done.");
-            }
+            } 
             return true;
         }
     }

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

@@ -35,12 +35,6 @@
     <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" />
@@ -75,6 +69,16 @@
       <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">

+ 24 - 13
Demo/Examples/Samples/FlattenTest/FlattenTest.cs

@@ -14,13 +14,18 @@ namespace FlattenTest
         static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Flatten";
         static void Main(string[] args)
         {
+            #region Perparation work
             Console.WriteLine("Running Flatten test sample…\r\n");
             SDKLicenseHelper.LicenseVerify();
-            CPDFDocument document = CPDFDocument.InitWithFilePath("Annotations.pdf");
             if (!Directory.Exists(outputPath))
             {
                 Directory.CreateDirectory(outputPath);
             }
+            #endregion
+
+            #region Sample1: Flatten
+
+            CPDFDocument document = CPDFDocument.InitWithFilePath("Annotations.pdf");
 
             if (Flatten(document))
             {
@@ -31,12 +36,21 @@ namespace FlattenTest
                 Console.WriteLine("Flatten failed.");
             }
             Console.WriteLine("--------------------");
+            document.Release();
+
+            #endregion
+
             Console.WriteLine("Done");
             Console.WriteLine("--------------------");
 
             Console.ReadLine();
         }
 
+        /// <summary>
+        /// Flatten documentation with comments
+        /// </summary>
+        /// <param name="document">document with many annotation. </param>
+        /// <returns></returns>
         static private bool Flatten(CPDFDocument document)
         {
             int annotationCount = 0;
@@ -47,30 +61,27 @@ namespace FlattenTest
             }
             Console.Write("{0} annotations in the file. ", annotationCount);
             string flattenPath = outputPath + "\\FlattenTest.pdf";
-            if (document.WriteFlattenToFilePath(flattenPath))
-            {
-                Console.WriteLine("Browse the changed file in " + flattenPath);
-            }
-            else
+            if (!document.WriteFlattenToFilePath(flattenPath))
             {
                 return false;
             }
+            Console.WriteLine("Browse the changed file in " + flattenPath);
+
+            //Verify: Check if the number of comments in the new document is 0
             CPDFDocument flattenDocument = CPDFDocument.InitWithFilePath(flattenPath);
             int newCount = 0;
             for (int i = 0; i < flattenDocument.PageCount; i++)
             {
                 CPDFPage page = flattenDocument.PageAtIndex(i);
                 newCount += page.GetAnnotCount();
-            } 
-            Console.WriteLine("{0} annotations in the new file. ", newCount);
-            if (newCount == 0)
-            {
-                return true;
             }
-            else
+            Console.WriteLine("{0} annotations in the new file. ", newCount);
+            if (!(newCount == 0))
             {
                 return false;
-            } 
+            }
+            return true;
+
         }
     }
 }

+ 12 - 22
Demo/Examples/Samples/HeaderFooterTest/HeaderFooterTest.cs

@@ -45,8 +45,10 @@ namespace HeaderFooterTest
             {
                 Console.WriteLine("Add common header and footer failed.");
             }
-            #endregion
+            document.Release();
             Console.WriteLine("--------------------");
+
+            #endregion
             #region Add page header and footer 
             if (AddPageHeaderFooter(document))
             {
@@ -91,67 +93,55 @@ namespace HeaderFooterTest
         /// <summary>
         /// Follow these steps to add a header and footer in a blank pages file.  
         /// </summary>
-        /// <param name="document">Documents that require manipulation</param>
+        /// <param name="document">Regular document</param>
         static private bool AddCommonHeaderFooter(CPDFDocument document)
         {
 
-            // Init HeaderFooter
             CPDFHeaderFooter headerFooter = document.GetHeaderFooter();
             byte[] color = { 255, 0, 0 };
             headerFooter.SetPages("0-" + (document.PageCount - 1));
 
             for (int i = 0; i <= 2; i++)
             {
-                // Set Text: ComPDFKit
                 headerFooter.SetText(i, "ComPDFKit");
-                // Set page index: all the page
-                // Set color : red
                 headerFooter.SetTextColor(i, color);
-                // Set font size : 14
                 headerFooter.SetFontSize(i, 14);
 
                 Console.WriteLine("Text: {0}", headerFooter.GetText(i));
                 Console.WriteLine("Location: {0}\n", IntToLocationDic[i]);
             }
 
-            // Update header and footer after changed
             headerFooter.Update();
 
-            // Save to pointed path so you can observe the effect.
             string addHeaderFooterPath = outputPath + "\\AddCommonHeaderFooterTest.pdf";
 
-            if (document.WriteToFilePath(addHeaderFooterPath))
+            if (!document.WriteToFilePath(addHeaderFooterPath))
             {
-                Console.WriteLine("Browse the changed file in " + addHeaderFooterPath);
-                return true;
-            }
-            else
-            {
-                return false;
+                return false; 
             }
+            Console.WriteLine("Browse the changed file in " + addHeaderFooterPath);
+            return true;
         }
 
+        /// <summary>
+        /// Add headers and footers that automatically display page numbers
+        /// </summary>
+        /// <param name="document">Regular document</param>
         static private bool AddPageHeaderFooter(CPDFDocument document)
         {
-            // Init HeaderFooter
             CPDFHeaderFooter headerFooter = document.GetHeaderFooter();
             byte[] color = { 255, 0, 0 };
-            // Set page index: all the page
             headerFooter.SetPages("0-" + (document.PageCount - 1));
             for (int i = 3; i <= 5; i++)
             {
-                // Set Text: 1
                 headerFooter.SetText(i, "<<1,2>>");
-                // Set color : red
                 headerFooter.SetTextColor(i, color);
-                // Set font size : 14
                 headerFooter.SetFontSize(i, 14);
 
                 Console.WriteLine("Text: {0}", headerFooter.GetText(i));
                 Console.WriteLine("Location: {0}\n", IntToLocationDic[i]);
             }
 
-            // Update header and footer after changed
             headerFooter.Update();
 
             string addHeaderFooterPath = outputPath + "\\AddPageHeaderFooterTest.pdf";

+ 14 - 3
Demo/Examples/Samples/ImageExtractTest/ImageExtractTest.cs

@@ -19,6 +19,7 @@ namespace ImageExtractTest
 
         static void Main(string[] args)
         {
+            #region Perparation work
             Console.WriteLine("Running Bookmark test sample…\r\n");
 
             SDKLicenseHelper.LicenseVerify();
@@ -30,18 +31,28 @@ namespace ImageExtractTest
                 Directory.CreateDirectory(outputPath);
             }
 
+            #endregion
+
+            #region Sample 1: Extract image
+
             ExtractImage(document);
-            
+            document.Release();
             Console.WriteLine("--------------------");
+
+            #endregion
+
             Console.WriteLine("Done");
             Console.WriteLine("--------------------");
             Console.ReadLine();
         }
 
-        static private bool ExtractImage(CPDFDocument document)
+        /// <summary>
+        /// Extract all images from document
+        /// </summary>
+        /// <param name="document">Regular documet with some picture</param>
+        static private void ExtractImage(CPDFDocument document)
         { 
             document.ExtractImage("1-5", outputPath);
-            return true;
         }
     }
 }

+ 53 - 4
Demo/Examples/Samples/OutlineTest/OutlineTest.cs

@@ -16,14 +16,23 @@ namespace OutlineTest
 
         static void Main(string[] args)
         {
+            #region Perparation work
+
             Console.WriteLine("Running Outline test sample…\r\n");
 
             SDKLicenseHelper.LicenseVerify();
-            CPDFDocument document = CPDFDocument.InitWithFilePath("FourOutline.pdf");
+
             if (!Directory.Exists(outputPath))
             {
                 Directory.CreateDirectory(outputPath);
             }
+
+            #endregion
+
+            #region Sample 1: Print outline
+
+            CPDFDocument document = CPDFDocument.InitWithFilePath("FourOutline.pdf");
+                                                                                                
             if (PrintOutline(document))
             {
                 Console.WriteLine("Print outline done.");
@@ -32,10 +41,14 @@ namespace OutlineTest
             {
                 Console.WriteLine("Print outline failed.");
             }
+            document.Release();
 
             Console.WriteLine("--------------------");
 
-            document.Release();
+            #endregion
+
+            #region Sample 2: Create outline
+
             document = CPDFDocument.InitWithFilePath("FourOutline.pdf");
 
             if (CreateOutline(document))
@@ -46,9 +59,14 @@ namespace OutlineTest
             {
                 Console.WriteLine("Create outline failed.");
             }
+            document.Release();
+
             Console.WriteLine("--------------------");
 
-            document.Release();
+            #endregion
+
+            #region Sample 3: Move outline
+
             document = CPDFDocument.InitWithFilePath("FourOutline.pdf");
             if (MoveOutline(document))
             {
@@ -58,9 +76,14 @@ namespace OutlineTest
             {
                 Console.WriteLine("Move outline failed.");
             }
+            document.Release();
+
             Console.WriteLine("--------------------");
 
-            document.Release();
+            #endregion
+
+            #region Sample 4: Remove outline
+
             document = CPDFDocument.InitWithFilePath("FourOutline.pdf");
             if (RemoveOutline(document))
             {
@@ -70,13 +93,21 @@ namespace OutlineTest
             {
                 Console.WriteLine("Remove outline failed.");
             }
+            document.Release();
             Console.WriteLine("--------------------");
+
+            #endregion
+
             Console.WriteLine("Done.");
             Console.WriteLine("--------------------");
 
             Console.ReadLine();
         }
 
+        /// <summary>
+        /// Traverse outline and print it as a list
+        /// </summary>
+        /// <param name="outlineList"></param>
         static private void TraverseOutline(List<CPDFOutline> outlineList)
         {
             foreach (var outline in outlineList)
@@ -104,6 +135,10 @@ namespace OutlineTest
             }
         }
 
+        /// <summary>
+        /// Print all outlines in the file
+        /// </summary>
+        /// <param name="document">Document with some outlines</param> 
         static private bool PrintOutline(CPDFDocument document)
         {
             List<CPDFOutline> outlineList = document.GetOutlineList();
@@ -114,6 +149,10 @@ namespace OutlineTest
             return true;
         }
 
+        /// <summary>
+        /// Create an outline at the top of the first page
+        /// </summary>
+        /// <param name="document">Document with some outlines</param>
         static private bool CreateOutline(CPDFDocument document)
         {
             CPDFOutline outline = document.GetOutlineRoot();
@@ -125,6 +164,11 @@ namespace OutlineTest
             return true;
         }
 
+        /// <summary>
+        /// Create an outline at the top of the first page
+        /// </summary>
+        /// <param name="document"></param>
+        /// <returns></returns>
         static private bool MoveOutline(CPDFDocument document)
         {
             CPDFOutline outline = document.GetOutlineRoot();
@@ -143,6 +187,11 @@ namespace OutlineTest
             return true;
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="document"></param>
+        /// <returns></returns>
         static private bool RemoveOutline(CPDFDocument document)
         { 
             document.GetOutlineList()[0].RemoveFromParent(document);

+ 21 - 4
Demo/Examples/Samples/PDFATest/PDFATest.cs

@@ -14,6 +14,8 @@ namespace PDFATest
 
         static void Main(string[] args)
         {
+            #region Perparation work
+             
             Console.WriteLine("Running PDFA test sample…\r\n");
 
             SDKLicenseHelper.LicenseVerify();
@@ -24,7 +26,10 @@ namespace PDFATest
             {
                 Directory.CreateDirectory(outputPath);
             }
+            #endregion
+             
             #region PDF/A-1a
+
             if (CovertToPDFA1a(document))
             {
                 Console.WriteLine("Convert to PDF/A-1a done.");
@@ -33,14 +38,17 @@ namespace PDFATest
             {
                 Console.WriteLine("Convert to PDF/A-1a failed.");
             }
-            #endregion
 
+            document.Release();
+            
             Console.WriteLine("--------------------");
 
-            document.Release();
+            #endregion
+             
+            #region PDF/A-1b
+
             document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
 
-            #region PDF/A-1b
             if (CovertToPDFA1b(document))
             {
                 Console.WriteLine("Convert to PDF/A-1b done.");
@@ -49,15 +57,20 @@ namespace PDFATest
             {
                 Console.WriteLine("Convert to PDF/A-1b failed.");
             }
+            document.Release();
+            Console.WriteLine("--------------------");
             #endregion
 
-            Console.WriteLine("--------------------");
             Console.WriteLine("Done!");
             Console.WriteLine("--------------------");
 
             Console.ReadLine();
         }
 
+        /// <summary>
+        /// Save PDF as PDFA1a
+        /// </summary>
+        /// <param name="document">Regular document</param> 
         static public bool CovertToPDFA1a(CPDFDocument document)
         {
             string convertToPDFA1aPath = outputPath + "\\ConvertToPDFA1aTest.pdf";
@@ -69,6 +82,10 @@ namespace PDFATest
             return true;
         }
 
+        /// <summary>
+        /// Save PDF as PDFA1b
+        /// </summary>
+        /// <param name="document">Regular document</param> 
         static public bool CovertToPDFA1b(CPDFDocument document)
         {
             string convertToPDFA1bPath = outputPath + "\\ConvertToPDFA1bTest.pdf";

+ 93 - 42
Demo/Examples/Samples/PDFPageTest/PDFPageTest.cs

@@ -14,6 +14,7 @@ namespace PDFPageTest
         static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\PDFPageTest";
         static void Main(string[] args)
         {
+            #region Perparation work
             Console.WriteLine("Running PDFPage test sample…\r\n");
 
             SDKLicenseHelper.LicenseVerify();
@@ -22,6 +23,9 @@ namespace PDFPageTest
             {
                 Directory.CreateDirectory(outputPath);
             }
+            #endregion
+
+            #region Sample 1: Insert blank page
 
             if (InsertBlankPage(document))
             {
@@ -32,8 +36,13 @@ namespace PDFPageTest
                 Console.WriteLine("Insert blank page failed.");
             }
             document.Release();
-            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             Console.WriteLine("--------------------");
+
+            #endregion
+
+            #region Sample 2: Insert PDF page
+
+            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             if (InsertPDFPPage(document))
             {
                 Console.WriteLine("Insert PDF page done.");
@@ -43,8 +52,13 @@ namespace PDFPageTest
                 Console.WriteLine("Insert PDF page failed.");
             }
             document.Release();
-            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             Console.WriteLine("--------------------");
+
+            #endregion
+
+            #region Sample 3: Split pages
+
+            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             if (SplitPages(document))
             {
                 Console.WriteLine("Split page done.");
@@ -52,21 +66,31 @@ namespace PDFPageTest
             else
             {
                 Console.WriteLine("Split failed.");
-            } 
+            }
             document.Release();
-            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             Console.WriteLine("--------------------");
-            if (RemovePaes(document))
+
+            #endregion
+
+            #region Sample 4: Remove pages
+
+            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+            if (RemovePages(document))
             {
                 Console.WriteLine("Delete even page done.");
             }
             else
             {
                 Console.WriteLine("Delete even page failed.");
-            } 
+            }
             document.Release();
-            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             Console.WriteLine("--------------------");
+
+            #endregion
+
+            #region Sample 5: Rotate page
+
+            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             if (RotatePage(document))
             {
                 Console.WriteLine("Rotate page done.");
@@ -77,8 +101,13 @@ namespace PDFPageTest
             }
 
             document.Release();
-            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             Console.WriteLine("--------------------");
+
+            #endregion
+
+            #region Sample 6: Repalce pages
+
+            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             if (RepalcePages(document))
             {
                 Console.WriteLine("Repalce page done.");
@@ -89,8 +118,12 @@ namespace PDFPageTest
             }
 
             document.Release();
-            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             Console.WriteLine("--------------------");
+
+            #endregion
+
+            #region Sample 7: Extract pages
+            document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             if (ExtractPages(document))
             {
                 Console.WriteLine("Extract page done.");
@@ -99,14 +132,21 @@ namespace PDFPageTest
             {
                 Console.WriteLine("Extract page failed.");
             }
-
+            document.Release();
             Console.WriteLine("--------------------");
+
+            #endregion
+
             Console.WriteLine("Done");
             Console.WriteLine("--------------------");
 
             Console.ReadLine();
         }
 
+        /// <summary>
+        /// Insert a new page of A4 size at the second page
+        /// </summary>
+        /// <param name="document">Regular five page document</param>
         static private bool InsertBlankPage(CPDFDocument document)
         {
             int pageIndex = 1;
@@ -114,12 +154,7 @@ namespace PDFPageTest
             int pageHeight = 842;
             document.InsertPage(pageIndex, pageWidth, pageHeight, null);
             Console.WriteLine("Insert PageIndex: {0}", pageIndex);
-            Console.WriteLine("Size; {0}*{1}", pageWidth, pageHeight);
-
-            if (document.PageCount != 6)
-            {
-                return false;
-            }
+            Console.WriteLine("Size: {0}*{1}", pageWidth, pageHeight);
 
             string path = outputPath + "\\InsertBlankPageTest.pdf";
             if (!document.WriteToFilePath(path))
@@ -130,14 +165,15 @@ namespace PDFPageTest
             return true;
         }
 
+        /// <summary>
+        /// Select pages from other PDF files and insert them into the current document
+        /// </summary>
+        /// <param name="document">Regular five page document</param>
         static private bool InsertPDFPPage(CPDFDocument document)
         {
             CPDFDocument documentForInsert = CPDFDocument.InitWithFilePath("Text.pdf");
             document.ImportPagesAtIndex(documentForInsert, "1", 1);
-            if (document.PageCount != 6)
-            {
-                return false;
-            }
+
             string path = outputPath + "\\InsertPDFPPageTest.pdf";
             if (!document.WriteToFilePath(path))
             {
@@ -147,46 +183,49 @@ namespace PDFPageTest
             return true;
         }
 
+        /// <summary>
+        /// Split the current document into two documents according to the first 2 pages and the last 3 pages
+        /// </summary>
+        /// <param name="document">Regular five page document</param>
         static private bool SplitPages(CPDFDocument document)
         {
+            //Split 1-2 pages
             CPDFDocument documentPart1 = CPDFDocument.CreateDocument();
-            CPDFDocument documentPart2 = CPDFDocument.CreateDocument();
             documentPart1.ImportPagesAtIndex(document, "1-2", 0);
-            documentPart2.ImportPagesAtIndex(document, "3-5", 0);
-            if (documentPart1.PageCount != 2)
-            {
-                return false;
-            }
+
             string pathPart1 = outputPath + "\\SplitPart1Test.pdf";
             if (!documentPart1.WriteToFilePath(pathPart1))
             {
                 return false;
             }
-            if (documentPart2.PageCount != 3)
-            {
-                return false;
-            }
+            Console.WriteLine("Browse the changed file in " + pathPart1);
+
+            //Split 3-5 pages
+            CPDFDocument documentPart2 = CPDFDocument.CreateDocument();
+            documentPart2.ImportPagesAtIndex(document, "3-5", 0);
+
             string pathPart2 = outputPath + "\\SplitPart2Test.pdf";
             if (!documentPart2.WriteToFilePath(pathPart2))
             {
                 return false;
             }
-            Console.WriteLine("Browse the changed file in " + pathPart1);
             Console.WriteLine("Browse the changed file in " + pathPart2);
             return true;
         }
 
-        static private bool RemovePaes(CPDFDocument document)
+        /// <summary>
+        /// Remove even-numbered pages from a document
+        /// </summary>
+        /// <param name="document">Regular five page document</param> 
+        static private bool RemovePages(CPDFDocument document)
         {
             ArrayList arr = new ArrayList();
-            for (int i = 2; i < document.PageCount; i += 2){
+            for (int i = 1; i < document.PageCount; i += 2)
+            {
                 arr.Add(i);
             }
             document.RemovePages((int[])arr.ToArray(typeof(int)));
-            if(document.PageCount != 3)
-            {
-                return false;
-            } 
+
             string path = outputPath + "\\RemoveEvenPagesTest.pdf";
             if (!document.WriteToFilePath(path))
             {
@@ -196,9 +235,13 @@ namespace PDFPageTest
             return true;
         }
 
+        /// <summary>
+        ///  Rotate the first page 90 degrees clockwise
+        /// </summary>
+        /// <param name="document">Regular five page document</param>
         static private bool RotatePage(CPDFDocument document)
         {
-            document.RotatePage(0, 1);
+            document.RotatePage(0, 1);//Rotation: Rotate 90 degrees per unit
             string path = outputPath + "\\RotatePageTest.pdf";
             if (!document.WriteToFilePath(path))
             {
@@ -208,6 +251,12 @@ namespace PDFPageTest
             return true;
         }
 
+        /// <summary>
+        /// Replace the first page of the current document with a page from another document
+        /// Delete the pages that need to be replaced first
+        /// Insert the required pages into the document
+        /// </summary>
+        /// <param name="document">Regular five page document</param>
         static private bool RepalcePages(CPDFDocument document)
         {
             int[] pageArr = new int[1];
@@ -224,14 +273,16 @@ namespace PDFPageTest
             return true;
         }
 
+        /// <summary>
+        /// Extract pages from a document
+        /// Create a new document
+        /// Insert the required pages into a new document
+        /// </summary>
+        /// <param name="document">Regular five page document</param>
         static private bool ExtractPages(CPDFDocument document)
         {
             CPDFDocument extractDocument = CPDFDocument.CreateDocument();
             extractDocument.ImportPagesAtIndex(document, "1", 0);
-            if (!(extractDocument.PageCount == 1))
-            {
-                return false;
-            }
             string path = outputPath + "\\ExtractPagesTest.pdf";
             if (!extractDocument.WriteToFilePath(path))
             {

+ 15 - 11
Demo/Examples/Samples/PDFRedactTest/PDFRedactTest.cs

@@ -2,12 +2,8 @@
 using ComPDFKit.PDFAnnotation;
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFPage;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System; 
+using System.IO; 
 using System.Windows;
 
 namespace PDFRedactTest
@@ -17,6 +13,7 @@ namespace PDFRedactTest
         static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Redact";
         static void Main(string[] args)
         {
+            #region Perparation work
             Console.WriteLine("Running redact test sample…\r\n");
             SDKLicenseHelper.LicenseVerify();
 
@@ -29,6 +26,7 @@ namespace PDFRedactTest
             {
                 Directory.CreateDirectory(outputPath);
             }
+            #endregion
 
             #region Redact
             if (Redact(document))
@@ -39,19 +37,24 @@ namespace PDFRedactTest
             {
                 Console.WriteLine("Redact failed.");
             }
-            #endregion
+
             Console.WriteLine("--------------------");
+            #endregion
+
             Console.WriteLine("Done!");
             Console.WriteLine("--------------------");
 
             Console.ReadLine();
         }
 
+        /// <summary>
+        /// Redact an area in PDF
+        /// </summary>
+        /// <param name="document">Regular document with some text</param>
+        /// <returns></returns>
         static private bool Redact(CPDFDocument document)
         {
-            //PageIndex: 0
             CPDFPage page = document.PageAtIndex(0);
-            //Initial redaction
             CPDFRedactAnnotation redact = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_REDACT) as CPDFRedactAnnotation;
             //Set radact rect: cover the title
             redact.SetRect(new CRect(300, 240, 400, 300));
@@ -67,10 +70,9 @@ namespace PDFRedactTest
             redact.SetTextDa(textAttribute);
             redact.SetTextAlignment(C_TEXT_ALIGNMENT.ALIGNMENT_LEFT);
 
-            //Fill color
+            //Properties of cover square
             byte[] fillColor = { 255, 0, 0 };
             redact.SetFillColor(fillColor);
-
             byte[] outlineColor = { 0, 255, 0 };
             redact.SetOutlineColor(outlineColor);
 
@@ -84,6 +86,8 @@ namespace PDFRedactTest
             }
             Console.WriteLine("Browse the changed file in " + path);
             CPDFDocument newDocument = CPDFDocument.InitWithFilePath(path);
+
+            //Validation: try to get the text of the covered area
             string str = newDocument.PageAtIndex(0).GetTextPage().GetSelectText(new Point(60, 200), new Point(560, 250), new Point(0, 0));
             Console.WriteLine("Text in the redacted area is: {0}", str); 
             return true;

+ 1 - 2
Demo/Examples/Samples/WatermarkTest/WatermarkTest.cs

@@ -18,7 +18,6 @@ namespace WatermarkTest
         static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Watermark";
         static void Main(string[] args)
         {
-
             #region Perparation work
             Console.WriteLine("Running Watermark test sample…\r\n");
             SDKLicenseHelper.LicenseVerify();
@@ -128,7 +127,7 @@ namespace WatermarkTest
         ///  Convert the bitmap to an array that can be set as an image watermark
         /// </summary>
         /// <param name="bitmap">Image source to be used as a image watermark.</param>
-        /// <returns>An array for setting image watermarks</returns>
+        /// <returns>An array for setting image</returns>
         public static byte[] BitmapToByteArray(Bitmap bitmap)
         {
 

BIN
Demo/Examples/TestFile/TextChanged.pdf