Skip to content

Commit 458b0f4

Browse files
Merge pull request #1 from SyncfusionExamples/EJDOTNETCORE-4253
EJDOTNETCORE-4253 Added samples and readme files in encrypt and decrypt blog
2 parents 8deb03e + 5fbc145 commit 458b0f4

29 files changed

Lines changed: 735 additions & 2 deletions

Decrypt_PDF/Decrypt_PDF.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.32916.344
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Decrypt_PDF", "Decrypt_PDF\Decrypt_PDF.csproj", "{173EF2F8-3A2C-4941-80EE-54D4780A6336}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{173EF2F8-3A2C-4941-80EE-54D4780A6336}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{173EF2F8-3A2C-4941-80EE-54D4780A6336}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{173EF2F8-3A2C-4941-80EE-54D4780A6336}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{173EF2F8-3A2C-4941-80EE-54D4780A6336}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {2DD26C1C-48B1-49D3-BAB6-88A06A317022}
24+
EndGlobalSection
25+
EndGlobal

Decrypt_PDF/Decrypt_PDF/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>
367 KB
Binary file not shown.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{173EF2F8-3A2C-4941-80EE-54D4780A6336}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>Decrypt_PDF</RootNamespace>
10+
<AssemblyName>Decrypt_PDF</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="Syncfusion.Compression.Base, Version=20.3460.0.59, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
37+
<HintPath>..\packages\Syncfusion.Compression.Base.20.3.0.59\lib\net46\Syncfusion.Compression.Base.dll</HintPath>
38+
</Reference>
39+
<Reference Include="Syncfusion.Licensing, Version=20.3460.0.59, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
40+
<HintPath>..\packages\Syncfusion.Licensing.20.3.0.59\lib\net46\Syncfusion.Licensing.dll</HintPath>
41+
</Reference>
42+
<Reference Include="Syncfusion.Pdf.Base, Version=20.3460.0.59, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
43+
<HintPath>..\packages\Syncfusion.Pdf.AspNet.20.3.0.59\lib\net46\Syncfusion.Pdf.Base.dll</HintPath>
44+
</Reference>
45+
<Reference Include="System" />
46+
<Reference Include="System.Core" />
47+
<Reference Include="System.Xml.Linq" />
48+
<Reference Include="System.Data.DataSetExtensions" />
49+
<Reference Include="Microsoft.CSharp" />
50+
<Reference Include="System.Data" />
51+
<Reference Include="System.Net.Http" />
52+
<Reference Include="System.Xml" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<Compile Include="Program.cs" />
56+
<Compile Include="Properties\AssemblyInfo.cs" />
57+
</ItemGroup>
58+
<ItemGroup>
59+
<None Include="App.config" />
60+
<None Include="packages.config" />
61+
</ItemGroup>
62+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
63+
</Project>

Decrypt_PDF/Decrypt_PDF/Program.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Syncfusion.Pdf.Parsing;
2+
using Syncfusion.Pdf.Security;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace Decrypt_PDF
10+
{
11+
internal class Program
12+
{
13+
static void Main(string[] args)
14+
{
15+
//Load existing PDF document.
16+
PdfLoadedDocument document = new PdfLoadedDocument(@"../../Data/PDF_Succinctly.pdf", "user");
17+
18+
//Create a document security.
19+
PdfSecurity security = document.Security;
20+
21+
//Set permissions to default.
22+
security.Permissions = PdfPermissionsFlags.Default;
23+
//Set owner password.
24+
security.OwnerPassword = String.Empty;
25+
//Set user password.
26+
security.UserPassword = String.Empty;
27+
28+
//Save the PDF document.
29+
document.Save("Output.pdf");
30+
//Close the PDF document.
31+
document.Close(true);
32+
}
33+
}
34+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Decrypt_PDF")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Decrypt_PDF")]
13+
[assembly: AssemblyCopyright("Copyright © 2022")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("173ef2f8-3a2c-4941-80ee-54d4780a6336")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Syncfusion.Compression.Base" version="20.3.0.59" targetFramework="net472" />
4+
<package id="Syncfusion.Licensing" version="20.3.0.59" targetFramework="net472" />
5+
<package id="Syncfusion.Pdf.AspNet" version="20.3.0.59" targetFramework="net472" />
6+
</packages>

Encrypt_PDF/Encrypt_PDF.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.32916.344
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Encrypt_PDF", "Encrypt_PDF\Encrypt_PDF.csproj", "{51413A40-BF82-4A3B-B60D-215A63E18184}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{51413A40-BF82-4A3B-B60D-215A63E18184}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{51413A40-BF82-4A3B-B60D-215A63E18184}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{51413A40-BF82-4A3B-B60D-215A63E18184}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{51413A40-BF82-4A3B-B60D-215A63E18184}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {268B18BA-0618-4CDB-9B0B-E0B2C0EF435C}
24+
EndGlobalSection
25+
EndGlobal

Encrypt_PDF/Encrypt_PDF/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>
363 KB
Binary file not shown.

0 commit comments

Comments
 (0)