Skip to content

Commit

Permalink
Updated samples
Browse files Browse the repository at this point in the history
  • Loading branch information
chinnumuniyappan committed Dec 24, 2024
1 parent ff9269c commit afb41fe
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Getting_annotation_creation_date_from_existing_pdf</RootNamespace>
<RootNamespace>Get-annotation-creation-date-from-pdf</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -12,4 +12,10 @@
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\Input.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Getting_annotation_type_from_existing_PDF</RootNamespace>
<RootNamespace>Get-annotation-type-from-pdf</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -12,4 +12,10 @@
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\Input.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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());
}
}
}
}

This file was deleted.

This file was deleted.

0 comments on commit afb41fe

Please sign in to comment.