From afb41fe6bc5ff6be2c8cdd023bf7cd976e2f8fcc Mon Sep 17 00:00:00 2001 From: Chinnu M <65020530+chinnumuniyappan@users.noreply.github.com> Date: Tue, 24 Dec 2024 10:38:00 +0530 Subject: [PATCH] Updated samples --- ...Get-annotation-creation-date-from-pdf.sln} | 2 +- .../Data/Input.pdf | Bin 101018 -> 99574 bytes ...-annotation-creation-date-from-pdf.csproj} | 8 ++- .../Program.cs | 22 +++++++ .../.NET/Get-annotation-type-from-pdf.sln} | 2 +- .../Data/Input.pdf | Bin .../Get-annotation-type-from-pdf.csproj} | 8 ++- .../Get-annotation-type-from-pdf/Program.cs | 23 +++++++ .../Program.cs | 35 ----------- .../Program.cs | 57 ------------------ 10 files changed, 61 insertions(+), 96 deletions(-) rename Annotation/{Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf.sln => Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf.sln} (76%) rename Annotation/{Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf => Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf}/Data/Input.pdf (94%) rename Annotation/{Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf/Getting-annotation-creation-date-from-existing-pdf.csproj => Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf/Get-annotation-creation-date-from-pdf.csproj} (61%) create mode 100644 Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf/Program.cs rename Annotation/{Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF.sln => Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf.sln} (78%) rename Annotation/{Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF => Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf}/Data/Input.pdf (100%) rename Annotation/{Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Getting-annotation-type-from-existing-PDF.csproj => Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Get-annotation-type-from-pdf.csproj} (62%) create mode 100644 Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Program.cs delete mode 100644 Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf/Program.cs delete mode 100644 Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Program.cs diff --git a/Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf.sln b/Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf.sln similarity index 76% rename from Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf.sln rename to Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf.sln index 58bf25fd..6f2dd042 100644 --- a/Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf.sln +++ b/Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.12.35527.113 d17.12 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Getting-annotation-creation-date-from-existing-pdf", "Getting-annotation-creation-date-from-existing-pdf\Getting-annotation-creation-date-from-existing-pdf.csproj", "{99C4DAFC-5512-4A2B-AAE0-9CF0464BBD1C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Get-annotation-creation-date-from-pdf", "Get-annotation-creation-date-from-pdf\Get-annotation-creation-date-from-pdf.csproj", "{99C4DAFC-5512-4A2B-AAE0-9CF0464BBD1C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf/Data/Input.pdf b/Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf/Data/Input.pdf similarity index 94% rename from Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf/Data/Input.pdf rename to Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf/Data/Input.pdf index d98d79adada49e90a9147c5fd688a7e2d0574f1a..2ab406b83cf3c8a70577eac8e69127014fdaca93 100644 GIT binary patch delta 2793 zcmYjTc{tSD8~3%0F-(S(B{Y^w8DsWE%GzWt#+s~S$i5e4nJ$wIQkI&sRFY`1D`mMt zDJHp=WWScm5-B2CX6|(Fb$`D<&hx(KJm-Bs&-px`&-ssuho8PE?1CGZ4puT64^CZpUMprfL?=I4cpE9Xvg8=j1Xgnn zX~s*$e>G_?W`RQjlju^ZKssbzrRxAwD!{q<@Z4dlq2P{u5h_z*gDTzhR8>|sBIGDZ zJpXO=pFhl3El@&??CI(o%j*%s%hU9jd+L|H=A5-1!@6t|Up9Q*|HmQU{!D4JLy4Ea zY15**6OToy)Wqp%~GoP#OM_Uf>y6&pX zSvYz0RFFfr{9BN3_EqI?Nl91Y25Yl)2TqSq=XJO^t$F%?mS>!&#b03#_u@Y@m4`xG z$FCo&jPZPbb<)qlHQFM=S4=PYsUj>+#y-!p!dOPCC*o`EIg^RS8yYWX3P<81+Gd}r z1JAi*56W+jrKa_rv4icO)-dOcqlP-7TYVN1hG-Izi286E@jUVP+&SH)#ESfSF@${y)BMif6F(H$B@Cy&oq>MlXGa)FskVlk5Eb^AB7!=?2#N@K-H z^3{{~U}o!%B%>^E=+d z3pO%lXv(@Sido;>YnhPgc-tpn{EClOcv-hs;@n+HQyr6(yDpbA>NT`)1&$VbbXxL8 z^GkyRl~n1*4RA^f@7M?Jx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ting_annotation_creation_date_from_existing_pdf + Get-annotation-creation-date-from-pdf enable enable @@ -12,4 +12,10 @@ + + + PreserveNewest + + + diff --git a/Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf/Program.cs b/Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf/Program.cs new file mode 100644 index 00000000..62a789f1 --- /dev/null +++ b/Annotation/Get-annotation-creation-date-from-PDF/.NET/Get-annotation-creation-date-from-pdf/Program.cs @@ -0,0 +1,22 @@ +using Syncfusion.Pdf.Interactive; +using Syncfusion.Pdf.Parsing; +using Syncfusion.Pdf; + +// Load the PDF document +using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) +{ + using (PdfLoadedDocument document = new PdfLoadedDocument(inputStream)) + { + + //Get the first page from the document + PdfLoadedPage firstPage = document.Pages[0] as PdfLoadedPage; + + //Get the annotation on that page + PdfLoadedAnnotation annotation = firstPage.Annotations[1] as PdfLoadedAnnotation; + + //Get the annotation creation date. + DateTime creationDate = annotation.CreationDate; + + Console.WriteLine("Annotation Creation Date: " + creationDate); + } +} diff --git a/Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF.sln b/Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf.sln similarity index 78% rename from Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF.sln rename to Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf.sln index 5753f77e..f6a5aa9f 100644 --- a/Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF.sln +++ b/Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.12.35527.113 d17.12 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Getting-annotation-type-from-existing-PDF", "Getting-annotation-type-from-existing-PDF\Getting-annotation-type-from-existing-PDF.csproj", "{8985CAE2-2683-4690-BFA7-3A2A16065CBD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Get-annotation-type-from-pdf", "Get-annotation-type-from-pdf\Get-annotation-type-from-pdf.csproj", "{8985CAE2-2683-4690-BFA7-3A2A16065CBD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Data/Input.pdf b/Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Data/Input.pdf similarity index 100% rename from Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Data/Input.pdf rename to Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Data/Input.pdf diff --git a/Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Getting-annotation-type-from-existing-PDF.csproj b/Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Get-annotation-type-from-pdf.csproj similarity index 62% rename from Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Getting-annotation-type-from-existing-PDF.csproj rename to Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Get-annotation-type-from-pdf.csproj index 1043569a..39c536f9 100644 --- a/Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Getting-annotation-type-from-existing-PDF.csproj +++ b/Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Get-annotation-type-from-pdf.csproj @@ -3,7 +3,7 @@ Exe net8.0 - Getting_annotation_type_from_existing_PDF + Get-annotation-type-from-pdf enable enable @@ -12,4 +12,10 @@ + + + PreserveNewest + + + diff --git a/Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Program.cs b/Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Program.cs new file mode 100644 index 00000000..7ccb4106 --- /dev/null +++ b/Annotation/Get-annotation-type-from-pdf/.NET/Get-annotation-type-from-pdf/Program.cs @@ -0,0 +1,23 @@ +using Syncfusion.Pdf.Interactive; +using Syncfusion.Pdf.Parsing; +using Syncfusion.Pdf; + +// Load the PDF document using a file stream +using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) +{ + using (PdfLoadedDocument document = new PdfLoadedDocument(inputStream)) + { + //Get the pages of the PDF file + for (int i = 0; i < document.PageCount; i++) + { + Console.WriteLine("Page Number: " + i); + PdfLoadedPage page = document.Pages[i] as PdfLoadedPage; + + //Get the annotation type. + foreach (PdfLoadedAnnotation annotation in page.Annotations) + { + Console.WriteLine("Annotation Type: " + annotation.Type.ToString()); + } + } + } +} \ No newline at end of file diff --git a/Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf/Program.cs b/Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf/Program.cs deleted file mode 100644 index 8f748fe7..00000000 --- a/Annotation/Getting-annotation-creation-date-from-existing-pdf/.NET/Getting-annotation-creation-date-from-existing-pdf/Program.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Syncfusion.Pdf.Interactive; -using Syncfusion.Pdf.Parsing; -using Syncfusion.Pdf; - -// Load the PDF document -FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read); -PdfLoadedDocument document = new PdfLoadedDocument(inputStream); -// Load the collection of pages in the PDF document -PdfLoadedPageCollection loadedPages = document.Pages; - -// Iterate through all the pages in the document -for (int i = 0; i < loadedPages.Count; i++) -{ - // Access the current page - PdfLoadedPage loadedPage = loadedPages[i] as PdfLoadedPage; - // Access the annotation collection on the current page - PdfLoadedAnnotationCollection annotations = loadedPage.Annotations; - // Get the total number of annotations on the current page - int numAnnotations = annotations.Count; - // Iterate through all annotations on the current page - for (int j = 0; j < numAnnotations; j++) - { - // Iterate through rectangle annotations - if (annotations[j].GetType().ToString() == "Syncfusion.Pdf.Interactive.PdfLoadedRectangleAnnotation") - { - // Handle rectangle annotation - PdfLoadedRectangleAnnotation rectangleAnnot = annotations[j] as PdfLoadedRectangleAnnotation; - DateTime creationDate = rectangleAnnot.CreationDate; - Console.WriteLine(creationDate); - } - } -} -//Close the document -document.Close(true); -inputStream.Dispose(); diff --git a/Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Program.cs b/Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Program.cs deleted file mode 100644 index b93edc95..00000000 --- a/Annotation/Getting-annotation-type-from-existing-PDF/.NET/Getting-annotation-type-from-existing-PDF/Program.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Syncfusion.Pdf.Interactive; -using Syncfusion.Pdf.Parsing; -using Syncfusion.Pdf; - -// Load the PDF document using a file stream -FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read); -PdfLoadedDocument document = new PdfLoadedDocument(inputStream); - -// Load the page collection from the PDF document -PdfLoadedPageCollection loadedPages = document.Pages; - -// Iterate through all pages in the document -for (int i = 0; i < loadedPages.Count; i++) -{ - // Access each page - PdfLoadedPage loadedPage = loadedPages[i] as PdfLoadedPage; - - // Check if the page contains annotations - if (loadedPage.Annotations.Count > 0) - { - // Iterate through each annotation on the page - foreach (PdfLoadedAnnotation annot in loadedPage.Annotations) - { - // Identify the type of the annotation - PdfLoadedAnnotationType annotationType; - - if (annot is PdfLoadedRectangleAnnotation) - { - annotationType = PdfLoadedAnnotationType.RectangleAnnotation; - } - else if (annot is PdfLoadedTextMarkupAnnotation) - { - annotationType = PdfLoadedAnnotationType.TextMarkupAnnotation; - } - else if (annot is PdfLoadedTextWebLinkAnnotation) - { - annotationType = PdfLoadedAnnotationType.TextWebLinkAnnotation; - } - else if (annot is PdfLoadedPopupAnnotation) - { - annotationType = PdfLoadedAnnotationType.PopupAnnotation; - } - else - { - annotationType = PdfLoadedAnnotationType.Null; - } - - // Print the annotation type to the console - Console.WriteLine(annotationType); - } - } -} - -// Close the document and release resources -document.Close(true); -inputStream.Dispose(); -Console.ReadKey(); \ No newline at end of file