Pārlūkot izejas kodu

compdfkit(win) - VB samples

liuaoran 1 gadu atpakaļ
vecāks
revīzija
b7f2b9f05f
68 mainītis faili ar 3569 papildinājumiem un 96 dzēšanām
  1. 83 0
      Demo/Examples/Examlpes.sln
  2. 7 13
      Demo/Examples/Samples/AnnotationImportExportTest/CS/AnnotationImportExportTest.cs
  3. 11 16
      Demo/Examples/Samples/AnnotationImportExportTest/VB/AnnotationImportExport.vb
  4. 2 2
      Demo/Examples/Samples/AnnotationImportExportTest/VB/AnnotationImportExportTest.vbproj
  5. 19 13
      Demo/Examples/Samples/AnnotationTest/CS/AnnotationTest.cs
  6. 258 0
      Demo/Examples/Samples/AnnotationTest/VB/AnnotationTest.vb
  7. 156 0
      Demo/Examples/Samples/AnnotationTest/VB/AnnotationTest.vbproj
  8. 6 0
      Demo/Examples/Samples/AnnotationTest/VB/App.config
  9. 13 0
      Demo/Examples/Samples/AnnotationTest/VB/My Project/Application.Designer.vb
  10. 10 0
      Demo/Examples/Samples/AnnotationTest/VB/My Project/Application.myapp
  11. 35 0
      Demo/Examples/Samples/AnnotationTest/VB/My Project/AssemblyInfo.vb
  12. 62 0
      Demo/Examples/Samples/AnnotationTest/VB/My Project/Resources.Designer.vb
  13. 117 0
      Demo/Examples/Samples/AnnotationTest/VB/My Project/Resources.resx
  14. 73 0
      Demo/Examples/Samples/AnnotationTest/VB/My Project/Settings.Designer.vb
  15. 7 0
      Demo/Examples/Samples/AnnotationTest/VB/My Project/Settings.settings
  16. 4 0
      Demo/Examples/Samples/AnnotationTest/VB/packages.config
  17. 11 20
      Demo/Examples/Samples/BackgroundTest/CS/BackgroundTest.cs
  18. 6 0
      Demo/Examples/Samples/BackgroundTest/VB/App.config
  19. 147 0
      Demo/Examples/Samples/BackgroundTest/VB/BackgroundTest.vb
  20. 155 0
      Demo/Examples/Samples/BackgroundTest/VB/BackgroundTest.vbproj
  21. BIN
      Demo/Examples/Samples/BackgroundTest/VB/ComPDFKit_Logo.ico
  22. 13 0
      Demo/Examples/Samples/BackgroundTest/VB/My Project/Application.Designer.vb
  23. 10 0
      Demo/Examples/Samples/BackgroundTest/VB/My Project/Application.myapp
  24. 35 0
      Demo/Examples/Samples/BackgroundTest/VB/My Project/AssemblyInfo.vb
  25. 62 0
      Demo/Examples/Samples/BackgroundTest/VB/My Project/Resources.Designer.vb
  26. 117 0
      Demo/Examples/Samples/BackgroundTest/VB/My Project/Resources.resx
  27. 73 0
      Demo/Examples/Samples/BackgroundTest/VB/My Project/Settings.Designer.vb
  28. 7 0
      Demo/Examples/Samples/BackgroundTest/VB/My Project/Settings.settings
  29. 4 0
      Demo/Examples/Samples/BackgroundTest/VB/packages.config
  30. 5 16
      Demo/Examples/Samples/BatesTest/CS/BatesTest.cs
  31. 6 0
      Demo/Examples/Samples/BatesTest/VB/App.config
  32. 145 0
      Demo/Examples/Samples/BatesTest/VB/BatesTest.vb
  33. 143 0
      Demo/Examples/Samples/BatesTest/VB/BatesTest.vbproj
  34. 13 0
      Demo/Examples/Samples/BatesTest/VB/My Project/Application.Designer.vb
  35. 10 0
      Demo/Examples/Samples/BatesTest/VB/My Project/Application.myapp
  36. 35 0
      Demo/Examples/Samples/BatesTest/VB/My Project/AssemblyInfo.vb
  37. 62 0
      Demo/Examples/Samples/BatesTest/VB/My Project/Resources.Designer.vb
  38. 117 0
      Demo/Examples/Samples/BatesTest/VB/My Project/Resources.resx
  39. 73 0
      Demo/Examples/Samples/BatesTest/VB/My Project/Settings.Designer.vb
  40. 7 0
      Demo/Examples/Samples/BatesTest/VB/My Project/Settings.settings
  41. 4 0
      Demo/Examples/Samples/BatesTest/VB/packages.config
  42. 7 5
      Demo/Examples/Samples/BookmarkTest/CS/BookmarkTest.cs
  43. 6 0
      Demo/Examples/Samples/BookmarkTest/VB/App.config
  44. 151 0
      Demo/Examples/Samples/BookmarkTest/VB/BookmarkTest.vb
  45. 143 0
      Demo/Examples/Samples/BookmarkTest/VB/BookmarkTest.vbproj
  46. 13 0
      Demo/Examples/Samples/BookmarkTest/VB/My Project/Application.Designer.vb
  47. 10 0
      Demo/Examples/Samples/BookmarkTest/VB/My Project/Application.myapp
  48. 35 0
      Demo/Examples/Samples/BookmarkTest/VB/My Project/AssemblyInfo.vb
  49. 62 0
      Demo/Examples/Samples/BookmarkTest/VB/My Project/Resources.Designer.vb
  50. 117 0
      Demo/Examples/Samples/BookmarkTest/VB/My Project/Resources.resx
  51. 73 0
      Demo/Examples/Samples/BookmarkTest/VB/My Project/Settings.Designer.vb
  52. 7 0
      Demo/Examples/Samples/BookmarkTest/VB/My Project/Settings.settings
  53. 4 0
      Demo/Examples/Samples/BookmarkTest/VB/packages.config
  54. 22 11
      Demo/Examples/Samples/DigitalSignatureTest/CS/DigitalSignatureTest.cs
  55. 6 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/App.config
  56. BIN
      Demo/Examples/Samples/DigitalSignatureTest/VB/Certificate.pfx
  57. BIN
      Demo/Examples/Samples/DigitalSignatureTest/VB/ComPDFKit_Logo.ico
  58. 316 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/DigitalSignatureTest.vb
  59. 153 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/DigitalSignatureTest.vbproj
  60. BIN
      Demo/Examples/Samples/DigitalSignatureTest/VB/Logo.png
  61. 13 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Application.Designer.vb
  62. 10 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Application.myapp
  63. 35 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/AssemblyInfo.vb
  64. 62 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Resources.Designer.vb
  65. 117 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Resources.resx
  66. 73 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Settings.Designer.vb
  67. 7 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Settings.settings
  68. 4 0
      Demo/Examples/Samples/DigitalSignatureTest/VB/packages.config

+ 83 - 0
Demo/Examples/Examlpes.sln

@@ -76,6 +76,7 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WatermarkTest", "Samples\Wa
 EndProject
 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AnnotationImportExportTest", "Samples\AnnotationImportExportTest\VB\AnnotationImportExportTest.vbproj", "{FFBD38E6-2CAE-4A9F-9E51-2A3CEFD82A0D}"
 EndProject
+<<<<<<< Updated upstream
 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TextSearchTest", "Samples\TextSearchTest\VB\TextSearchTest.vbproj", "{72F0E73F-C5E7-4059-AE51-D285221A79F6}"
 EndProject
 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TextExtractTest", "Samples\TextExtractTest\VB\TextExtractTest.vbproj", "{9E580A41-AD4F-4106-AA50-EFDB46DEA40A}"
@@ -103,6 +104,17 @@ EndProject
 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DocumentInfoTest", "Samples\DocumentInfoTest\VB\DocumentInfoTest.vbproj", "{9E6E96F8-C900-4374-A7A3-93481F733379}"
 EndProject
 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DocumentCompareTest", "Samples\DocumentCompare\VB\DocumentCompareTest.vbproj", "{F22C3E06-1B62-4516-AFC8-11F9B706206D}"
+=======
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AnnotationTest", "Samples\AnnotationTest\VB\AnnotationTest.vbproj", "{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}"
+EndProject
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BackgroundTest", "Samples\BackgroundTest\VB\BackgroundTest.vbproj", "{481B43E1-2183-4B34-8994-FFF58EA3B108}"
+EndProject
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BatesTest", "Samples\BatesTest\VB\BatesTest.vbproj", "{8FE5F6A4-92B5-4041-B659-50C032EBB965}"
+EndProject
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BookmarkTest", "Samples\BookmarkTest\VB\BookmarkTest.vbproj", "{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}"
+EndProject
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DigitalSignatureTest", "Samples\DigitalSignatureTest\VB\DigitalSignatureTest.vbproj", "{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}"
+>>>>>>> Stashed changes
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -484,6 +496,7 @@ Global
 		{FFBD38E6-2CAE-4A9F-9E51-2A3CEFD82A0D}.Release|x64.Build.0 = Release|Any CPU
 		{FFBD38E6-2CAE-4A9F-9E51-2A3CEFD82A0D}.Release|x86.ActiveCfg = Release|Any CPU
 		{FFBD38E6-2CAE-4A9F-9E51-2A3CEFD82A0D}.Release|x86.Build.0 = Release|Any CPU
+<<<<<<< Updated upstream
 		{72F0E73F-C5E7-4059-AE51-D285221A79F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{72F0E73F-C5E7-4059-AE51-D285221A79F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{72F0E73F-C5E7-4059-AE51-D285221A79F6}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -652,6 +665,68 @@ Global
 		{F22C3E06-1B62-4516-AFC8-11F9B706206D}.Release|x64.Build.0 = Release|Any CPU
 		{F22C3E06-1B62-4516-AFC8-11F9B706206D}.Release|x86.ActiveCfg = Release|Any CPU
 		{F22C3E06-1B62-4516-AFC8-11F9B706206D}.Release|x86.Build.0 = Release|Any CPU
+=======
+>>>>>>> Stashed changes
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Debug|x64.Build.0 = Debug|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Debug|x86.Build.0 = Debug|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Release|x64.ActiveCfg = Release|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Release|x64.Build.0 = Release|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Release|x86.ActiveCfg = Release|Any CPU
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}.Release|x86.Build.0 = Release|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Debug|x64.Build.0 = Debug|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Debug|x86.Build.0 = Debug|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Release|Any CPU.Build.0 = Release|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Release|x64.ActiveCfg = Release|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Release|x64.Build.0 = Release|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Release|x86.ActiveCfg = Release|Any CPU
+		{481B43E1-2183-4B34-8994-FFF58EA3B108}.Release|x86.Build.0 = Release|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Debug|x64.Build.0 = Debug|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Debug|x86.Build.0 = Debug|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Release|x64.ActiveCfg = Release|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Release|x64.Build.0 = Release|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Release|x86.ActiveCfg = Release|Any CPU
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965}.Release|x86.Build.0 = Release|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Debug|x64.Build.0 = Debug|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Debug|x86.Build.0 = Debug|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Release|x64.ActiveCfg = Release|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Release|x64.Build.0 = Release|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Release|x86.ActiveCfg = Release|Any CPU
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}.Release|x86.Build.0 = Release|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Debug|x64.Build.0 = Debug|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Debug|x86.Build.0 = Debug|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Release|Any CPU.Build.0 = Release|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Release|x64.ActiveCfg = Release|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Release|x64.Build.0 = Release|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Release|x86.ActiveCfg = Release|Any CPU
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -682,6 +757,7 @@ Global
 		{0B9A4542-3DFF-4862-973C-12308CBB2FAA} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
 		{0A17E1EE-3912-491F-A9DB-E5F72B36938D} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
 		{FFBD38E6-2CAE-4A9F-9E51-2A3CEFD82A0D} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
+<<<<<<< Updated upstream
 		{72F0E73F-C5E7-4059-AE51-D285221A79F6} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
 		{9E580A41-AD4F-4106-AA50-EFDB46DEA40A} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
 		{6D1DE0A5-8E7D-403E-8470-F72BB06FD35A} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
@@ -696,6 +772,13 @@ Global
 		{36760764-DC79-4857-8500-9BD7CF77101E} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
 		{9E6E96F8-C900-4374-A7A3-93481F733379} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
 		{F22C3E06-1B62-4516-AFC8-11F9B706206D} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
+=======
+>>>>>>> Stashed changes
+		{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
+		{481B43E1-2183-4B34-8994-FFF58EA3B108} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
+		{8FE5F6A4-92B5-4041-B659-50C032EBB965} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
+		{D922B3BB-3823-4506-BC8B-7C682B7F8AB9} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
+		{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE} = {0B9A4542-3DFF-4862-973C-12308CBB2FAA}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {8EE774F1-5FBF-482A-9A31-5ABDEC216DEF}

+ 7 - 13
Demo/Examples/Samples/AnnotationImportExportTest/CS/AnnotationImportExportTest.cs

@@ -6,13 +6,14 @@ namespace AnnotationImportExportTest
 {
     internal class AnnotationImportExportTest
     {
-        private static string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + @"\Output\CS";
-        private static string tempPath = outputPath + @"\temp";
+        static private string parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())));
+        static private string outputPath = Path.Combine(parentPath, "Output", "CS");
+        private static string tempPath = Path.Combine(outputPath, "temp");
 
         static void Main(string[] args)
         {
 
-            Console.WriteLine("Running header and footer test sample…\r\n");
+            Console.WriteLine("Running header and footer test sample…" + Environment.NewLine);
 
             #region Preparation work
 
@@ -36,10 +37,6 @@ namespace AnnotationImportExportTest
             {
                 Console.WriteLine("Export annotaiton done.");
             }
-            else
-            {
-                Console.WriteLine("Export annotaiton failed.");
-            } 
             Console.WriteLine("--------------------");
             
             #endregion
@@ -51,10 +48,7 @@ namespace AnnotationImportExportTest
             {
                 Console.WriteLine("Import annotaiton done.");
             }
-            else
-            {
-                Console.WriteLine("Import annotaiton failed.");
-            }
+
             Console.WriteLine("--------------------");
             
             #endregion
@@ -74,7 +68,7 @@ namespace AnnotationImportExportTest
         /// <returns></returns>
         static private bool ExportAnnotaiton(CPDFDocument document)
         {
-            var path = outputPath + @"\ExportAnnotationTest.xfdf";
+            var path = Path.Combine(outputPath, "ExportAnnotationTest.xfdf");
             if (!document.ExportAnnotationToXFDFPath(path, tempPath))
             {
                 return false;
@@ -94,7 +88,7 @@ namespace AnnotationImportExportTest
         /// <returns></returns>
         static private bool ImportAnnotaiton(CPDFDocument document)
         {
-            var path = outputPath + @"\ImportAnnotationTest.pdf";
+            var path = Path.Combine(outputPath, "ImportAnnotationTest.pdf");
 
             if (!document.ImportAnnotationFromXFDFPath("Annotations.xfdf", tempPath))
             {

+ 11 - 16
Demo/Examples/Samples/AnnotationImportExportTest/VB/AnnotationImportExport.vb

@@ -2,16 +2,15 @@
 Imports System
 Imports System.IO
 
-
-Module AnnotationImportExport
+Module AnnotationImportExportTest
     Private parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())))
     Private outputPath As String = Path.Combine(parentPath, "Output", "VB")
-    Private tempPath As String = outputPath & "\temp"
-    Sub Main()
-        Dim result As Boolean = SDKLicenseHelper.LicenseVerify()
-        Console.WriteLine("Running header and footer test sample…" & vbCrLf)
+    Private tempPath As String = Path.Combine(outputPath, "temp")
 
+    Sub Main()
         ' Preparation work
+        Console.WriteLine("Running header and footer test sample…" & Environment.NewLine)
+
         SDKLicenseHelper.LicenseVerify()
 
         If Not Directory.Exists(outputPath) Then
@@ -26,8 +25,6 @@ Module AnnotationImportExport
 
         If ExportAnnotation(annotationsDocument) Then
             Console.WriteLine("Export annotation done.")
-        Else
-            Console.WriteLine("Export annotation failed.")
         End If
 
         Console.WriteLine("--------------------")
@@ -37,8 +34,6 @@ Module AnnotationImportExport
 
         If ImportAnnotation(document) Then
             Console.WriteLine("Import annotation done.")
-        Else
-            Console.WriteLine("Import annotation failed.")
         End If
 
         Console.WriteLine("--------------------")
@@ -50,25 +45,25 @@ Module AnnotationImportExport
 
     ' Export the annotations in the document to XFDF format
     Private Function ExportAnnotation(document As CPDFDocument) As Boolean
-        Dim path As String = outputPath & "\ExportAnnotationTest.xfdf"
-        If Not document.ExportAnnotationToXFDFPath(path, tempPath) Then
+        Dim filePath As String = Path.Combine(outputPath, "\ExportAnnotationTest.xfdf")
+        If Not document.ExportAnnotationToXFDFPath(filePath, tempPath) Then
             Return False
         End If
-        Console.WriteLine("Xfdf file in " & path)
+        Console.WriteLine("Xfdf file in " & filePath)
         Return True
     End Function
 
     ' Importing XFDF into the document
     Private Function ImportAnnotation(document As CPDFDocument) As Boolean
-        Dim path As String = outputPath & "\ImportAnnotationTest.pdf"
+        Dim filePath As String = Path.Combine(outputPath, "\ImportAnnotationTest.pdf")
 
         If Not document.ImportAnnotationFromXFDFPath("Annotations.xfdf", tempPath) Then
             Return False
         End If
-        If Not document.WriteToFilePath(path) Then
+        If Not document.WriteToFilePath(filePath) Then
             Return False
         End If
-        Console.WriteLine("Browse the changed file in " & path)
+        Console.WriteLine("Browse the changed file in " & filePath)
         Return True
     End Function
 

+ 2 - 2
Demo/Examples/Samples/AnnotationImportExportTest/VB/AnnotationImportExportTest.vbproj

@@ -6,7 +6,7 @@
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{FFBD38E6-2CAE-4A9F-9E51-2A3CEFD82A0D}</ProjectGuid>
     <OutputType>Exe</OutputType>
-    <StartupObject>AnnotationImportExportTest.AnnotationImportExport</StartupObject>
+    <StartupObject>AnnotationImportExportTest.AnnotationImportExportTest</StartupObject>
     <RootNamespace>AnnotationImportExportTest</RootNamespace>
     <AssemblyName>Samples_ComPDFKit</AssemblyName>
     <FileAlignment>512</FileAlignment>
@@ -80,7 +80,7 @@
     <Compile Include="..\..\LicenseKey.vb">
       <Link>LicenseKey.vb</Link>
     </Compile>
-    <Compile Include="AnnotationImportExport.vb" />
+    <Compile Include="AnnotationImportExportTest.vb" />
     <Compile Include="My Project\AssemblyInfo.vb" />
     <Compile Include="My Project\Application.Designer.vb">
       <AutoGen>True</AutoGen>

+ 19 - 13
Demo/Examples/Samples/AnnotationTest/CS/AnnotationTest.cs

@@ -13,11 +13,14 @@ namespace AnnotationTest
 {
     internal class AnnotationTest
     {
-        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Annotations";
+        static private string parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())));
+        static private string outputPath = Path.Combine(parentPath, "Output", "CS");
 
         static void Main(string[] args)
         {
-            Console.WriteLine("Running Annotation test sample…\r\n");
+            #region Preparation work
+
+            Console.WriteLine("Running Annotation test sample…" + Environment.NewLine);
             SDKLicenseHelper.LicenseVerify();
             CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             if (!Directory.Exists(outputPath))
@@ -25,27 +28,30 @@ namespace AnnotationTest
                 Directory.CreateDirectory(outputPath);
             }
 
+            #endregion
+
+            #region Sample 1: Create annotations
+            
             if (CreateAnnots(document))
             {
                 Console.WriteLine("Create annots done.");
             }
-            else
-            {
-                Console.WriteLine("Create annots failed.");
-            }
             Console.WriteLine("--------------------");
 
+            #endregion
+
+            #region Sample 2: Delete annotations
+
             CPDFDocument annotsDocument = CPDFDocument.InitWithFilePath("Annotations.pdf");
             if (DeleteAnnotations(annotsDocument))
             {
                 Console.WriteLine("Create annots done.");
-            }
-            else
-            {
-                Console.WriteLine("Create annots failed.");
-            }
+            } 
 
             Console.WriteLine("--------------------");
+
+            #endregion
+
             Console.WriteLine("Done");
             Console.WriteLine("--------------------");
 
@@ -288,7 +294,7 @@ namespace AnnotationTest
             CreateSoundAnnotation(document);
             CreateMarkupAnnotation(document);
             CreateStampAnnotation(document);
-            string path = outputPath + "\\CreateAnnotsTest.pdf";
+            string path = Path.Combine(outputPath, "CreateAnnotsTest.pdf");
             if (!document.WriteToFilePath(path))
             {
                 return false;
@@ -314,7 +320,7 @@ namespace AnnotationTest
                 return false;
             }
 
-            string path = outputPath + "\\DeleteAnnotsTest.pdf"; 
+            string path = Path.Combine(outputPath , "DeleteAnnotsTest.pdf"); 
             if (!document.WriteToFilePath(path))
             {
                 return false;

+ 258 - 0
Demo/Examples/Samples/AnnotationTest/VB/AnnotationTest.vb

@@ -0,0 +1,258 @@
+Imports System.IO
+Imports ComPDFKit.PDFDocument
+Imports ComPDFKit.PDFPage
+Imports ComPDFKit.PDFAnnotation
+Imports ComPDFKit.Import
+Imports System.Runtime.InteropServices
+Imports System.Drawing
+Imports System.Drawing.Imaging
+
+Module AnnotationTest
+    Private parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())))
+    Private outputPath As String = Path.Combine(parentPath, "Output", "VB")
+
+    Sub Main()
+        ' Preparation work
+        SDKLicenseHelper.LicenseVerify()
+
+        If Not Directory.Exists(outputPath) Then
+            Directory.CreateDirectory(outputPath)
+        End If
+        Dim document As CPDFDocument = CPDFDocument.InitWithFilePath("CommonFivePage.pdf")
+        ' Sample 1: Create annotations
+        If CreateAnnots(document) Then
+            Console.WriteLine("Create annots done.")
+        End If
+        Console.WriteLine("--------------------")
+
+        ' Sample 2: Delete annotations
+        Dim annotsDocument As CPDFDocument = CPDFDocument.InitWithFilePath("Annotations.pdf")
+        If DeleteAnnotations(annotsDocument) Then
+            Console.WriteLine("Delete annots done.")
+        End If
+
+        Console.WriteLine("--------------------")
+
+        Console.WriteLine("Done")
+        Console.WriteLine("--------------------")
+
+        Console.ReadLine()
+
+
+    End Sub
+
+    Private Sub CreateFreetextAnnotation(document As CPDFDocument)
+        Dim page As CPDFPage = document.PageAtIndex(0)
+        Dim str As String = "ComPDFKit Samples"
+        Dim freeText As CPDFFreeTextAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_FREETEXT), CPDFFreeTextAnnotation)
+        freeText.SetContent(str)
+        freeText.SetRect(New CRect(0, 100, 160, 0))
+        Dim textAttribute As New CTextAttribute()
+        textAttribute.FontName = "Helvetica"
+        textAttribute.FontSize = 12
+        Dim fontColor As Byte() = {255, 0, 0}
+        textAttribute.FontColor = fontColor
+        freeText.SetFreetextDa(textAttribute)
+        freeText.SetFreetextAlignment(C_TEXT_ALIGNMENT.ALIGNMENT_CENTER)
+        freeText.UpdateAp()
+    End Sub
+
+    Private Sub CreateFreehandAnnotation(document As CPDFDocument)
+        Dim page As CPDFPage = document.PageAtIndex(0)
+        Dim ink As CPDFInkAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_INK), CPDFInkAnnotation)
+        ink.SetInkColor(New Byte() {255, 0, 0})
+        ink.SetBorderWidth(2)
+        ink.SetTransparency(128)
+
+        Dim points As New List(Of List(Of CPoint))()
+
+        ink.SetInkPath(points)
+        ink.SetThickness(8)
+
+        points.Clear()
+        points.Add(New List(Of CPoint)() From
+    {
+        New CPoint(10, 100),
+        New CPoint(100, 10)
+    })
+
+        ink.SetInkPath(points)
+        ink.SetInkRect(New CRect(10, 10, 200, 200))
+
+        ink.UpdateAp()
+    End Sub
+
+    Private Sub CreateShapeAnnotation(document As CPDFDocument)
+        Dim page As CPDFPage = document.PageAtIndex(0)
+        Dim dashArray As Single() = {2.0F, 1.0F}
+        Dim lineColor As Byte() = {255, 0, 0}
+        Dim bgColor As Byte() = {0, 255, 0}
+
+        ' Square
+        Dim square As CPDFSquareAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE), CPDFSquareAnnotation)
+        square.SetRect(New CRect(10, 250, 200, 200))
+        square.SetLineColor(lineColor)
+        square.SetBgColor(bgColor)
+        square.SetTransparency(120)
+        square.SetLineWidth(1)
+        square.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, dashArray)
+        square.UpdateAp()
+
+        ' Circle
+        Dim circle As CPDFCircleAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE), CPDFCircleAnnotation)
+        circle.SetRect(New CRect(10, 300, 110, 410))
+        circle.SetLineColor(lineColor)
+        circle.SetBgColor(bgColor)
+        circle.SetTransparency(120)
+        circle.SetLineWidth(1)
+        circle.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, dashArray)
+        circle.UpdateAp()
+
+        ' Line
+        Dim line As CPDFLineAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_LINE), CPDFLineAnnotation)
+        line.SetLinePoints(New CPoint(300, 300), New CPoint(350, 350))
+        line.SetLineType(C_LINE_TYPE.LINETYPE_NONE, C_LINE_TYPE.LINETYPE_CLOSEDARROW)
+        line.SetLineColor(lineColor)
+        line.SetTransparency(120)
+        line.SetLineWidth(1)
+        line.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, dashArray)
+        line.UpdateAp()
+    End Sub
+
+    Private Sub CreateNoteAnnotation(document As CPDFDocument)
+        Dim page As CPDFPage = document.PageAtIndex(0)
+        Dim textAnnotation As CPDFTextAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_TEXT), CPDFTextAnnotation)
+        textAnnotation.SetColor(New Byte() {255, 0, 0})
+        textAnnotation.SetTransparency(255)
+        textAnnotation.SetContent("ComPDFKit")
+        textAnnotation.SetRect(New CRect(300, 600, 350, 650))
+        textAnnotation.UpdateAp()
+    End Sub
+    Private Sub CreateSoundAnnotation(document As CPDFDocument)
+        Dim page As CPDFPage = document.PageAtIndex(0)
+        Dim sound As CPDFSoundAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_SOUND), CPDFSoundAnnotation)
+        sound.SetRect(New CRect(400, 700, 450, 750))
+        sound.SetSoundPath("Bird.wav")
+        sound.UpdateAp()
+    End Sub
+
+    Private Sub CreateMarkupAnnotation(document As CPDFDocument)
+        Dim cRectList As New List(Of CRect)()
+        Dim rect As New CRect(300, 240, 400, 300)
+        cRectList.Add(rect)
+        Dim color As Byte() = {255, 0, 0}
+
+        ' Highlight
+        Dim page1 As CPDFPage = document.PageAtIndex(0)
+        Dim highlight As CPDFHighlightAnnotation = TryCast(page1.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT), CPDFHighlightAnnotation)
+        highlight.SetColor(color)
+        highlight.SetTransparency(120)
+        highlight.SetQuardRects(cRectList)
+        highlight.UpdateAp()
+
+        ' Underline
+        Dim page2 As CPDFPage = document.PageAtIndex(1)
+        Dim underline As CPDFUnderlineAnnotation = TryCast(page2.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE), CPDFUnderlineAnnotation)
+        underline.SetColor(color)
+        underline.SetTransparency(120)
+        underline.SetQuardRects(cRectList)
+        underline.UpdateAp()
+
+        ' Strikeout
+        Dim page3 As CPDFPage = document.PageAtIndex(2)
+        Dim strikeout As CPDFStrikeoutAnnotation = TryCast(page3.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT), CPDFStrikeoutAnnotation)
+        strikeout.SetColor(color)
+        strikeout.SetTransparency(120)
+        strikeout.SetQuardRects(cRectList)
+        strikeout.UpdateAp()
+
+        ' Squiggly
+        Dim page4 As CPDFPage = document.PageAtIndex(3)
+        Dim squiggy As CPDFSquigglyAnnotation = TryCast(page4.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY), CPDFSquigglyAnnotation)
+        squiggy.SetColor(color)
+        squiggy.SetTransparency(120)
+        squiggy.SetQuardRects(cRectList)
+        squiggy.UpdateAp()
+    End Sub
+
+    Public Function BitmapToByteArray(bitmap As Bitmap) As Byte()
+        Dim bmpdata As BitmapData = Nothing
+
+        Try
+            bmpdata = bitmap.LockBits(New Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, bitmap.PixelFormat)
+            Dim numbytes As Integer = bmpdata.Stride * bitmap.Height
+            Dim bytedata As Byte() = New Byte(numbytes - 1) {}
+            Dim ptr As IntPtr = bmpdata.Scan0
+
+            Marshal.Copy(ptr, bytedata, 0, numbytes)
+
+            Return bytedata
+        Finally
+            If bmpdata IsNot Nothing Then
+                bitmap.UnlockBits(bmpdata)
+            End If
+        End Try
+    End Function
+
+    Private Sub CreateStampAnnotation(document As CPDFDocument)
+        Dim page As CPDFPage = document.PageAtIndex(0)
+
+        ' Standard
+        Dim standard As CPDFStampAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP), CPDFStampAnnotation)
+        standard.SetStandardStamp("Approved")
+        standard.SetRect(New CRect(300, 100, 450, 160))
+        standard.UpdateAp()
+
+        ' Text
+        Dim text As CPDFStampAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP), CPDFStampAnnotation)
+        text.SetTextStamp("test", "detail text", C_TEXTSTAMP_SHAPE.TEXTSTAMP_LEFT_TRIANGLE, C_TEXTSTAMP_COLOR.TEXTSTAMP_RED)
+        text.SetRect(New CRect(300, 220, 450, 300))
+        text.UpdateAp()
+
+        ' Image
+        Dim bitmap As New Bitmap("logo.png")
+        Dim image As CPDFStampAnnotation = TryCast(page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP), CPDFStampAnnotation)
+        image.SetImageStamp(BitmapToByteArray(bitmap), bitmap.Width, bitmap.Height)
+        image.SetRect(New CRect(300, 320, 380, 400))
+        image.SetTransparency(255)
+        image.UpdateAp()
+    End Sub
+
+    Private Function CreateAnnots(document As CPDFDocument) As Boolean
+        CreateFreetextAnnotation(document)
+        CreateFreehandAnnotation(document)
+        CreateShapeAnnotation(document)
+        CreateNoteAnnotation(document)
+        CreateShapeAnnotation(document)
+        CreateSoundAnnotation(document)
+        CreateMarkupAnnotation(document)
+        CreateStampAnnotation(document)
+        Dim path As String = outputPath & "\CreateAnnotsTest.pdf"
+        If Not document.WriteToFilePath(path) Then
+            Return False
+        End If
+        Console.WriteLine("Browse the changed file in " & path)
+        Return True
+    End Function
+
+    Private Function DeleteAnnotations(document As CPDFDocument) As Boolean
+        Dim page As CPDFPage = document.PageAtIndex(0)
+
+        Dim annotList As List(Of CPDFAnnotation) = page.GetAnnotations()
+        Dim annotNum = annotList.Count
+
+        If Not annotList(0).RemoveAnnot() Then
+            Return False
+        End If
+
+        Dim path As String = outputPath & "\DeleteAnnotsTest.pdf"
+        If Not document.WriteToFilePath(path) Then
+            Return False
+        End If
+        Console.WriteLine("Browse the changed file in " & path)
+
+        Return True
+    End Function
+
+
+End Module

+ 156 - 0
Demo/Examples/Samples/AnnotationTest/VB/AnnotationTest.vbproj

@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{AAE10F2E-F7B0-4487-BEDE-274CE74CA55E}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <StartupObject>VB.AnnotationTest</StartupObject>
+    <RootNamespace>VB</RootNamespace>
+    <AssemblyName>Samples_ComPDFKit</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <MyType>Console</MyType>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <DefineDebug>true</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DocumentationFile>Samples_ComPDFKit.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <DefineDebug>false</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DocumentationFile>Samples_ComPDFKit.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionExplicit>On</OptionExplicit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionCompare>Binary</OptionCompare>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionStrict>Off</OptionStrict>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionInfer>On</OptionInfer>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+  </ItemGroup>
+  <ItemGroup>
+    <Import Include="Microsoft.VisualBasic" />
+    <Import Include="System" />
+    <Import Include="System.Collections" />
+    <Import Include="System.Collections.Generic" />
+    <Import Include="System.Data" />
+    <Import Include="System.Diagnostics" />
+    <Import Include="System.Linq" />
+    <Import Include="System.Xml.Linq" />
+    <Import Include="System.Threading.Tasks" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\..\LicenseKey.vb">
+      <Link>LicenseKey.vb</Link>
+    </Compile>
+    <Compile Include="AnnotationTest.vb" />
+    <Compile Include="My Project\AssemblyInfo.vb" />
+    <Compile Include="My Project\Application.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Application.myapp</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Resources.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Settings.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="My Project\Resources.resx">
+      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
+      <CustomToolNamespace>My.Resources</CustomToolNamespace>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\TestFile\Annotations.pdf">
+      <Link>Annotations.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="My Project\Application.myapp">
+      <Generator>MyApplicationCodeGenerator</Generator>
+      <LastGenOutput>Application.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="My Project\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <CustomToolNamespace>My</CustomToolNamespace>
+      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\TestFile\Bird.wav">
+      <Link>Bird.wav</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\TestFile\logo.png">
+      <Link>logo.png</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+  <Import Project="..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

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

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

+ 13 - 0
Demo/Examples/Samples/AnnotationTest/VB/My Project/Application.Designer.vb

@@ -0,0 +1,13 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+

+ 10 - 0
Demo/Examples/Samples/AnnotationTest/VB/My Project/Application.myapp

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <MySubMain>false</MySubMain>
+  <SingleInstance>false</SingleInstance>
+  <ShutdownMode>0</ShutdownMode>
+  <EnableVisualStyles>true</EnableVisualStyles>
+  <AuthenticationMode>0</AuthenticationMode>
+  <ApplicationType>2</ApplicationType>
+  <SaveMySettingsOnExit>true</SaveMySettingsOnExit>
+</MyApplicationData>

+ 35 - 0
Demo/Examples/Samples/AnnotationTest/VB/My Project/AssemblyInfo.vb

@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("VB")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("")>
+<Assembly: AssemblyProduct("VB")>
+<Assembly: AssemblyCopyright("Copyright ©  2023")>
+<Assembly: AssemblyTrademark("")>
+
+<Assembly: ComVisible(False)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("662816a6-43d6-478f-a540-3b7fefa7f231")>
+
+' Version information for an assembly consists of the following four values:
+'
+'      Major Version
+'      Minor Version
+'      Build Number
+'      Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+' <Assembly: AssemblyVersion("1.0.*")>
+
+<Assembly: AssemblyVersion("1.0.0.0")>
+<Assembly: AssemblyFileVersion("1.0.0.0")>

+ 62 - 0
Demo/Examples/Samples/AnnotationTest/VB/My Project/Resources.Designer.vb

@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+    'This class was auto-generated by the StronglyTypedResourceBuilder
+    'class via a tool like ResGen or Visual Studio.
+    'To add or remove a member, edit your .ResX file then rerun ResGen
+    'with the /str option, or rebuild your VS project.
+    '''<summary>
+    '''  A strongly-typed resource class, for looking up localized strings, etc.
+    '''</summary>
+    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+    Friend Module Resources
+
+        Private resourceMan As Global.System.Resources.ResourceManager
+
+        Private resourceCulture As Global.System.Globalization.CultureInfo
+
+        '''<summary>
+        '''  Returns the cached ResourceManager instance used by this class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+            Get
+                If Object.ReferenceEquals(resourceMan, Nothing) Then
+                    Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VB.Resources", GetType(Resources).Assembly)
+                    resourceMan = temp
+                End If
+                Return resourceMan
+            End Get
+        End Property
+
+        '''<summary>
+        '''  Overrides the current thread's CurrentUICulture property for all
+        '''  resource lookups using this strongly typed resource class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend Property Culture() As Global.System.Globalization.CultureInfo
+            Get
+                Return resourceCulture
+            End Get
+            Set(ByVal value As Global.System.Globalization.CultureInfo)
+                resourceCulture = value
+            End Set
+        End Property
+    End Module
+End Namespace

+ 117 - 0
Demo/Examples/Samples/AnnotationTest/VB/My Project/Resources.resx

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

+ 73 - 0
Demo/Examples/Samples/AnnotationTest/VB/My Project/Settings.Designer.vb

@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+    <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
+     Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+    Partial Friend NotInheritable Class MySettings
+        Inherits Global.System.Configuration.ApplicationSettingsBase
+
+        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+        Private Shared addedHandler As Boolean
+
+        Private Shared addedHandlerLockObject As New Object
+
+        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+            If My.Application.SaveMySettingsOnExit Then
+                My.Settings.Save()
+            End If
+        End Sub
+#End If
+#End Region
+
+        Public Shared ReadOnly Property [Default]() As MySettings
+            Get
+
+#If _MyType = "WindowsForms" Then
+                   If Not addedHandler Then
+                        SyncLock addedHandlerLockObject
+                            If Not addedHandler Then
+                                AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+                                addedHandler = True
+                            End If
+                        End SyncLock
+                    End If
+#End If
+                Return defaultInstance
+            End Get
+        End Property
+    End Class
+End Namespace
+
+Namespace My
+
+    <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
+    Friend Module MySettingsProperty
+
+        <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
+        Friend ReadOnly Property Settings() As Global.VB.My.MySettings
+            Get
+                Return Global.VB.My.MySettings.Default
+            End Get
+        End Property
+    End Module
+End Namespace

+ 7 - 0
Demo/Examples/Samples/AnnotationTest/VB/My Project/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

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

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

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 11 - 20
Demo/Examples/Samples/BackgroundTest/CS/BackgroundTest.cs


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

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

+ 147 - 0
Demo/Examples/Samples/BackgroundTest/VB/BackgroundTest.vb

@@ -0,0 +1,147 @@
+Imports System.IO
+Imports ComPDFKit.PDFDocument
+Imports System.Runtime.InteropServices
+Imports System.Drawing
+Imports System.Drawing.Imaging
+
+Module BackgroundTest
+    Private parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())))
+    Private outputPath As String = Path.Combine(parentPath, "Output", "VB")
+
+    Sub Main()
+        ' Preparation work
+        Console.WriteLine("Running Watermark test sample..." & Environment.NewLine)
+        SDKLicenseHelper.LicenseVerify()
+        Dim document As CPDFDocument = CPDFDocument.InitWithFilePath("CommonFivePage.pdf")
+        If Not Directory.Exists(outputPath) Then
+            Directory.CreateDirectory(outputPath)
+        End If
+
+        ' Sample 1: Add color background
+        If AddColorBackground(document) Then
+            Console.WriteLine("Add color background done.")
+        End If
+        document.Release()
+        Console.WriteLine("--------------------")
+
+        ' Sample 2: Add image background
+        document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf")
+        If AddImageBackground(document) Then
+            Console.WriteLine("Add image background done.")
+        End If
+        document.Release()
+        Console.WriteLine("--------------------")
+
+        ' Sample 3: Remove background
+        Dim colorBgDocument As CPDFDocument = CPDFDocument.InitWithFilePath("ColorBackground.pdf")
+        Dim imageBgDocument As CPDFDocument = CPDFDocument.InitWithFilePath("ImageBackground.pdf")
+
+        If RemoveBackground(colorBgDocument, imageBgDocument) Then
+            Console.WriteLine("Remove background done.")
+        End If
+        colorBgDocument.Release()
+        imageBgDocument.Release()
+        Console.WriteLine("--------------------")
+
+        Console.WriteLine("Done!")
+        Console.WriteLine("--------------------")
+        Console.ReadLine()
+    End Sub
+
+
+    ' Add color background
+    ' Parameters:
+    ' - document: Regular document
+    Private Function AddColorBackground(document As CPDFDocument) As Boolean
+        Dim background As CPDFBackground = document.GetBackground()
+        background.SetBackgroundType(C_Background_Type.BG_TYPE_COLOR)
+        background.SetColor(New Byte() {255, 0, 0})
+        background.SetOpacity(255) ' 0-255
+        background.SetScale(1) ' 1 == 100%
+        background.SetRotation(0) ' Use radians
+        background.SetHorizalign(C_Background_Horizalign.BG_HORIZALIGN_CENTER)
+        background.SetVertalign(C_Background_Vertalign.BG_VERTALIGN_CENTER)
+        background.SetXOffset(0)
+        background.SetYOffset(0)
+        background.SetPages("0-2") ' Page numbering from 0
+        background.Update() ' Note: update after setup is complete
+
+        Dim path As String = outputPath & "\AddColorBackgroundTest.pdf"
+        If Not document.WriteToFilePath(path) Then
+            Return False
+        End If
+        Console.WriteLine("Browse the changed file in " & path)
+
+        Return True
+    End Function
+
+    ' Convert the bitmap to an array that can be set as an image watermark
+    ' Parameters:
+    ' - bitmap: Image source to be used as an image watermark.
+    ' Returns: An array for setting image
+    Public Function BitmapToByteArray(bitmap As Bitmap) As Byte()
+        Dim bmpdata As BitmapData = Nothing
+
+        Try
+            bmpdata = bitmap.LockBits(New Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, bitmap.PixelFormat)
+            Dim numbytes As Integer = bmpdata.Stride * bitmap.Height
+            Dim bytedata(numbytes - 1) As Byte
+            Dim ptr As IntPtr = bmpdata.Scan0
+
+            Marshal.Copy(ptr, bytedata, 0, numbytes)
+
+            Return bytedata
+        Finally
+            If bmpdata IsNot Nothing Then
+                bitmap.UnlockBits(bmpdata)
+            End If
+        End Try
+    End Function
+
+    Private Function AddImageBackground(document As CPDFDocument) As Boolean
+        Dim background As CPDFBackground = document.GetBackground()
+        background.SetBackgroundType(C_Background_Type.BG_TYPE_IMAGE)
+        Dim bitmap As New Bitmap("logo.png")
+        background.SetImage(BitmapToByteArray(bitmap), bitmap.Width, bitmap.Height, ComPDFKit.Import.C_Scale_Type.fitCenter)
+        background.SetOpacity(128) ' 0-255
+        background.SetScale(1) ' 1 == 100%
+        background.SetRotation(1.0F) ' Use radians
+        background.SetHorizalign(C_Background_Horizalign.BG_HORIZALIGN_CENTER)
+        background.SetVertalign(C_Background_Vertalign.BG_VERTALIGN_CENTER)
+        background.SetXOffset(0)
+        background.SetYOffset(0)
+        background.SetPages("0-2") ' Page numbering from 0
+        background.Update() ' Note: update after setup is complete
+        Dim filePath As String = Path.Combine(outputPath, "AddImageBackgroundTest.pdf")
+        If Not document.WriteToFilePath(filePath) Then
+            Return False
+        End If
+        Console.WriteLine("Browse the changed file in " & filePath)
+        Return True
+    End Function
+
+    Private Function RemoveBackground(ByVal colorBgDocument As CPDFDocument, ByVal imageBgDocument As CPDFDocument) As Boolean
+        Dim colorBackground As CPDFBackground = colorBgDocument.GetBackground()
+        If colorBackground.GetBackgroundType() <> C_Background_Type.BG_TYPE_COLOR Then
+            Return False
+        End If
+
+        colorBackground.Clear()
+        Dim path1 As String = outputPath & "\ClearColorBgTest.pdf"
+        If Not colorBgDocument.WriteToFilePath(path1) Then
+            Return False
+        End If
+        Console.WriteLine("Browse the changed file in " & path1)
+
+        Dim imageBackground As CPDFBackground = imageBgDocument.GetBackground()
+        imageBackground.Clear()
+        Dim path2 As String = outputPath & "\ClearImageBgTest.pdf"
+        If Not imageBgDocument.WriteToFilePath(path2) Then
+            Return False
+        End If
+        Console.WriteLine("Browse the changed file in " & path2)
+
+        Return True
+    End Function
+
+End Module

+ 155 - 0
Demo/Examples/Samples/BackgroundTest/VB/BackgroundTest.vbproj

@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{481B43E1-2183-4B34-8994-FFF58EA3B108}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <StartupObject>VB.BackgroundTest</StartupObject>
+    <RootNamespace>VB</RootNamespace>
+    <AssemblyName>Samples_ComPDFKit</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <MyType>Console</MyType>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <DefineDebug>true</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DocumentationFile>Samples_ComPDFKit.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <DefineDebug>false</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DocumentationFile>Samples_ComPDFKit.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionExplicit>On</OptionExplicit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionCompare>Binary</OptionCompare>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionStrict>Off</OptionStrict>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionInfer>On</OptionInfer>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+  </ItemGroup>
+  <ItemGroup>
+    <Import Include="Microsoft.VisualBasic" />
+    <Import Include="System" />
+    <Import Include="System.Collections" />
+    <Import Include="System.Collections.Generic" />
+    <Import Include="System.Data" />
+    <Import Include="System.Diagnostics" />
+    <Import Include="System.Linq" />
+    <Import Include="System.Xml.Linq" />
+    <Import Include="System.Threading.Tasks" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\..\LicenseKey.vb">
+      <Link>LicenseKey.vb</Link>
+    </Compile>
+    <Compile Include="BackgroundTest.vb" />
+    <Compile Include="My Project\AssemblyInfo.vb" />
+    <Compile Include="My Project\Application.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Application.myapp</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Resources.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Settings.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="My Project\Resources.resx">
+      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
+      <CustomToolNamespace>My.Resources</CustomToolNamespace>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\TestFile\ColorBackground.pdf">
+      <Link>ColorBackground.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\..\TestFile\ImageBackground.pdf">
+      <Link>ImageBackground.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="My Project\Application.myapp">
+      <Generator>MyApplicationCodeGenerator</Generator>
+      <LastGenOutput>Application.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="My Project\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <CustomToolNamespace>My</CustomToolNamespace>
+      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\TestFile\logo.png">
+      <Link>logo.png</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <Content Include="ComPDFKit_Logo.ico" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+  <Import Project="..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

BIN
Demo/Examples/Samples/BackgroundTest/VB/ComPDFKit_Logo.ico


+ 13 - 0
Demo/Examples/Samples/BackgroundTest/VB/My Project/Application.Designer.vb

@@ -0,0 +1,13 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+

+ 10 - 0
Demo/Examples/Samples/BackgroundTest/VB/My Project/Application.myapp

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <MySubMain>false</MySubMain>
+  <SingleInstance>false</SingleInstance>
+  <ShutdownMode>0</ShutdownMode>
+  <EnableVisualStyles>true</EnableVisualStyles>
+  <AuthenticationMode>0</AuthenticationMode>
+  <ApplicationType>2</ApplicationType>
+  <SaveMySettingsOnExit>true</SaveMySettingsOnExit>
+</MyApplicationData>

+ 35 - 0
Demo/Examples/Samples/BackgroundTest/VB/My Project/AssemblyInfo.vb

@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("VB")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("")>
+<Assembly: AssemblyProduct("VB")>
+<Assembly: AssemblyCopyright("Copyright ©  2023")>
+<Assembly: AssemblyTrademark("")>
+
+<Assembly: ComVisible(False)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("a7c35725-7446-4fad-847b-e9f159bc3a42")>
+
+' Version information for an assembly consists of the following four values:
+'
+'      Major Version
+'      Minor Version
+'      Build Number
+'      Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+' <Assembly: AssemblyVersion("1.0.*")>
+
+<Assembly: AssemblyVersion("1.0.0.0")>
+<Assembly: AssemblyFileVersion("1.0.0.0")>

+ 62 - 0
Demo/Examples/Samples/BackgroundTest/VB/My Project/Resources.Designer.vb

@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+    'This class was auto-generated by the StronglyTypedResourceBuilder
+    'class via a tool like ResGen or Visual Studio.
+    'To add or remove a member, edit your .ResX file then rerun ResGen
+    'with the /str option, or rebuild your VS project.
+    '''<summary>
+    '''  A strongly-typed resource class, for looking up localized strings, etc.
+    '''</summary>
+    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+    Friend Module Resources
+
+        Private resourceMan As Global.System.Resources.ResourceManager
+
+        Private resourceCulture As Global.System.Globalization.CultureInfo
+
+        '''<summary>
+        '''  Returns the cached ResourceManager instance used by this class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+            Get
+                If Object.ReferenceEquals(resourceMan, Nothing) Then
+                    Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VB.Resources", GetType(Resources).Assembly)
+                    resourceMan = temp
+                End If
+                Return resourceMan
+            End Get
+        End Property
+
+        '''<summary>
+        '''  Overrides the current thread's CurrentUICulture property for all
+        '''  resource lookups using this strongly typed resource class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend Property Culture() As Global.System.Globalization.CultureInfo
+            Get
+                Return resourceCulture
+            End Get
+            Set(ByVal value As Global.System.Globalization.CultureInfo)
+                resourceCulture = value
+            End Set
+        End Property
+    End Module
+End Namespace

+ 117 - 0
Demo/Examples/Samples/BackgroundTest/VB/My Project/Resources.resx

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

+ 73 - 0
Demo/Examples/Samples/BackgroundTest/VB/My Project/Settings.Designer.vb

@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+    <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
+     Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+    Partial Friend NotInheritable Class MySettings
+        Inherits Global.System.Configuration.ApplicationSettingsBase
+
+        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+        Private Shared addedHandler As Boolean
+
+        Private Shared addedHandlerLockObject As New Object
+
+        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+            If My.Application.SaveMySettingsOnExit Then
+                My.Settings.Save()
+            End If
+        End Sub
+#End If
+#End Region
+
+        Public Shared ReadOnly Property [Default]() As MySettings
+            Get
+
+#If _MyType = "WindowsForms" Then
+                   If Not addedHandler Then
+                        SyncLock addedHandlerLockObject
+                            If Not addedHandler Then
+                                AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+                                addedHandler = True
+                            End If
+                        End SyncLock
+                    End If
+#End If
+                Return defaultInstance
+            End Get
+        End Property
+    End Class
+End Namespace
+
+Namespace My
+
+    <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
+    Friend Module MySettingsProperty
+
+        <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
+        Friend ReadOnly Property Settings() As Global.VB.My.MySettings
+            Get
+                Return Global.VB.My.MySettings.Default
+            End Get
+        End Property
+    End Module
+End Namespace

+ 7 - 0
Demo/Examples/Samples/BackgroundTest/VB/My Project/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

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

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

+ 5 - 16
Demo/Examples/Samples/BatesTest/CS/BatesTest.cs

@@ -7,8 +7,9 @@ namespace BatesTest
 {
     internal class BatesTest
     {
-        private static string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Bates";
-        
+        static private string parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())));
+        static private string outputPath = Path.Combine(parentPath, "Output", "CS");
+
         private static Dictionary<int, string> IntToLocationDic = new Dictionary<int, string>()
         {
             {0, "Top Left" },
@@ -40,11 +41,7 @@ namespace BatesTest
             if (AddBates(document))
             {
                 Console.WriteLine("Add bates done.");
-            }
-            else
-            {
-                Console.WriteLine("Add bates failed.");
-            }
+            } 
 
             document.Release();
 
@@ -57,11 +54,7 @@ namespace BatesTest
             if (EditBates(document))
             {
                 Console.WriteLine("Edit bates done.");
-            }
-            else
-            {
-                Console.WriteLine("Edit bates failed.");
-            }
+            } 
 
             document.Release();
 
@@ -76,10 +69,6 @@ namespace BatesTest
             {
                 Console.WriteLine("Clear bates done.");
             }
-            else
-            {
-                Console.WriteLine("Clear bates failed.");
-            }
 
             document.Release();
             Console.WriteLine("--------------------");

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

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

+ 145 - 0
Demo/Examples/Samples/BatesTest/VB/BatesTest.vb

@@ -0,0 +1,145 @@
+Imports System.IO
+Imports ComPDFKit.PDFDocument
+
+Module BatesTest
+    Private parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())))
+    Private outputPath As String = Path.Combine(parentPath, "Output", "VB")
+    Private IntToLocationDic As New Dictionary(Of Integer, String)() From
+    {
+        {0, "Top Left"},
+        {1, "Top Middle"},
+        {2, "Top Right"},
+        {3, "Bottom Left"},
+        {4, "Bottom Middle"},
+        {5, "Bottom Right"}
+    }
+
+    Sub Main()
+#Region "Preparation work"
+        Console.WriteLine("Running bates test sample..." & vbCrLf)
+        SDKLicenseHelper.LicenseVerify()
+
+        If Not Directory.Exists(outputPath) Then
+            Directory.CreateDirectory(outputPath)
+        End If
+#End Region
+
+#Region "Sample 1: Add bates"
+        Dim document As CPDFDocument = CPDFDocument.InitWithFilePath("CommonFivePage.pdf")
+
+        If AddBates(document) Then
+            Console.WriteLine("Add bates done.")
+        End If
+
+        document.Release()
+
+        Console.WriteLine("--------------------")
+#End Region
+
+#Region "Samples 2: Edit bates"
+        document = CPDFDocument.InitWithFilePath("Bates.pdf")
+
+        If EditBates(document) Then
+            Console.WriteLine("Edit bates done.")
+        End If
+
+        document.Release()
+
+        Console.WriteLine("--------------------")
+#End Region
+
+#Region "Sample 3: Clear bates"
+        document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf")
+
+        If ClearBates(document) Then
+            Console.WriteLine("Clear bates done.")
+        End If
+
+        document.Release()
+        Console.WriteLine("--------------------")
+#End Region
+
+        Console.WriteLine("Done!")
+        Console.WriteLine("--------------------")
+
+        Console.ReadLine()
+
+    End Sub
+
+    Private Function AddBates(document As CPDFDocument) As Boolean
+        Dim addBatesPath As String = outputPath & "\AddBatesTest.pdf"
+
+        Dim bates As CPDFBates = document.GetBates()
+        Dim color As Byte() = {255, 0, 0}
+
+        bates.SetPages("0-" & (document.PageCount - 1)) ' Page numbering from 0
+
+        For i As Integer = 0 To 5
+            bates.SetText(i, "<<#3#5#Prefix-#-Suffix>>") ' 3 digits, starting from 5
+            bates.SetTextColor(i, color)
+            bates.SetFontSize(i, 14)
+
+            Console.WriteLine("Text: {0}", bates.GetText(i))
+            Console.WriteLine("Location: {0}" & vbCrLf, IntToLocationDic(i))
+        Next
+
+        bates.Update()
+
+        If Not document.WriteToFilePath(addBatesPath) Then
+            Return False
+        End If
+
+        Console.WriteLine("Browse the changed file in " & addBatesPath)
+        Return True
+    End Function
+
+    Private Function EditBates(document As CPDFDocument) As Boolean
+        Dim bates As CPDFBates = document.GetBates()
+
+        ' Get the old Bates text from index 0
+        If Not String.IsNullOrEmpty(bates.GetText(0)) Then
+            Console.WriteLine("Get old Bates 0 done, text is {0}", bates.GetText(0))
+        Else
+            Console.WriteLine("Get Bates 0 failed, or it does not exist")
+            Return False
+        End If
+
+        ' Edit the Bates text at index 0
+        bates.SetText(0, "<<#3#1#ComPDFKit-#-ComPDFKit>>")
+
+        ' Update the Bates text
+        bates.Update()
+
+        Console.WriteLine("Change Bates 0 done, new text is {0}", bates.GetText(0))
+
+        Dim editBatesPath As String = outputPath & "\EditBatesTest.pdf"
+
+        If document.WriteToFilePath(editBatesPath) Then
+            Console.WriteLine("Browse the changed file in " & editBatesPath)
+            Return True
+        Else
+            Return False
+        End If
+    End Function
+
+    ''' <summary>
+    ''' Clear bates.
+    ''' </summary>
+    ''' <param name="document">Document with bates</param>
+    Private Function ClearBates(document As CPDFDocument) As Boolean
+        Dim bates As CPDFBates = document.GetBates()
+
+        bates.Clear()
+
+        Dim clearBatesPath As String = outputPath & "\ClearBatesTest.pdf"
+
+        If document.WriteToFilePath(clearBatesPath) Then
+            Console.WriteLine("Browse the changed file in " & clearBatesPath)
+            Return True
+        Else
+            Return False
+        End If
+    End Function
+
+
+End Module

+ 143 - 0
Demo/Examples/Samples/BatesTest/VB/BatesTest.vbproj

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{8FE5F6A4-92B5-4041-B659-50C032EBB965}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <StartupObject>VB.BatesTest</StartupObject>
+    <RootNamespace>VB</RootNamespace>
+    <AssemblyName>Samples_ComPDFKit</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <MyType>Console</MyType>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <DefineDebug>true</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DocumentationFile>Samples_ComPDFKit.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <DefineDebug>false</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DocumentationFile>Samples_ComPDFKit.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionExplicit>On</OptionExplicit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionCompare>Binary</OptionCompare>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionStrict>Off</OptionStrict>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionInfer>On</OptionInfer>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+  </ItemGroup>
+  <ItemGroup>
+    <Import Include="Microsoft.VisualBasic" />
+    <Import Include="System" />
+    <Import Include="System.Collections" />
+    <Import Include="System.Collections.Generic" />
+    <Import Include="System.Data" />
+    <Import Include="System.Diagnostics" />
+    <Import Include="System.Linq" />
+    <Import Include="System.Xml.Linq" />
+    <Import Include="System.Threading.Tasks" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\..\LicenseKey.vb">
+      <Link>LicenseKey.vb</Link>
+    </Compile>
+    <Compile Include="BatesTest.vb" />
+    <Compile Include="My Project\AssemblyInfo.vb" />
+    <Compile Include="My Project\Application.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Application.myapp</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Resources.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Settings.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="My Project\Resources.resx">
+      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
+      <CustomToolNamespace>My.Resources</CustomToolNamespace>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\TestFile\Bates.pdf">
+      <Link>Bates.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="My Project\Application.myapp">
+      <Generator>MyApplicationCodeGenerator</Generator>
+      <LastGenOutput>Application.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="My Project\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <CustomToolNamespace>My</CustomToolNamespace>
+      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+  <Import Project="..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

+ 13 - 0
Demo/Examples/Samples/BatesTest/VB/My Project/Application.Designer.vb

@@ -0,0 +1,13 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+

+ 10 - 0
Demo/Examples/Samples/BatesTest/VB/My Project/Application.myapp

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <MySubMain>false</MySubMain>
+  <SingleInstance>false</SingleInstance>
+  <ShutdownMode>0</ShutdownMode>
+  <EnableVisualStyles>true</EnableVisualStyles>
+  <AuthenticationMode>0</AuthenticationMode>
+  <ApplicationType>2</ApplicationType>
+  <SaveMySettingsOnExit>true</SaveMySettingsOnExit>
+</MyApplicationData>

+ 35 - 0
Demo/Examples/Samples/BatesTest/VB/My Project/AssemblyInfo.vb

@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("VB")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("")>
+<Assembly: AssemblyProduct("VB")>
+<Assembly: AssemblyCopyright("Copyright ©  2023")>
+<Assembly: AssemblyTrademark("")>
+
+<Assembly: ComVisible(False)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("a4abc9c3-c78a-4bba-8ab9-dec63d7e8408")>
+
+' Version information for an assembly consists of the following four values:
+'
+'      Major Version
+'      Minor Version
+'      Build Number
+'      Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+' <Assembly: AssemblyVersion("1.0.*")>
+
+<Assembly: AssemblyVersion("1.0.0.0")>
+<Assembly: AssemblyFileVersion("1.0.0.0")>

+ 62 - 0
Demo/Examples/Samples/BatesTest/VB/My Project/Resources.Designer.vb

@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+    'This class was auto-generated by the StronglyTypedResourceBuilder
+    'class via a tool like ResGen or Visual Studio.
+    'To add or remove a member, edit your .ResX file then rerun ResGen
+    'with the /str option, or rebuild your VS project.
+    '''<summary>
+    '''  A strongly-typed resource class, for looking up localized strings, etc.
+    '''</summary>
+    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+    Friend Module Resources
+
+        Private resourceMan As Global.System.Resources.ResourceManager
+
+        Private resourceCulture As Global.System.Globalization.CultureInfo
+
+        '''<summary>
+        '''  Returns the cached ResourceManager instance used by this class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+            Get
+                If Object.ReferenceEquals(resourceMan, Nothing) Then
+                    Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VB.Resources", GetType(Resources).Assembly)
+                    resourceMan = temp
+                End If
+                Return resourceMan
+            End Get
+        End Property
+
+        '''<summary>
+        '''  Overrides the current thread's CurrentUICulture property for all
+        '''  resource lookups using this strongly typed resource class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend Property Culture() As Global.System.Globalization.CultureInfo
+            Get
+                Return resourceCulture
+            End Get
+            Set(ByVal value As Global.System.Globalization.CultureInfo)
+                resourceCulture = value
+            End Set
+        End Property
+    End Module
+End Namespace

+ 117 - 0
Demo/Examples/Samples/BatesTest/VB/My Project/Resources.resx

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

+ 73 - 0
Demo/Examples/Samples/BatesTest/VB/My Project/Settings.Designer.vb

@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+    <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
+     Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+    Partial Friend NotInheritable Class MySettings
+        Inherits Global.System.Configuration.ApplicationSettingsBase
+
+        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+        Private Shared addedHandler As Boolean
+
+        Private Shared addedHandlerLockObject As New Object
+
+        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+            If My.Application.SaveMySettingsOnExit Then
+                My.Settings.Save()
+            End If
+        End Sub
+#End If
+#End Region
+
+        Public Shared ReadOnly Property [Default]() As MySettings
+            Get
+
+#If _MyType = "WindowsForms" Then
+                   If Not addedHandler Then
+                        SyncLock addedHandlerLockObject
+                            If Not addedHandler Then
+                                AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+                                addedHandler = True
+                            End If
+                        End SyncLock
+                    End If
+#End If
+                Return defaultInstance
+            End Get
+        End Property
+    End Class
+End Namespace
+
+Namespace My
+
+    <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
+    Friend Module MySettingsProperty
+
+        <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
+        Friend ReadOnly Property Settings() As Global.VB.My.MySettings
+            Get
+                Return Global.VB.My.MySettings.Default
+            End Get
+        End Property
+    End Module
+End Namespace

+ 7 - 0
Demo/Examples/Samples/BatesTest/VB/My Project/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

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

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

+ 7 - 5
Demo/Examples/Samples/BookmarkTest/CS/BookmarkTest.cs

@@ -7,19 +7,21 @@ namespace BookmarkTest
 {
     internal class BookmarkTest
     {
-        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\Bookmark";
+        static private string parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())));
+        static private string outputPath = Path.Combine(parentPath, "Output", "CS");
+
         static void Main(string[] args)
         {
-            Console.WriteLine("Running Bookmark test sample…\r\n");
-
+            #region Preparation work
+            Console.WriteLine("Running Bookmark test sample…" + Environment.NewLine);
             SDKLicenseHelper.LicenseVerify();
-
             CPDFDocument document = CPDFDocument.InitWithFilePath("ThreeBookmark.pdf");
 
             if (!Directory.Exists(outputPath))
             {
                 Directory.CreateDirectory(outputPath);
             }
+            #endregion
 
             #region Sample 1: Access bookmark
 
@@ -58,7 +60,7 @@ namespace BookmarkTest
 
             #endregion
 
-            #region Sample 3: Create bookmark
+            #region Sample 3: Remove bookmark
 
             document = CPDFDocument.InitWithFilePath("ThreeBookmark.pdf");
 

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

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

+ 151 - 0
Demo/Examples/Samples/BookmarkTest/VB/BookmarkTest.vb

@@ -0,0 +1,151 @@
+Imports ComPDFKit.PDFDocument
+Imports System
+Imports System.IO
+
+Module BookmarkTest
+    Private parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())))
+    Private outputPath As String = Path.Combine(parentPath, "Output", "VB")
+
+    Sub Main()
+        ' Preparation work
+        Console.WriteLine("Running Bookmark test sample…" + Environment.NewLine)
+        SDKLicenseHelper.LicenseVerify()
+        If Not Directory.Exists(outputPath) Then
+            Directory.CreateDirectory(outputPath)
+        End If
+        Dim document As CPDFDocument = CPDFDocument.InitWithFilePath("ThreeBookmark.pdf")
+
+#Region "Sample 1: Access bookmark"
+
+        If AccessBookmark(document) Then
+            Console.WriteLine("Check bookmark list done.")
+        Else
+            Console.WriteLine("Check bookmark list failed.")
+            Console.WriteLine("--------------------")
+            Console.WriteLine("Stop.")
+            Console.WriteLine("--------------------")
+            Console.ReadLine()
+            Return
+        End If
+        document.Release()
+        Console.WriteLine("--------------------")
+
+#End Region
+
+#Region "Sample 2: Create bookmark"
+
+        document = CPDFDocument.InitWithFilePath("ThreeBookmark.pdf")
+
+        If CreateBookmark(document) Then
+            Console.WriteLine("Add bookmark done.")
+        Else
+            Console.WriteLine("Add bookmark failed.")
+        End If
+        document.Release()
+        Console.WriteLine("--------------------")
+
+#End Region
+
+#Region "Sample 3: Remove bookmark"
+
+        document = CPDFDocument.InitWithFilePath("ThreeBookmark.pdf")
+
+        If RemoveBookmark(document) Then
+            Console.WriteLine("Remove bookmark done.")
+        Else
+            Console.WriteLine("Remove bookmark failed.")
+        End If
+
+        document.Release()
+        Console.WriteLine("--------------------")
+
+#End Region
+
+        Console.WriteLine("Done!")
+        Console.WriteLine("--------------------")
+        Console.ReadLine()
+
+
+
+    End Sub
+
+    ''' <summary>
+    ''' Access bookmark
+    ''' </summary> 
+    Private Function AccessBookmark(document As CPDFDocument) As Boolean
+        Dim bookmarkList As List(Of CPDFBookmark) = document.GetBookmarkList()
+
+        ' Check if there are 3 bookmarks in the document
+        If bookmarkList.Count = 3 Then
+            Console.WriteLine("Access bookmark list done.")
+        Else
+            Return False
+        End If
+
+        ' Check the title of the bookmark for page index 0
+        If document.BookmarkForPageIndex(0).Title = "Bookmark1" Then
+            Console.WriteLine("Access bookmark for a page done.")
+        Else
+            Return False
+        End If
+
+        Return True
+    End Function
+
+    ''' <summary>
+    ''' Create bookmark
+    ''' </summary> 
+    Private Function CreateBookmark(document As CPDFDocument) As Boolean
+        Dim bookmarkCount As Integer = document.GetBookmarkList().Count
+
+        Dim bookmark As New CPDFBookmark()
+        bookmark.Title = "new bookmark"
+        bookmark.PageIndex = 4
+
+        ' Add the new bookmark to the document
+        document.AddBookmark(bookmark)
+
+        ' Check if the number of bookmarks has increased by 1
+        If document.GetBookmarkList().Count - bookmarkCount = 1 Then
+            Console.WriteLine("Add bookmark in page {0}. ", bookmark.PageIndex + 1)
+        Else
+            Return False
+        End If
+
+        ' Save the modified document
+        Dim addBookmarkPath As String = outputPath & "//AddBookmarkTest.pdf"
+        If document.WriteToFilePath(addBookmarkPath) Then
+            Console.WriteLine("Browse the changed file in " & addBookmarkPath)
+            Return True
+        Else
+            Return False
+        End If
+    End Function
+
+    ''' <summary>
+    ''' Remove bookmark
+    ''' </summary> 
+    Private Function RemoveBookmark(document As CPDFDocument) As Boolean
+        Dim bookmarkCount As Integer = document.GetBookmarkList().Count
+
+        ' Remove the first bookmark
+        document.RemoveBookmark(0)
+
+        ' Check if the number of bookmarks has decreased by 1
+        If bookmarkCount - document.GetBookmarkList().Count = 1 Then
+            Console.WriteLine("Bookmark removed.")
+        Else
+            Return False
+        End If
+
+        ' Save the modified document
+        Dim removeBookmarkPath As String = outputPath & "//RemoveBookmarkTest.pdf"
+        If document.WriteToFilePath(removeBookmarkPath) Then
+            Console.WriteLine("Browse the changed file in " & removeBookmarkPath)
+            Return True
+        Else
+            Return False
+        End If
+    End Function
+
+End Module

+ 143 - 0
Demo/Examples/Samples/BookmarkTest/VB/BookmarkTest.vbproj

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{D922B3BB-3823-4506-BC8B-7C682B7F8AB9}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <StartupObject>VB.BookmarkTest</StartupObject>
+    <RootNamespace>VB</RootNamespace>
+    <AssemblyName>VB</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <MyType>Console</MyType>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <DefineDebug>true</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DocumentationFile>VB.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <DefineDebug>false</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DocumentationFile>VB.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionExplicit>On</OptionExplicit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionCompare>Binary</OptionCompare>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionStrict>Off</OptionStrict>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionInfer>On</OptionInfer>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+  </ItemGroup>
+  <ItemGroup>
+    <Import Include="Microsoft.VisualBasic" />
+    <Import Include="System" />
+    <Import Include="System.Collections" />
+    <Import Include="System.Collections.Generic" />
+    <Import Include="System.Data" />
+    <Import Include="System.Diagnostics" />
+    <Import Include="System.Linq" />
+    <Import Include="System.Xml.Linq" />
+    <Import Include="System.Threading.Tasks" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\..\LicenseKey.vb">
+      <Link>LicenseKey.vb</Link>
+    </Compile>
+    <Compile Include="BookmarkTest.vb" />
+    <Compile Include="My Project\AssemblyInfo.vb" />
+    <Compile Include="My Project\Application.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Application.myapp</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Resources.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Settings.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="My Project\Resources.resx">
+      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
+      <CustomToolNamespace>My.Resources</CustomToolNamespace>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\..\TestFile\ThreeBookmark.pdf">
+      <Link>ThreeBookmark.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="My Project\Application.myapp">
+      <Generator>MyApplicationCodeGenerator</Generator>
+      <LastGenOutput>Application.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="My Project\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <CustomToolNamespace>My</CustomToolNamespace>
+      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+  <Import Project="..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

+ 13 - 0
Demo/Examples/Samples/BookmarkTest/VB/My Project/Application.Designer.vb

@@ -0,0 +1,13 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+

+ 10 - 0
Demo/Examples/Samples/BookmarkTest/VB/My Project/Application.myapp

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <MySubMain>false</MySubMain>
+  <SingleInstance>false</SingleInstance>
+  <ShutdownMode>0</ShutdownMode>
+  <EnableVisualStyles>true</EnableVisualStyles>
+  <AuthenticationMode>0</AuthenticationMode>
+  <ApplicationType>2</ApplicationType>
+  <SaveMySettingsOnExit>true</SaveMySettingsOnExit>
+</MyApplicationData>

+ 35 - 0
Demo/Examples/Samples/BookmarkTest/VB/My Project/AssemblyInfo.vb

@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("VB")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("")>
+<Assembly: AssemblyProduct("VB")>
+<Assembly: AssemblyCopyright("Copyright ©  2023")>
+<Assembly: AssemblyTrademark("")>
+
+<Assembly: ComVisible(False)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("0b396ff9-54fd-4bf4-9d0f-0ad91d8d8443")>
+
+' Version information for an assembly consists of the following four values:
+'
+'      Major Version
+'      Minor Version
+'      Build Number
+'      Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+' <Assembly: AssemblyVersion("1.0.*")>
+
+<Assembly: AssemblyVersion("1.0.0.0")>
+<Assembly: AssemblyFileVersion("1.0.0.0")>

+ 62 - 0
Demo/Examples/Samples/BookmarkTest/VB/My Project/Resources.Designer.vb

@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+    'This class was auto-generated by the StronglyTypedResourceBuilder
+    'class via a tool like ResGen or Visual Studio.
+    'To add or remove a member, edit your .ResX file then rerun ResGen
+    'with the /str option, or rebuild your VS project.
+    '''<summary>
+    '''  A strongly-typed resource class, for looking up localized strings, etc.
+    '''</summary>
+    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+    Friend Module Resources
+
+        Private resourceMan As Global.System.Resources.ResourceManager
+
+        Private resourceCulture As Global.System.Globalization.CultureInfo
+
+        '''<summary>
+        '''  Returns the cached ResourceManager instance used by this class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+            Get
+                If Object.ReferenceEquals(resourceMan, Nothing) Then
+                    Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VB.Resources", GetType(Resources).Assembly)
+                    resourceMan = temp
+                End If
+                Return resourceMan
+            End Get
+        End Property
+
+        '''<summary>
+        '''  Overrides the current thread's CurrentUICulture property for all
+        '''  resource lookups using this strongly typed resource class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend Property Culture() As Global.System.Globalization.CultureInfo
+            Get
+                Return resourceCulture
+            End Get
+            Set(ByVal value As Global.System.Globalization.CultureInfo)
+                resourceCulture = value
+            End Set
+        End Property
+    End Module
+End Namespace

+ 117 - 0
Demo/Examples/Samples/BookmarkTest/VB/My Project/Resources.resx

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

+ 73 - 0
Demo/Examples/Samples/BookmarkTest/VB/My Project/Settings.Designer.vb

@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+    <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
+     Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+    Partial Friend NotInheritable Class MySettings
+        Inherits Global.System.Configuration.ApplicationSettingsBase
+
+        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+        Private Shared addedHandler As Boolean
+
+        Private Shared addedHandlerLockObject As New Object
+
+        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+            If My.Application.SaveMySettingsOnExit Then
+                My.Settings.Save()
+            End If
+        End Sub
+#End If
+#End Region
+
+        Public Shared ReadOnly Property [Default]() As MySettings
+            Get
+
+#If _MyType = "WindowsForms" Then
+                   If Not addedHandler Then
+                        SyncLock addedHandlerLockObject
+                            If Not addedHandler Then
+                                AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+                                addedHandler = True
+                            End If
+                        End SyncLock
+                    End If
+#End If
+                Return defaultInstance
+            End Get
+        End Property
+    End Class
+End Namespace
+
+Namespace My
+
+    <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
+    Friend Module MySettingsProperty
+
+        <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
+        Friend ReadOnly Property Settings() As Global.VB.My.MySettings
+            Get
+                Return Global.VB.My.MySettings.Default
+            End Get
+        End Property
+    End Module
+End Namespace

+ 7 - 0
Demo/Examples/Samples/BookmarkTest/VB/My Project/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

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

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

+ 22 - 11
Demo/Examples/Samples/DigitalSignatureTest/CS/DigitalSignatureTest.cs

@@ -14,7 +14,10 @@ namespace DigitalSignatureTest
 {
     internal class DigitalSignatureTest
     {
-        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\DigitalSignature";
+
+        static private string parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())));
+        static private string outputPath = Path.Combine(parentPath, "Output", "CS");
+
         static void Main()
         {
             #region Preparation work
@@ -30,32 +33,40 @@ namespace DigitalSignatureTest
             }
             #endregion
 
-            //Sample 0: Create certificate 
+            #region Sample 0: Create certificate 
             GenerateCertificate();
+            #endregion
 
-            //Sample 1: Create digital signature 
+            #region Sample 1: Create digital signature 
             CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
             CreateDigitalSignature(document, certificatePath, password);
             document.Release();
+            #endregion
 
-            //Sample 2: Verify signature
+            #region Sample 2: Verify signature
             CPDFDocument signedDoc = CPDFDocument.InitWithFilePath("Signed.pdf");
             VerifyDigitalSignature(signedDoc);
+            #endregion
 
-            //Sample 3: Verify certificate
+            #region Sample 3: Verify certificate
             VerifyCertificate(certificatePath, password);
+            #endregion
 
-            //Sample 4: Print digital signature info
+            #region Sample 4: Print digital signature info
             PrintDigitalSignatureInfo(signedDoc);
+            #endregion
 
-
-            //Sample 5: Trust Certificate
+            #region Sample 5: Trust Certificate
             TrustCertificate(signedDoc);
+            #endregion
 
-            //Sample 6: Remove digital signature
+            #region Sample 6: Remove digital signature
             RemoveDigitalSignature(signedDoc);
             signedDoc.Release();
-            Console.WriteLine("Done.\n");
+            #endregion
+
+
+            Console.WriteLine("Done!");
 
             Console.ReadLine();
         }
@@ -191,7 +202,7 @@ namespace DigitalSignatureTest
             string filePath = outputPath + "\\" + document.FileName + "_RemovedSign.pdf";
             document.WriteToFilePath(filePath);
             Console.WriteLine("File saved in " + filePath);
-            
+
             Console.WriteLine("Remove digital signature done.");
             Console.WriteLine("--------------------");
         }

+ 6 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/App.config

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

BIN
Demo/Examples/Samples/DigitalSignatureTest/VB/Certificate.pfx


BIN
Demo/Examples/Samples/DigitalSignatureTest/VB/ComPDFKit_Logo.ico


+ 316 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/DigitalSignatureTest.vb

@@ -0,0 +1,316 @@
+Imports System.Drawing
+Imports System.IO
+Imports ComPDFKit.DigitalSign
+Imports ComPDFKit.Import
+Imports ComPDFKit.PDFAnnotation.Form
+Imports ComPDFKit.PDFDocument
+Imports ComPDFKit.PDFPage
+
+Module DigitalSignatureTest
+
+    Private parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())))
+    Private outputPath As String = Path.Combine(parentPath, "Output", "VB")
+
+    Sub Main()
+#Region "Preparation work"
+        Console.WriteLine("Running digital signature sample..." & vbCrLf)
+
+        SDKLicenseHelper.LicenseVerify()
+        Dim certificatePath As String = "Certificate.pfx"
+        Dim password As String = "ComPDFKit"
+
+        If Not Directory.Exists(outputPath) Then
+            Directory.CreateDirectory(outputPath)
+        End If
+#End Region
+
+#Region "Sample 0: Create certificate"
+        GenerateCertificate()
+#End Region
+
+#Region "Sample 1: Create digital signature"
+        Dim document As CPDFDocument = CPDFDocument.InitWithFilePath("CommonFivePage.pdf")
+        CreateDigitalSignature(document, certificatePath, password)
+        document.Release()
+#End Region
+
+#Region "Sample 2: Verify signature"
+        Dim signedDoc As CPDFDocument = CPDFDocument.InitWithFilePath("Signed.pdf")
+        VerifyDigitalSignature(signedDoc)
+#End Region
+
+#Region "Sample 3: Verify certificate"
+        VerifyCertificate(certificatePath, password)
+#End Region
+
+#Region "Sample 4: Print digital signature info"
+        PrintDigitalSignatureInfo(signedDoc)
+#End Region
+
+#Region "Sample 5: Trust Certificate"
+        TrustCertificate(signedDoc)
+#End Region
+
+#Region "Sample 6: Remove digital signature"
+        RemoveDigitalSignature(signedDoc)
+        signedDoc.Release()
+#End Region
+
+        Console.WriteLine("Done!")
+
+        Console.ReadLine()
+
+    End Sub
+
+
+    ''' <summary>
+    ''' In the core function "CPDFPKCS12CertHelper.GeneratePKCS12Cert":
+    '''
+    ''' Generate certificate
+    '''
+    ''' Password: ComPDFKit
+    '''
+    ''' info: /C=SG/O=ComPDFKit/D=R&D Department/CN=Alan/emailAddress=xxxx@example.com
+    '''
+    ''' C=SG: This represents the country code "SG," which typically stands for Singapore.
+    ''' O=ComPDFKit: This is the Organization (O) field, indicating the name of the organization or entity, in this case, "ComPDFKit."
+    ''' D=R&D Department: This is the Department (D) field, indicating the specific department within the organization, in this case, "R&D Department."
+    ''' CN=Alan: This is the Common Name (CN) field, which usually represents the name of the individual or entity. In this case, it is "Alan."
+    ''' emailAddress=xxxx@example.com: Email is xxxx@example.com
+    '''
+    ''' CPDFCertUsage.CPDFCertUsageAll: Used for both digital signing and data validation simultaneously.
+    '''
+    ''' is_2048 = True: Enhanced security encryption.
+    ''' </summary>
+    Private Sub GenerateCertificate()
+        Console.WriteLine("--------------------")
+        Console.WriteLine("Generate certificate signature.")
+
+        Dim info As String = "/C=SG/O=ComPDFKit/D=R&D Department/CN=Alan/emailAddress=xxxx@example.com"
+        Dim password As String = "ComPDFKit"
+        Dim filePath As String = outputPath & "\Certificate.pfx"
+
+        If CPDFPKCS12CertHelper.GeneratePKCS12Cert(info, password, filePath, CPDFCertUsage.CPDFCertUsageAll, True) Then
+            Console.WriteLine("File saved in " & filePath)
+            Console.WriteLine("Generate PKCS12 certificate done.")
+        Else
+            Console.WriteLine("Generate PKCS12 certificate failed.")
+        End If
+
+        Console.WriteLine("--------------------")
+    End Sub
+    ''' <summary>
+    ''' Adding a signature is divided into two steps:
+    ''' creating a signature field and filling in the signature.
+    '''
+    ''' Page Index: 0
+    ''' Rect: CRect(28, 420, 150, 370)
+    ''' Border RGB: {0, 0, 0}
+    ''' Widget Background RGB: {150, 180, 210}
+    '''
+    ''' Text: Grantor Name
+    ''' Content:
+    '''     Name: get grantor name from certificate
+    '''     Date: now(yyyy.mm.dd)
+    '''     Reason: I am the owner of the document.
+    '''     DN: Subject
+    '''     Location: Singapor
+    '''     IsContentAlignLeft: False
+    '''     IsDrawLogo: True
+    '''     LogoBitmap: logo.png
+    '''     text color RGB: {0, 0, 0}
+    '''     content color RGB: {0, 0, 0}
+    '''     Output file name: document.FileName + "_Signed.pdf"
+    ''' </summary>
+    Private Sub CreateDigitalSignature(document As CPDFDocument, certificatePath As String, password As String)
+        Console.WriteLine("--------------------")
+        Console.WriteLine("Create digital signature.")
+        Dim certificate As CPDFSignatureCertificate = CPDFPKCS12CertHelper.GetCertificateWithPKCS12Path("Certificate.pfx", "ComPDFKit")
+
+        Dim page As CPDFPage = document.PageAtIndex(0)
+        Dim signatureField As CPDFSignatureWidget = TryCast(page.CreateWidget(C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS), CPDFSignatureWidget)
+        signatureField.SetRect(New CRect(28, 420, 150, 370))
+        signatureField.SetWidgetBorderRGBColor(New Byte() {0, 0, 0})
+        signatureField.SetWidgetBgRGBColor(New Byte() {150, 180, 210})
+        signatureField.UpdateAp()
+
+        Dim name As String = GetGrantorFromDictionary(certificate.SubjectDict) & vbCrLf
+        Dim [date] As String = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss")
+        Dim reason As String = "I am the owner of the document."
+        Dim location As String = certificate.SubjectDict("C")
+        Dim DN As String = certificate.Subject
+        Dim signatureConfig As New CPDFSignatureConfig With {
+        .Text = GetGrantorFromDictionary(certificate.SubjectDict),
+        .Content = "Name: " & name & Environment.NewLine &
+                   "Date: " & [date] & Environment.NewLine &
+                   "Reason: " & reason & " " & Environment.NewLine &
+                   "Location: " & location & Environment.NewLine &
+                   "DN: " & DN & Environment.NewLine,
+        .IsContentAlignLeft = False,
+        .IsDrawLogo = True,
+        .LogoBitmap = New Bitmap("Logo.png"),
+        .TextColor = New Single() {0, 0, 0},
+        .ContentColor = New Single() {0, 0, 0}
+    }
+        Dim filePath As String = outputPath & "\" & document.FileName & "_Signed.pdf"
+        signatureField.UpdataApWithSignature(signatureConfig)
+        If document.WriteSignatureToFilePath(signatureField,
+        filePath,
+        certificatePath, password,
+        location,
+        reason, CPDFSignaturePermissions.CPDFSignaturePermissionsNone) Then
+            Console.WriteLine("File saved in " & filePath)
+            Console.WriteLine("Create digital signature done.")
+        Else
+            Console.WriteLine("Create digital signature failed.")
+        End If
+        Console.WriteLine("--------------------")
+    End Sub
+
+    ''' <summary>
+    ''' Remove digital signature
+    ''' You can choose if you want to remove the appearance
+    ''' </summary>
+    ''' <param name="document"></param>
+    Private Sub RemoveDigitalSignature(document As CPDFDocument)
+        Console.WriteLine("--------------------")
+        Console.WriteLine("Remove digital signature.")
+
+        Dim signature As CPDFSignature = document.GetSignatureList()(0)
+        document.RemoveSignature(signature, True)
+        Dim filePath As String = outputPath & "\" & document.FileName & "_RemovedSign.pdf"
+        document.WriteToFilePath(filePath)
+        Console.WriteLine("File saved in " & filePath)
+
+        Console.WriteLine("Remove digital signature done.")
+        Console.WriteLine("--------------------")
+    End Sub
+
+    ''' <summary>
+    ''' There are two steps can help you to trust a certificate.
+    ''' Set your trust path as a folder path,
+    ''' then add your certificate to the trust path.
+    ''' </summary>
+    Private Sub TrustCertificate(document As CPDFDocument)
+        Console.WriteLine("--------------------")
+        Console.WriteLine("Trust certificate.")
+
+        Dim signature As CPDFSignature = document.GetSignatureList()(0)
+        Dim signatureCertificate As CPDFSignatureCertificate = signature.SignerList(0).CertificateList(0)
+
+        Console.WriteLine("Certificate trusted status: " & signatureCertificate.IsTrusted.ToString())
+
+        Console.WriteLine("---Begin trusted---")
+
+        Dim trustedFolder As String = AppDomain.CurrentDomain.BaseDirectory & "\TrustedFolder\"
+        If Not Directory.Exists(trustedFolder) Then
+            Directory.CreateDirectory(trustedFolder)
+        End If
+        CPDFSignature.SignCertTrustedFolder = trustedFolder
+        If signatureCertificate.AddToTrustedCertificates() Then
+            Console.WriteLine("Certificate trusted status: " & signatureCertificate.IsTrusted.ToString())
+            Console.WriteLine("Trust certificate done.")
+        Else
+            Console.WriteLine("Trust certificate failed.")
+        End If
+        Console.WriteLine("--------------------")
+    End Sub
+
+    ''' <summary>
+    ''' Verify certificate
+    '''
+    ''' To verify the trustworthiness of a certificate,
+    ''' you need to verify that all certificates in the certificate chain are trustworthy.
+    '''
+    ''' In ComPDFKit, this progress is automatic.
+    ''' You should call the "CPDFSignatureCertificate.CheckCertificateIsTrusted" first.
+    ''' then you can view the "CPDFSignatureCertificate.IsTrusted" property.
+    ''' </summary>
+    ''' <param name="certificatePath">Path to the certificate</param>
+    ''' <param name="password">Password for the certificate</param>
+    Private Sub VerifyCertificate(certificatePath As String, password As String)
+        Console.WriteLine("--------------------")
+        Console.WriteLine("Verify certificate.")
+        Dim certificate As CPDFSignatureCertificate = CPDFPKCS12CertHelper.GetCertificateWithPKCS12Path(certificatePath, password)
+        certificate.CheckCertificateIsTrusted()
+        If certificate.IsTrusted Then
+            Console.WriteLine("Certificate is trusted")
+        Else
+            Console.WriteLine("Certificate is not trusted")
+        End If
+        Console.WriteLine("Verify certificate done.")
+        Console.WriteLine("--------------------")
+    End Sub
+
+    ''' <summary>
+    ''' Verify digital signature
+    '''
+    ''' Refresh the validation status before reading the attributes, or else you may obtain inaccurate results.
+    ''' Is the signature verified: indicating whether the document has been tampered with.
+    ''' Is the certificate trusted: referring to the trust status of the certificate.
+    ''' </summary> 
+    ''' <param name="document">A signed document</param>
+    Private Sub VerifyDigitalSignature(document As CPDFDocument)
+        Console.WriteLine("--------------------")
+        Console.WriteLine("Verify digital signature.")
+        For Each signature As CPDFSignature In document.GetSignatureList()
+            signature.VerifySignatureWithDocument(document)
+            For Each signer As CPDFSigner In signature.SignerList
+                Console.WriteLine("Is the certificate trusted: " & signer.IsCertTrusted.ToString())
+                Console.WriteLine("Is the signature verified: " & signer.IsSignVerified.ToString())
+                If signer.IsCertTrusted AndAlso signer.IsSignVerified Then
+                    ' Signature is valid and the certificate is trusted
+                    ' Perform corresponding actions
+                ElseIf Not signer.IsCertTrusted AndAlso signer.IsSignVerified Then
+                    ' Signature is valid but the certificate is not trusted
+                    ' Perform corresponding actions
+                Else
+                    ' Signature is invalid
+                    ' Perform corresponding actions
+                End If
+            Next
+        Next
+        Console.WriteLine("Verify digital signature done.")
+        Console.WriteLine("--------------------")
+    End Sub
+
+    Public Function GetGrantorFromDictionary(dictionary As Dictionary(Of String, String)) As String
+        Dim grantor As String = String.Empty
+        dictionary.TryGetValue("CN", grantor)
+        If String.IsNullOrEmpty(grantor) Then
+            dictionary.TryGetValue("OU", grantor)
+        End If
+        If String.IsNullOrEmpty(grantor) Then
+            dictionary.TryGetValue("O", grantor)
+        End If
+        If String.IsNullOrEmpty(grantor) Then
+            grantor = "Unknown Signer"
+        End If
+        Return grantor
+    End Function
+
+    ''' <summary>
+    ''' This sample shows how to get main properties in a digital signature.
+    ''' Read API reference to see all of the properties that can be obtained.
+    ''' </summary>
+    ''' <param name="document">A signed document</param>
+    Private Sub PrintDigitalSignatureInfo(document As CPDFDocument)
+        Console.WriteLine("--------------------")
+        Console.WriteLine("Print digital signature info.")
+        For Each signature As CPDFSignature In document.GetSignatureList()
+            signature.VerifySignatureWithDocument(document)
+            Console.WriteLine("Name: " & signature.Name)
+            Console.WriteLine("Location: " & signature.Location)
+            Console.WriteLine("Reason: " & signature.Reason)
+            For Each signer As CPDFSigner In signature.SignerList
+                Console.WriteLine("Date: " & signer.AuthenDate)
+                For Each certificate As CPDFSignatureCertificate In signer.CertificateList
+                    Console.WriteLine("Subject: " & certificate.Subject)
+                Next
+            Next
+        Next
+        Console.WriteLine("Print digital signature info done.")
+        Console.WriteLine("--------------------")
+    End Sub
+
+End Module

+ 153 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/DigitalSignatureTest.vbproj

@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{84A958E6-C1DA-42C4-88E5-EBF4E3E632FE}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <StartupObject>VB.DigitalSignatureTest</StartupObject>
+    <RootNamespace>VB</RootNamespace>
+    <AssemblyName>Samples_ComPDFKit</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <MyType>Console</MyType>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <DefineDebug>true</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DocumentationFile>Samples_ComPDFKit.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <DefineDebug>false</DefineDebug>
+    <DefineTrace>true</DefineTrace>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DocumentationFile>Samples_ComPDFKit.xml</DocumentationFile>
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionExplicit>On</OptionExplicit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionCompare>Binary</OptionCompare>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionStrict>Off</OptionStrict>
+  </PropertyGroup>
+  <PropertyGroup>
+    <OptionInfer>On</OptionInfer>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ComPDFKit.Desk, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Desk.dll</HintPath>
+    </Reference>
+    <Reference Include="ComPDFKit.Viewer, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\..\..\packages\ComPDFKit.NetFramework.1.10.0\lib\ComPDFKit.Viewer.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+  </ItemGroup>
+  <ItemGroup>
+    <Import Include="Microsoft.VisualBasic" />
+    <Import Include="System" />
+    <Import Include="System.Collections" />
+    <Import Include="System.Collections.Generic" />
+    <Import Include="System.Data" />
+    <Import Include="System.Diagnostics" />
+    <Import Include="System.Linq" />
+    <Import Include="System.Xml.Linq" />
+    <Import Include="System.Threading.Tasks" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\..\LicenseKey.vb">
+      <Link>LicenseKey.vb</Link>
+    </Compile>
+    <Compile Include="DigitalSignatureTest.vb" />
+    <Compile Include="My Project\AssemblyInfo.vb" />
+    <Compile Include="My Project\Application.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Application.myapp</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Resources.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="My Project\Settings.Designer.vb">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="My Project\Resources.resx">
+      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
+      <CustomToolNamespace>My.Resources</CustomToolNamespace>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\TestFile\CommonFivePage.pdf">
+      <Link>CommonFivePage.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\..\TestFile\Signed.pdf">
+      <Link>Signed.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Certificate.pfx">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="My Project\Application.myapp">
+      <Generator>MyApplicationCodeGenerator</Generator>
+      <LastGenOutput>Application.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="My Project\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <CustomToolNamespace>My</CustomToolNamespace>
+      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="ComPDFKit_Logo.ico" />
+    <None Include="Logo.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+  <Import Project="..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\ComPDFKit.NetFramework.1.10.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

BIN
Demo/Examples/Samples/DigitalSignatureTest/VB/Logo.png


+ 13 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Application.Designer.vb

@@ -0,0 +1,13 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+

+ 10 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Application.myapp

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <MySubMain>false</MySubMain>
+  <SingleInstance>false</SingleInstance>
+  <ShutdownMode>0</ShutdownMode>
+  <EnableVisualStyles>true</EnableVisualStyles>
+  <AuthenticationMode>0</AuthenticationMode>
+  <ApplicationType>2</ApplicationType>
+  <SaveMySettingsOnExit>true</SaveMySettingsOnExit>
+</MyApplicationData>

+ 35 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/AssemblyInfo.vb

@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("VB")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("")>
+<Assembly: AssemblyProduct("VB")>
+<Assembly: AssemblyCopyright("Copyright ©  2023")>
+<Assembly: AssemblyTrademark("")>
+
+<Assembly: ComVisible(False)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("36375b36-b03d-4554-8355-f034b9bc3898")>
+
+' Version information for an assembly consists of the following four values:
+'
+'      Major Version
+'      Minor Version
+'      Build Number
+'      Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+' <Assembly: AssemblyVersion("1.0.*")>
+
+<Assembly: AssemblyVersion("1.0.0.0")>
+<Assembly: AssemblyFileVersion("1.0.0.0")>

+ 62 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Resources.Designer.vb

@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+    'This class was auto-generated by the StronglyTypedResourceBuilder
+    'class via a tool like ResGen or Visual Studio.
+    'To add or remove a member, edit your .ResX file then rerun ResGen
+    'with the /str option, or rebuild your VS project.
+    '''<summary>
+    '''  A strongly-typed resource class, for looking up localized strings, etc.
+    '''</summary>
+    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+    Friend Module Resources
+
+        Private resourceMan As Global.System.Resources.ResourceManager
+
+        Private resourceCulture As Global.System.Globalization.CultureInfo
+
+        '''<summary>
+        '''  Returns the cached ResourceManager instance used by this class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+            Get
+                If Object.ReferenceEquals(resourceMan, Nothing) Then
+                    Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VB.Resources", GetType(Resources).Assembly)
+                    resourceMan = temp
+                End If
+                Return resourceMan
+            End Get
+        End Property
+
+        '''<summary>
+        '''  Overrides the current thread's CurrentUICulture property for all
+        '''  resource lookups using this strongly typed resource class.
+        '''</summary>
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Friend Property Culture() As Global.System.Globalization.CultureInfo
+            Get
+                Return resourceCulture
+            End Get
+            Set(ByVal value As Global.System.Globalization.CultureInfo)
+                resourceCulture = value
+            End Set
+        End Property
+    End Module
+End Namespace

+ 117 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Resources.resx

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

+ 73 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Settings.Designer.vb

@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+'     This code was generated by a tool.
+'     Runtime Version:4.0.30319.42000
+'
+'     Changes to this file may cause incorrect behavior and will be lost if
+'     the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+    <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
+     Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+    Partial Friend NotInheritable Class MySettings
+        Inherits Global.System.Configuration.ApplicationSettingsBase
+
+        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+        Private Shared addedHandler As Boolean
+
+        Private Shared addedHandlerLockObject As New Object
+
+        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+            If My.Application.SaveMySettingsOnExit Then
+                My.Settings.Save()
+            End If
+        End Sub
+#End If
+#End Region
+
+        Public Shared ReadOnly Property [Default]() As MySettings
+            Get
+
+#If _MyType = "WindowsForms" Then
+                   If Not addedHandler Then
+                        SyncLock addedHandlerLockObject
+                            If Not addedHandler Then
+                                AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+                                addedHandler = True
+                            End If
+                        End SyncLock
+                    End If
+#End If
+                Return defaultInstance
+            End Get
+        End Property
+    End Class
+End Namespace
+
+Namespace My
+
+    <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
+    Friend Module MySettingsProperty
+
+        <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
+        Friend ReadOnly Property Settings() As Global.VB.My.MySettings
+            Get
+                Return Global.VB.My.MySettings.Default
+            End Get
+        End Property
+    End Module
+End Namespace

+ 7 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/My Project/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 4 - 0
Demo/Examples/Samples/DigitalSignatureTest/VB/packages.config

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