-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0e933a
commit e1c959d
Showing
15 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...ting-Newly-Added-Annotations-FDF-File/.NET/Exporting-Newly-Added-Annotations-FDF-File.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
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}") = "Exporting-Newly-Added-Annotations-FDF-File", "Exporting-Newly-Added-Annotations-FDF-File\Exporting-Newly-Added-Annotations-FDF-File.csproj", "{3896C029-44A0-4B6F-BCB5-B6AC57A6305E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{3896C029-44A0-4B6F-BCB5-B6AC57A6305E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3896C029-44A0-4B6F-BCB5-B6AC57A6305E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3896C029-44A0-4B6F-BCB5-B6AC57A6305E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3896C029-44A0-4B6F-BCB5-B6AC57A6305E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Binary file added
BIN
+5.55 KB
...Added-Annotations-FDF-File/.NET/Exporting-Newly-Added-Annotations-FDF-File/Data/Input.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
...orting-Newly-Added-Annotations-FDF-File/Exporting-Newly-Added-Annotations-FDF-File.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Exporting_Newly_Added_Annotations_FDF_File</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Empty file.
30 changes: 30 additions & 0 deletions
30
...wly-Added-Annotations-FDF-File/.NET/Exporting-Newly-Added-Annotations-FDF-File/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
| ||
using Syncfusion.Drawing; | ||
using Syncfusion.Pdf.Graphics; | ||
using Syncfusion.Pdf.Interactive; | ||
using Syncfusion.Pdf.Parsing; | ||
|
||
//Load the PDF document from a file stream | ||
using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) | ||
using (PdfLoadedDocument pdfLoadedDocument = new PdfLoadedDocument(docStream)) | ||
{ | ||
//Create a PDF free text annotation | ||
PdfFreeTextAnnotation freeText = new PdfFreeTextAnnotation(new RectangleF(10, 0, 50, 50)); | ||
|
||
//Set properties for the annotation | ||
freeText.MarkupText = "Free Text with Callout"; //Text displayed as markup | ||
freeText.TextMarkupColor = new PdfColor(Color.Black); //Set the text markup color | ||
freeText.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 7f); //Set font and size | ||
freeText.Color = new PdfColor(Color.Yellow); //Set background color | ||
freeText.BorderColor = new PdfColor(Color.Red); //Set border color | ||
freeText.Border = new PdfAnnotationBorder(0.5f); //Set border thickness | ||
|
||
//Add the annotation to the first page of the PDF | ||
pdfLoadedDocument.Pages[0].Annotations.Add(freeText); | ||
|
||
//Export annotations to the FDF format and save to a file using a file stream | ||
using (FileStream fdfFileStream = new FileStream(Path.GetFullPath(@"Output\Output.fdf"), FileMode.Create, FileAccess.Write)) | ||
{ | ||
pdfLoadedDocument.ExportAnnotations(fdfFileStream, AnnotationDataFormat.Fdf); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...ng-Newly-Added-Annotations-JSON-File/.NET/Exporting-Newly-Added-Annotations-JSON-File.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
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}") = "Exporting-Newly-Added-Annotations-JSON-File", "Exporting-Newly-Added-Annotations-JSON-File\Exporting-Newly-Added-Annotations-JSON-File.csproj", "{7E08A7B9-AAFF-4646-87FA-F5CCF3B3C69B}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7E08A7B9-AAFF-4646-87FA-F5CCF3B3C69B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7E08A7B9-AAFF-4646-87FA-F5CCF3B3C69B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7E08A7B9-AAFF-4646-87FA-F5CCF3B3C69B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7E08A7B9-AAFF-4646-87FA-F5CCF3B3C69B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Binary file added
BIN
+5.55 KB
...ded-Annotations-JSON-File/.NET/Exporting-Newly-Added-Annotations-JSON-File/Data/Input.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
...ting-Newly-Added-Annotations-JSON-File/Exporting-Newly-Added-Annotations-JSON-File.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Exporting_Newly_Added_Annotations_JSON_File</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Empty file.
29 changes: 29 additions & 0 deletions
29
...y-Added-Annotations-JSON-File/.NET/Exporting-Newly-Added-Annotations-JSON-File/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Syncfusion.Drawing; | ||
using Syncfusion.Pdf.Graphics; | ||
using Syncfusion.Pdf.Interactive; | ||
using Syncfusion.Pdf.Parsing; | ||
|
||
//Load the PDF document from a file stream | ||
using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) | ||
using (PdfLoadedDocument pdfLoadedDocument = new PdfLoadedDocument(docStream)) | ||
{ | ||
//Create a PDF free text annotation | ||
PdfFreeTextAnnotation freeText = new PdfFreeTextAnnotation(new RectangleF(10, 0, 50, 50)); | ||
|
||
//Set properties for the annotation | ||
freeText.MarkupText = "Free Text with Callout"; //Text displayed as markup | ||
freeText.TextMarkupColor = new PdfColor(Color.Black); //Set the text markup color | ||
freeText.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 7f); //Set font and size | ||
freeText.Color = new PdfColor(Color.Yellow); //Set background color | ||
freeText.BorderColor = new PdfColor(Color.Red); //Set border color | ||
freeText.Border = new PdfAnnotationBorder(0.5f); //Set border thickness | ||
|
||
//Add the annotation to the first page of the PDF | ||
pdfLoadedDocument.Pages[0].Annotations.Add(freeText); | ||
|
||
//Export annotations to the JSON format and save to a file using a file stream | ||
using (FileStream jsonFileStream = new FileStream(Path.GetFullPath(@"Output\Output.json"), FileMode.Create, FileAccess.Write)) | ||
{ | ||
pdfLoadedDocument.ExportAnnotations(jsonFileStream, AnnotationDataFormat.Json); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...ng-Newly-Added-Annotations-XFDF-File/.NET/Exporting-Newly-Added-Annotations-XFDF-File.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
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}") = "Exporting-Newly-Added-Annotations-XFDF-File", "Exporting-Newly-Added-Annotations-XFDF-File\Exporting-Newly-Added-Annotations-XFDF-File.csproj", "{5351DD92-0CDF-4645-B3D9-0FB14EEF738C}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{5351DD92-0CDF-4645-B3D9-0FB14EEF738C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{5351DD92-0CDF-4645-B3D9-0FB14EEF738C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{5351DD92-0CDF-4645-B3D9-0FB14EEF738C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{5351DD92-0CDF-4645-B3D9-0FB14EEF738C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Binary file added
BIN
+5.55 KB
...ded-Annotations-XFDF-File/.NET/Exporting-Newly-Added-Annotations-XFDF-File/Data/Input.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
...ting-Newly-Added-Annotations-XFDF-File/Exporting-Newly-Added-Annotations-XFDF-File.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Exporting_Newly_Added_Annotations_XFDF_File</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Empty file.
29 changes: 29 additions & 0 deletions
29
...y-Added-Annotations-XFDF-File/.NET/Exporting-Newly-Added-Annotations-XFDF-File/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Syncfusion.Drawing; | ||
using Syncfusion.Pdf.Graphics; | ||
using Syncfusion.Pdf.Interactive; | ||
using Syncfusion.Pdf.Parsing; | ||
|
||
//Load the PDF document from a file stream | ||
using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) | ||
using (PdfLoadedDocument pdfLoadedDocument = new PdfLoadedDocument(docStream)) | ||
{ | ||
//Create a PDF free text annotation | ||
PdfFreeTextAnnotation freeText = new PdfFreeTextAnnotation(new RectangleF(10, 0, 50, 50)); | ||
|
||
//Set properties for the annotation | ||
freeText.MarkupText = "Free Text with Callout"; //Text displayed as markup | ||
freeText.TextMarkupColor = new PdfColor(Color.Black); //Set the text markup color | ||
freeText.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 7f); //Set font and size | ||
freeText.Color = new PdfColor(Color.Yellow); //Set background color | ||
freeText.BorderColor = new PdfColor(Color.Red); //Set border color | ||
freeText.Border = new PdfAnnotationBorder(0.5f); //Set border thickness | ||
|
||
//Add the annotation to the first page of the PDF | ||
pdfLoadedDocument.Pages[0].Annotations.Add(freeText); | ||
|
||
//Export annotations to the XFDF format and save to a file using a file stream | ||
using (FileStream xfdfFileStream = new FileStream(Path.GetFullPath(@"Output\Output.xfdf"), FileMode.Create, FileAccess.Write)) | ||
{ | ||
pdfLoadedDocument.ExportAnnotations(xfdfFileStream, AnnotationDataFormat.XFdf); | ||
} | ||
} |