Jelajahi Sumber

compdfkit(windows) - Compare

liuaoran 1 tahun lalu
induk
melakukan
ccb6907084
25 mengubah file dengan 884 tambahan dan 36 penghapusan
  1. 5 1
      Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/CPDFAnnoationListUI.xaml.cs
  2. 45 0
      Demo/Examples/Examlpes.sln
  3. 1 1
      Demo/Examples/PDFViewer/MainPage.xaml
  4. 191 11
      Demo/Examples/Samples/AnnotationTest/AnnotationTest.cs
  5. 11 0
      Demo/Examples/Samples/AnnotationTest/AnnotationTest.csproj
  6. 6 0
      Demo/Examples/Samples/DocumentCompare/App.config
  7. 58 0
      Demo/Examples/Samples/DocumentCompare/DocumentCompare.cs
  8. 90 0
      Demo/Examples/Samples/DocumentCompare/DocumentCompareTest.csproj
  9. 36 0
      Demo/Examples/Samples/DocumentCompare/Properties/AssemblyInfo.cs
  10. 4 0
      Demo/Examples/Samples/DocumentCompare/packages.config
  11. 6 0
      Demo/Examples/Samples/InteractiveFormsTest/App.config
  12. 103 0
      Demo/Examples/Samples/InteractiveFormsTest/InteractiveFormsTest.cs
  13. 82 0
      Demo/Examples/Samples/InteractiveFormsTest/InteractiveFormsTest.csproj
  14. 36 0
      Demo/Examples/Samples/InteractiveFormsTest/Properties/AssemblyInfo.cs
  15. 4 0
      Demo/Examples/Samples/InteractiveFormsTest/packages.config
  16. 23 22
      Demo/Examples/Samples/PDFATest/PDFATest.cs
  17. 6 0
      Demo/Examples/Samples/TextExtractTest/App.config
  18. 36 0
      Demo/Examples/Samples/TextExtractTest/Properties/AssemblyInfo.cs
  19. 51 0
      Demo/Examples/Samples/TextExtractTest/TextExtractTest.cs
  20. 82 0
      Demo/Examples/Samples/TextExtractTest/TextExtractTest.csproj
  21. 4 0
      Demo/Examples/Samples/TextExtractTest/packages.config
  22. 4 1
      Demo/Examples/Samples/WatermarkTest/WatermarkTest.cs
  23. TEMPAT SAMPAH
      Demo/Examples/TestFile/Bird.wav
  24. TEMPAT SAMPAH
      Demo/Examples/TestFile/ElectricalDiagram.pdf
  25. TEMPAT SAMPAH
      Demo/Examples/TestFile/ElectricalDiagram_New.pdf

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

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

+ 45 - 0
Demo/Examples/Examlpes.sln

@@ -62,6 +62,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextSearchTest", "Samples\T
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnnotationImportExportTest", "Samples\AnnotationImportExportTest\AnnotationImportExportTest.csproj", "{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextExtractTest", "Samples\TextExtractTest\TextExtractTest.csproj", "{7D255150-76CB-4A65-AFEA-F88778ABF03B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentCompareTest", "Samples\DocumentCompare\DocumentCompareTest.csproj", "{0BB38D20-C3CF-47D7-8E2E-97195672AB67}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InteractiveFormsTest", "Samples\InteractiveFormsTest\InteractiveFormsTest.csproj", "{FB4B7306-DECC-457C-8F4C-6CE946F753D6}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -384,6 +390,42 @@ Global
 		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|x64.Build.0 = Release|Any CPU
 		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|x86.ActiveCfg = Release|Any CPU
 		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728}.Release|x86.Build.0 = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|x64.Build.0 = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Debug|x86.Build.0 = Debug|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|x64.ActiveCfg = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|x64.Build.0 = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|x86.ActiveCfg = Release|Any CPU
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B}.Release|x86.Build.0 = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|x64.Build.0 = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Debug|x86.Build.0 = Debug|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|x64.ActiveCfg = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|x64.Build.0 = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|x86.ActiveCfg = Release|Any CPU
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67}.Release|x86.Build.0 = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|x64.Build.0 = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Debug|x86.Build.0 = Debug|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|Any CPU.Build.0 = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|x64.ActiveCfg = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|x64.Build.0 = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|x86.ActiveCfg = Release|Any CPU
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -406,6 +448,9 @@ Global
 		{ED8A0C73-FA4E-4FAC-93F7-27C67A940628} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
 		{DD2E08EE-0E64-4AB9-B8DC-03DE7E8B4E04} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
 		{E2693237-D8F2-4E1C-B3C3-0B3ACFB73728} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{7D255150-76CB-4A65-AFEA-F88778ABF03B} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{0BB38D20-C3CF-47D7-8E2E-97195672AB67} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
+		{FB4B7306-DECC-457C-8F4C-6CE946F753D6} = {812D8275-2791-4CEF-A4E8-39A78E49D8FB}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {8EE774F1-5FBF-482A-9A31-5ABDEC216DEF}

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

@@ -60,7 +60,7 @@
                         </Viewbox>
                     </Button.Content>
                     <Button.ToolTip>
-                        <ToolTip Content="Open..."></ToolTip>
+                        <ToolTip Content="Open...(Ctrl+O)"></ToolTip>
                     </Button.ToolTip>
                 </Button>
  

+ 191 - 11
Demo/Examples/Samples/AnnotationTest/AnnotationTest.cs

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

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

@@ -43,6 +43,7 @@
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />
@@ -62,6 +63,10 @@
       <Link>CommonFivePage.pdf</Link>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="..\..\TestFile\Bird.wav">
+      <Link>Bird.wav</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
     <None Include="App.config" />
     <None Include="packages.config" />
   </ItemGroup>
@@ -71,6 +76,12 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\TestFile\logo.png">
+      <Link>logo.png</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

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

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

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

@@ -0,0 +1,58 @@
+using ComPDFKit.Compare;
+using ComPDFKit.PDFDocument;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+
+namespace DocumentCompareTest
+{
+    internal class DocumentCompare
+    {
+        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\DocumentCompare";
+
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Running PDFPage test sample…\r\n");
+
+            SDKLicenseHelper.LicenseVerify();
+            CPDFDocument document1 = CPDFDocument.InitWithFilePath("ElectricalDiagram.pdf");
+            CPDFDocument document2 = CPDFDocument.InitWithFilePath("ElectricalDiagram_New.pdf");
+
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+
+            if (CompareDocument(document1, document2))
+            {
+                Console.WriteLine("Compare document done.");
+            }
+            else
+            {
+                Console.WriteLine("Compare document failed."); 
+            }
+            Console.WriteLine("--------------------");
+            Console.WriteLine("Done!");
+            Console.WriteLine("--------------------");
+            Console.ReadLine();
+        }
+
+        static private bool CompareDocument(CPDFDocument document1, CPDFDocument document2)
+        {
+            CPDFCompareOverlay compareOverlay = new CPDFCompareOverlay(document1, "1-5", document2, "1-5");
+            compareOverlay.Compare();
+            CPDFDocument comparisonDocument = compareOverlay.ComparisonDocument();
+            string path = outputPath + "\\CompareDocumentTest.pdf";
+            if (!comparisonDocument.WriteToFilePath(path))
+            {
+                return false;
+            }
+            Console.WriteLine("Browse the changed file in " + path);
+            return true;
+        }
+    }
+}

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

@@ -0,0 +1,90 @@
+<?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>{0BB38D20-C3CF-47D7-8E2E-97195672AB67}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>DocumentCompare</RootNamespace>
+    <AssemblyName>Viewer_ComPDFKit</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\LicenseKey.cs">
+      <Link>LicenseKey.cs</Link>
+    </Compile>
+    <Compile Include="DocumentCompare.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\TestFile\ElectricalDiagram.pdf">
+      <Link>ElectricalDiagram.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="..\..\TestFile\ElectricalDiagram_New.pdf">
+      <Link>ElectricalDiagram_New.pdf</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\license_key_win.xml">
+      <Link>license_key_win.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\..\compdfkit\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
+      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
+      <Name>ComPDFKit.Desk</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\..\..\compdfkit\ComPDFKit\ComPDFKitDesktop\ComPDFKit.Viewer\ComPDFKit.Viewer.csproj">
+      <Project>{18ec356d-8130-49d4-b4e6-ac290e1065b7}</Project>
+      <Name>ComPDFKit.Viewer</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\ComPDFKit.NetFramework.1.9.0\build\ComPDFKit.NetFramework.targets'))" />
+  </Target>
+</Project>

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

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

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

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

+ 6 - 0
Demo/Examples/Samples/InteractiveFormsTest/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>

+ 103 - 0
Demo/Examples/Samples/InteractiveFormsTest/InteractiveFormsTest.cs

@@ -0,0 +1,103 @@
+using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation.Form;
+using ComPDFKit.PDFDocument;
+using ComPDFKit.PDFPage;
+using ComPDFKit.PDFPage.Edit;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace InteractiveFormsTest
+{
+    internal class InteractiveFormsTest
+    {
+        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\InteractiveForms";
+          
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Running interactive forms test sample…\r\n");
+            SDKLicenseHelper.LicenseVerify();
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+            if (CreateForms(document))
+            {
+                Console.WriteLine("Create forms done.");
+            }
+            else
+            {
+                Console.WriteLine("Create forms failed."); 
+            }
+        }
+
+        static private void CreateTextField(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFTextWidget textField = page.CreateWidget(C_WIDGET_TYPE.WIDGET_TEXTFIELD) as CPDFTextWidget;
+            textField.SetRect(new CRect( 28, 32, 237, 75));
+        }
+
+        static private void CreatePushButton(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFPushButtonWidget textField = page.CreateWidget(C_WIDGET_TYPE.WIDGET_PUSHBUTTON) as CPDFPushButtonWidget;
+            textField.SetRect(new CRect(28, 32, 237, 75));
+        }
+
+        static private void CreateListBox(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFListBoxWidget listbox = page.CreateWidget(C_WIDGET_TYPE.WIDGET_LISTBOX) as CPDFListBoxWidget;
+            listbox.AddOptionItem(0, "1", "a");
+            listbox.AddOptionItem(1, "2", "b");
+            listbox.SetRect(new CRect(28, 32, 237, 75));
+        }
+
+        static private void CreateSignatureField(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFSignatureWidget signatureField = page.CreateWidget(C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS) as CPDFSignatureWidget;
+            signatureField.SetRect(new CRect(28, 32, 237, 75));
+        }
+
+        static private void CreateCheckBox(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFCheckBoxWidget checkBox = page.CreateWidget(C_WIDGET_TYPE.WIDGET_CHECKBOX) as CPDFCheckBoxWidget;
+            checkBox.SetRect(new CRect(28, 32, 237, 75));
+        }
+        static private void CreateRadioButton(CPDFDocument document)
+        {
+            CPDFPage page = document.PageAtIndex(0);
+            CPDFRadioButtonWidget radioButton = page.CreateWidget(C_WIDGET_TYPE.WIDGET_RADIOBUTTON) as CPDFRadioButtonWidget;
+            radioButton.SetRect(new CRect(28, 32, 237, 75));
+        }
+         
+        static private bool CreateForms(CPDFDocument document)
+        {
+            CreateTextField(document);
+            CreatePushButton(document);
+            CreateListBox(document);
+            CreateSignatureField(document);
+            CreateCheckBox(document);
+            CreateRadioButton(document);
+
+            // Save to pointed path so you can observe the effect.
+            string path = outputPath + "\\CreateFormsTest.pdf";
+
+            if (!document.WriteToFilePath(path)) 
+            {
+                return false;
+            }
+            Console.WriteLine("Browse the changed file in " + path);
+
+            return true;
+        }
+
+    }
+}

+ 82 - 0
Demo/Examples/Samples/InteractiveFormsTest/InteractiveFormsTest.csproj

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

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

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

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

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

+ 23 - 22
Demo/Examples/Samples/PDFATest/PDFATest.cs

@@ -11,28 +11,6 @@ namespace PDFATest
     internal class PDFATest
     {
         static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\PDFA";
-        static public bool CovertToPDFA1a(CPDFDocument document)
-        {
-            string convertToPDFA1aPath = outputPath + "\\ConvertToPDFA1aTest.pdf";
-            if (!document.WritePDFAToFilePath(CPDFType.CPDFTypePDFA1a, convertToPDFA1aPath))
-            {
-                return false;
-            }
-            Console.WriteLine("Browse the changed file in " + convertToPDFA1aPath);
-            return true;
-        }
-
-        static public bool CovertToPDFA1b(CPDFDocument document)
-        {
-            string convertToPDFA1bPath = outputPath + "\\ConvertToPDFA1bTest.pdf";
-            if (!document.WritePDFAToFilePath(CPDFType.CPDFTypePDFA1b, convertToPDFA1bPath))
-            {
-                return false;
-            }
-
-            Console.WriteLine("Browse the changed file in " + convertToPDFA1bPath);
-            return true;
-        }
 
         static void Main(string[] args)
         {
@@ -79,5 +57,28 @@ namespace PDFATest
 
             Console.ReadLine();
         }
+
+        static public bool CovertToPDFA1a(CPDFDocument document)
+        {
+            string convertToPDFA1aPath = outputPath + "\\ConvertToPDFA1aTest.pdf";
+            if (!document.WritePDFAToFilePath(CPDFType.CPDFTypePDFA1a, convertToPDFA1aPath))
+            {
+                return false;
+            }
+            Console.WriteLine("Browse the changed file in " + convertToPDFA1aPath);
+            return true;
+        }
+
+        static public bool CovertToPDFA1b(CPDFDocument document)
+        {
+            string convertToPDFA1bPath = outputPath + "\\ConvertToPDFA1bTest.pdf";
+            if (!document.WritePDFAToFilePath(CPDFType.CPDFTypePDFA1b, convertToPDFA1bPath))
+            {
+                return false;
+            }
+
+            Console.WriteLine("Browse the changed file in " + convertToPDFA1bPath);
+            return true;
+        }
     }
 }

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

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

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

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("TextExtractTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("TextExtractTest")]
+[assembly: AssemblyCopyright("Copyright ©  2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7d255150-76cb-4a65-afea-f88778abf03b")]
+
+// 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")]

+ 51 - 0
Demo/Examples/Samples/TextExtractTest/TextExtractTest.cs

@@ -0,0 +1,51 @@
+using ComPDFKit.PDFDocument;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TextExtractTest
+{
+    internal class TextExtractTest
+    {
+        static private string outputPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()))) + "\\Output\\TextExtract";
+
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Running PDFPage test sample…\r\n");
+
+            SDKLicenseHelper.LicenseVerify();
+            CPDFDocument document = CPDFDocument.InitWithFilePath("CommonFivePage.pdf");
+
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+
+           if(PDFToText(document))
+            {
+                Console.WriteLine("PDF to text done.");
+            }
+            else
+            {
+                Console.WriteLine("PDF to text failed.");
+            }
+            Console.WriteLine("--------------------");
+            Console.WriteLine("Done!");
+            Console.WriteLine("--------------------");
+            Console.ReadLine();
+        }
+
+        static private bool PDFToText(CPDFDocument document)
+        {
+            string path = outputPath + "//PDFToText.txt";
+            if (!document.PdfToText("1-" + document.PageCount.ToString(), path)){
+                return false;
+            }
+            Console.WriteLine("Browse the generated file in " + path);
+            return true;
+        }
+    }
+}

+ 82 - 0
Demo/Examples/Samples/TextExtractTest/TextExtractTest.csproj

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

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

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

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

@@ -140,7 +140,8 @@ namespace WatermarkTest
             if (!document.WriteToFilePath(path))
             {
                 return false;
-            } 
+            }
+            Console.WriteLine("Browse the changed file in " + path);
             return true; 
         }
 
@@ -152,6 +153,8 @@ namespace WatermarkTest
             {
                 return false;
             }
+            Console.WriteLine("Browse the changed file in " + path);
+
             return true;
         }
     }

TEMPAT SAMPAH
Demo/Examples/TestFile/Bird.wav


TEMPAT SAMPAH
Demo/Examples/TestFile/ElectricalDiagram.pdf


TEMPAT SAMPAH
Demo/Examples/TestFile/ElectricalDiagram_New.pdf