-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
911183: Added volume 3 feature samples.
- Loading branch information
1 parent
ecd40b6
commit 40c2c58
Showing
15 changed files
with
187 additions
and
65 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...ircle-annotation-in-the-PDF/.NET/Add-cloud-border-styled-circle-annotation-in-the-PDF.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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.11.35219.272 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Add-cloud-border-styled-circle-annotation-in-the-PDF", "Add-cloud-border-styled-circle-annotation-in-the-PDF\Add-cloud-border-styled-circle-annotation-in-the-PDF.csproj", "{E80AEF8E-84CC-44AB-AE2C-524A4AE82696}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{E80AEF8E-84CC-44AB-AE2C-524A4AE82696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{E80AEF8E-84CC-44AB-AE2C-524A4AE82696}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{E80AEF8E-84CC-44AB-AE2C-524A4AE82696}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{E80AEF8E-84CC-44AB-AE2C-524A4AE82696}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {26638CAE-A8D9-4A36-9F37-B3BD7A414210} | ||
EndGlobalSection | ||
EndGlobal |
21 changes: 21 additions & 0 deletions
21
...-circle-annotation-in-the-PDF/Add-cloud-border-styled-circle-annotation-in-the-PDF.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,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Add_cloud_border_styled_circle_annotation_in_the_PDF</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="Output\.gitkeep"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
Empty file.
41 changes: 41 additions & 0 deletions
41
...nnotation-in-the-PDF/.NET/Add-cloud-border-styled-circle-annotation-in-the-PDF/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,41 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using Syncfusion.Pdf.Interactive; | ||
using Syncfusion.Pdf; | ||
using Syncfusion.Drawing; | ||
|
||
//Create a new PDF document | ||
PdfDocument document = new PdfDocument(); | ||
//Add a new page | ||
PdfPage page = document.Pages.Add(); | ||
//Create a new circle annotation | ||
PdfCircleAnnotation annotation = new PdfCircleAnnotation(new RectangleF(0, 0, 200, 200), "Circle"); | ||
//Assign the border width | ||
annotation.Border.BorderWidth = 1; | ||
//Assign the color | ||
annotation.Color = Color.Red; | ||
//Assign the InnerColor | ||
annotation.InnerColor = Color.Blue; | ||
//Create a new PdfBorderEffect class | ||
PdfBorderEffect bordereffect = new PdfBorderEffect(); | ||
//Assign the intensity value | ||
bordereffect.Intensity = 2; | ||
//Assign the cloud style | ||
bordereffect.Style = PdfBorderEffectStyle.Cloudy; | ||
//Assign the BorderEffect to the annotation | ||
annotation.BorderEffect = bordereffect; | ||
//Set appearance for the annotation | ||
annotation.SetAppearance(true); | ||
//Adds the annotation to the page | ||
page.Annotations.Add(annotation); | ||
|
||
//Create file stream. | ||
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Save the PDF document to file stream. | ||
document.Save(outputFileStream); | ||
} | ||
|
||
//Close the document. | ||
document.Close(true); | ||
|
25 changes: 25 additions & 0 deletions
25
...ipse-annotation-in-the-PDF/.NET/Add-cloud-border-styled-ellipse-annotation-in-the-PDF.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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.11.35219.272 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Add-cloud-border-styled-ellipse-annotation-in-the-PDF", "Add-cloud-border-styled-ellipse-annotation-in-the-PDF\Add-cloud-border-styled-ellipse-annotation-in-the-PDF.csproj", "{9DCFB496-350A-439F-AA19-9DFFBF3A542B}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{9DCFB496-350A-439F-AA19-9DFFBF3A542B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{9DCFB496-350A-439F-AA19-9DFFBF3A542B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{9DCFB496-350A-439F-AA19-9DFFBF3A542B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{9DCFB496-350A-439F-AA19-9DFFBF3A542B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {4841D089-BFAC-4027-A297-80B2E9EC4B7A} | ||
EndGlobalSection | ||
EndGlobal |
21 changes: 21 additions & 0 deletions
21
...llipse-annotation-in-the-PDF/Add-cloud-border-styled-ellipse-annotation-in-the-PDF.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,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Add_cloud_border_styled_ellipse_annotation_in_the_PDF</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="Output\.gitkeep"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
Empty file.
40 changes: 40 additions & 0 deletions
40
...notation-in-the-PDF/.NET/Add-cloud-border-styled-ellipse-annotation-in-the-PDF/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,40 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using Syncfusion.Pdf.Interactive; | ||
using Syncfusion.Pdf; | ||
using Syncfusion.Drawing; | ||
|
||
//Create a new PDF document | ||
PdfDocument document = new PdfDocument(); | ||
//Add a new page | ||
PdfPage page = document.Pages.Add(); | ||
// create a new ellipse annotation | ||
PdfEllipseAnnotation annotation = new PdfEllipseAnnotation(new RectangleF(0, 0, 200, 100), "Ellipse"); | ||
//Assign the border width | ||
annotation.Border.BorderWidth = 1; | ||
//Assign the color | ||
annotation.Color = Color.Red; | ||
//Assign the InnerColor | ||
annotation.InnerColor = Color.Blue; | ||
//Create a new PdfBorderEffect class | ||
PdfBorderEffect bordereffect = new PdfBorderEffect(); | ||
//Assign the intensity value | ||
bordereffect.Intensity = 2; | ||
//Assign the cloud style | ||
bordereffect.Style = PdfBorderEffectStyle.Cloudy; | ||
//Assign the BorderEffect | ||
annotation.BorderEffect = bordereffect; | ||
//Set appearance for the annotation. | ||
annotation.SetAppearance(true); | ||
// Adds the annotation to the page. | ||
page.Annotations.Add(annotation); | ||
|
||
//Create file stream. | ||
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Save the PDF document to file stream. | ||
document.Save(outputFileStream); | ||
} | ||
|
||
//Close the document. | ||
document.Close(true); |
Binary file modified
BIN
+16.6 KB
(200%)
...documents-externally/.NET/Create-LTV-when-signing-PDF-documents-externally/Data/Input.pdf
Binary file not shown.
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
Binary file added
BIN
+33.2 KB
Digital Signature/Enable-LTV-PDF-signature/.NET/Enable-LTV-PDF-signature/Data/Input.pdf
Binary file not shown.
Binary file removed
BIN
-2.78 KB
Digital Signature/Enable-LTV-PDF-signature/.NET/Enable-LTV-PDF-signature/Data/PDF.pfx
Binary file not shown.
Binary file removed
BIN
-20.9 KB
...Enable-LTV-PDF-signature/.NET/Enable-LTV-PDF-signature/Data/syncfusion_logo.png
Binary file not shown.
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
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 |
---|---|---|
|
@@ -3,55 +3,30 @@ | |
using Syncfusion.Drawing; | ||
using Syncfusion.Pdf; | ||
using Syncfusion.Pdf.Graphics; | ||
using Syncfusion.Pdf.Parsing; | ||
using Syncfusion.Pdf.Security; | ||
|
||
//Creates a new PDF document. | ||
PdfDocument document = new PdfDocument(); | ||
//Get the stream from the document. | ||
FileStream documentStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read); | ||
|
||
//Adds a new page. | ||
PdfPageBase page = document.Pages.Add(); | ||
//Load an existing PDF document. | ||
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(documentStream); | ||
|
||
//Create graphics for the page. | ||
PdfGraphics graphics = page.Graphics; | ||
|
||
//Creates a certificate instance from PFX file with private key. | ||
FileStream certificateStream = new FileStream(Path.GetFullPath(@"Data/PDF.pfx"), FileMode.Open, FileAccess.Read); | ||
PdfCertificate pdfCert = new PdfCertificate(certificateStream, "DigitalPass123"); | ||
|
||
//Creates a digital signature. | ||
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature"); | ||
signature.Settings.CryptographicStandard = CryptographicStandard.CADES; | ||
signature.Settings.DigestAlgorithm = DigestAlgorithm.SHA256; | ||
|
||
|
||
//Sets an image for signature field. | ||
FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/syncfusion_logo.png"), FileMode.Open, FileAccess.Read); | ||
|
||
//Sets an image for signature field. | ||
PdfBitmap image = new PdfBitmap(imageStream); | ||
|
||
//Adds time stamp by using the server URI and credentials. | ||
signature.TimeStampServer = new TimeStampServer(new Uri("http://time.certum.pl/ ")); | ||
//Gets the first signature field of the PDF document | ||
PdfLoadedSignatureField signatureField = loadedDocument.Form.Fields[0] as PdfLoadedSignatureField; | ||
PdfSignature signature = signatureField.Signature; | ||
|
||
//Enable LTV on Signature. | ||
signature.EnableLtv = true; | ||
|
||
//Sets signature info. | ||
signature.Bounds = new RectangleF(new PointF(0, 0), image.PhysicalDimension); | ||
signature.ContactInfo = "[email protected]"; | ||
signature.LocationInfo = "Honolulu, Hawaii"; | ||
signature.Reason = "I am author of this document."; | ||
|
||
//Draws the signature image. | ||
signature.Appearance.Normal.Graphics.DrawImage(image, 0, 0); | ||
|
||
//Create file stream. | ||
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Save the PDF document to file stream. | ||
document.Save(outputFileStream); | ||
loadedDocument.Save(outputFileStream); | ||
} | ||
|
||
//Close the document. | ||
document.Close(true); | ||
loadedDocument.Close(true); | ||
|