Skip to content

Commit

Permalink
845229_sample: UG Documentation works for Volume 3 features.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sri-hari-haran-g committed Aug 31, 2023
1 parent 4e61789 commit c25f56a
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// See https://aka.ms/new-console-template for more information
using Syncfusion.Pdf.Parsing;
using Syncfusion.Pdf.Security;
using System.Reflection.Metadata;
//Load a PDF document
FileStream docStream = new FileStream("../../../Input.pdf", FileMode.Open, FileAccess.Read);
PdfLoadedDocument document = new PdfLoadedDocument(docStream);
//Gets the signature field.
PdfLoadedSignatureField signatureField = document.Form.Fields[0] as PdfLoadedSignatureField;
//Validates signature and gets the validation result.
PdfSignatureValidationResult result = signatureField.ValidateSignature();
//Gets signer certificates
PdfSignerCertificate[] certifcate = result.TimeStampInformation.SignerCertificates;
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Retrieve_certificate_information_from_digital_signature</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="100.2.183" />
</ItemGroup>

</Project>
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.6.33829.357
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Retrieve-certificate-information-from-digital-signature", "Retrieve-certificate-information-from-digital-signature.csproj", "{79F1B204-18E8-4702-B47F-16E4E03BDC1E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{79F1B204-18E8-4702-B47F-16E4E03BDC1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79F1B204-18E8-4702-B47F-16E4E03BDC1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79F1B204-18E8-4702-B47F-16E4E03BDC1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79F1B204-18E8-4702-B47F-16E4E03BDC1E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DAFD465E-7F96-4A9E-A75B-5AD6A73F3116}
EndGlobalSection
EndGlobal
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// See https://aka.ms/new-console-template for more information
using Syncfusion.Pdf;
using Syncfusion.Pdf.Parsing;
using Syncfusion.Pdf.Redaction;
using Syncfusion.Drawing;

FileStream docStream = new FileStream("../../../Input.pdf", FileMode.Open, FileAccess.Read);
PdfLoadedDocument document = new PdfLoadedDocument(docStream);
PdfRedaction redaction = new PdfRedaction(new RectangleF(150, 150, 60, 24), Color.Transparent);
//Only the text within the redaction bounds should be redacted.
redaction.TextOnly = true;
foreach (PdfLoadedPage loadedPage in document.Pages)
{
loadedPage.AddRedaction(redaction);
}
document.Redact();
//Save the document
MemoryStream stream = new MemoryStream();
document.Save(stream);
File.WriteAllBytes("Output.pdf", stream.ToArray());
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Redact_text_content_alone_on_the_redated_area</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.Imaging.Net.Core" Version="100.2.9" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="100.2.183" />
</ItemGroup>

</Project>
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.6.33829.357
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Redact-text-content-alone-on-the-redated-area", "Redact-text-content-alone-on-the-redated-area.csproj", "{277A9C40-8E1A-45B8-A569-0FEFBD6DE7F9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{277A9C40-8E1A-45B8-A569-0FEFBD6DE7F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{277A9C40-8E1A-45B8-A569-0FEFBD6DE7F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{277A9C40-8E1A-45B8-A569-0FEFBD6DE7F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{277A9C40-8E1A-45B8-A569-0FEFBD6DE7F9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C883D13A-EAC4-4DC9-9C72-F21DEBA8ABE0}
EndGlobalSection
EndGlobal

0 comments on commit c25f56a

Please sign in to comment.