How to use IronSecureDoc from C# in .NET
Your Gateway to Enhanced Document Security
IronSoftware.SecureDoc.Client is a robust client-side library designed to interact seamlessly with the IronSecureDoc API, a comprehensive document security solution hosted in a Docker container.
This client library facilitates easy integration into your existing .NET applications, enabling you to leverage the powerful features of IronSecureDoc, including PDF encryption, redaction, and digital signing, all through simple REST API calls.
With IronSoftware.SecureDoc.Client, developers can ensure the security and integrity of documents within their applications, maintaining all operations on-site for enhanced data protection. Whether you need to redact sensitive information, certify documents with digital signatures, or enforce document encryption, IronSoftware.SecureDoc.Client provides the necessary tools to accomplish these tasks efficiently and securely.
Features
Key Features:
- Easy integration with IronSecureDoc's REST API.
- Support for document encryption, redaction, and digital signing.
- Facilitates secure document processing within self-hosted environments.
- Enhances data protection by keeping document security operations on-site.
- Compatible with .NET applications, offering a straightforward approach to secure document management.
Installation
Let's start from installing the NuGet package from the package manager:
Option 1: Download from NuGet
There NuGet package is listed here on the official NuGet website: https://www.nuget.org/packages/IronSoftware.SecureDoc.Client
Option 2: PM Install Command
PM> Install-Package IronSoftware.SecureDoc.Client
Code Example
using IronSecureDoc;
// Replace with your IRONSECUREDOC URL
var client = new IronSecureDocClient("http://localhost:5185");
// Replace with your PDF or CERT paths
string PDF_PATH = "path/to/your.pdf";
string CERT_PATH = "path/to/your.p12";
if (await client.TryConnectAsync())
{
// Redact Text
File.WriteAllBytes(
"redact_text_example.pdf",
await client.RedactTextAsync(PDF_PATH, ["Dummy"])
);
// Redact Region
File.WriteAllBytes(
"redact_region_example.pdf",
await client.RedactRegionAsync(PDF_PATH, 50, 50, 200, 100);
);
// Certify
File.WriteAllBytes(
"certify_example.pdf",
await client.CertifyAsync(PDF_PATH, CERT_PATH, "123456", CertifyPermissions.FormFillingAllowed);
);
// Encrypt
File.WriteAllBytes(
"encrypt_example.pdf",
await client.EncryptAsync(PDF_PATH, "iron");
);
}
using IronSecureDoc;
// Replace with your IRONSECUREDOC URL
var client = new IronSecureDocClient("http://localhost:5185");
// Replace with your PDF or CERT paths
string PDF_PATH = "path/to/your.pdf";
string CERT_PATH = "path/to/your.p12";
if (await client.TryConnectAsync())
{
// Redact Text
File.WriteAllBytes(
"redact_text_example.pdf",
await client.RedactTextAsync(PDF_PATH, ["Dummy"])
);
// Redact Region
File.WriteAllBytes(
"redact_region_example.pdf",
await client.RedactRegionAsync(PDF_PATH, 50, 50, 200, 100);
);
// Certify
File.WriteAllBytes(
"certify_example.pdf",
await client.CertifyAsync(PDF_PATH, CERT_PATH, "123456", CertifyPermissions.FormFillingAllowed);
);
// Encrypt
File.WriteAllBytes(
"encrypt_example.pdf",
await client.EncryptAsync(PDF_PATH, "iron");
);
}
Imports IronSecureDoc
' Replace with your IRONSECUREDOC URL
Private client = New IronSecureDocClient("http://localhost:5185")
' Replace with your PDF or CERT paths
Private PDF_PATH As String = "path/to/your.pdf"
Private CERT_PATH As String = "path/to/your.p12"
If Await client.TryConnectAsync() Then
' Redact Text
File.WriteAllBytes("redact_text_example.pdf", Await client.RedactTextAsync(PDF_PATH, ("Dummy")))
' Redact Region
File.WriteAllBytes("redact_region_example.pdf", Await client.RedactRegionAsync(PDF_PATH, 50, 50, 200, 100);)
' Certify
File.WriteAllBytes("certify_example.pdf", Await client.CertifyAsync(PDF_PATH, CERT_PATH, "123456", CertifyPermissions.FormFillingAllowed);)
' Encrypt
File.WriteAllBytes("encrypt_example.pdf", Await client.EncryptAsync(PDF_PATH, "iron");)
End If
Support
For support please contact us: support@ironsoftware.com