agentleFS
aspose-pdfaspose-pdf/agentic-net-examples/facades-secure-documents/AGENTS.md

agentic-net-examples / facades-secure-documents

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

C# examples for facades-secure-documents using Aspose.PDF for .NET

The file

Files
AGENTS.md

AGENTS - facades-secure-documents

Facades secure documents in PDF using C# / .NET -- 39 verified, compile-tested examples for Aspose.PDF for .NET 26.8.0. Each .cs file is a standalone, build-validated console example, generated and runtime-checked by an AI agent before publishing.

Persona

You are a C# developer specializing in PDF processing using Aspose.PDF for .NET, working within the facades-secure-documents category. This folder contains standalone C# examples for facades-secure-documents operations. See the root agents.md for repository-wide conventions and boundaries.

Scope

  • This folder contains examples for facades-secure-documents.
  • Files are standalone .cs examples stored directly in this folder.

Required Namespaces

  • using Aspose.Pdf.Facades; (38/39 files) ← category-specific
  • using Aspose.Pdf; (24/39 files) ← category-specific
  • using Aspose.Pdf.Text; (3/39 files)
  • using System; (39/39 files)
  • using System.IO; (36/39 files)
  • using Azure.Identity; (1/39 files)
  • using Azure.Security.KeyVault.Secrets; (1/39 files)
  • using NUnit.Framework; (1/39 files)
  • using System.Collections.Generic; (1/39 files)
  • using System.Diagnostics; (1/39 files)

Common Code Pattern

Most files in this category use PdfFileSecurity from Aspose.Pdf.Facades:

PdfFileSecurity tool = new PdfFileSecurity();
tool.BindPdf("input.pdf");
// ... PdfFileSecurity operations ...
tool.Save("output.pdf");

Files in this folder

FileTitleKey APIsDescription
apply-password-protection-to-pdfApply Password Protection to PDF without Loading DocumentPdfFileSecurity, EncryptFile, DocumentPrivilegeShows how to encrypt an existing PDF file with user and owner passwords using the PdfFileSecurity...
batch-decrypt-pdfs-owner-passwordsBatch Decrypt PDFs Using Owner PasswordsPdfFileSecurity, DecryptFile, PdfFileSecurity (constructor)Shows how to read a simple configuration file containing PDF paths and owner passwords, then decr...
batch-encrypt-pdf-filesBatch Encrypt PDF Files with User and Owner PasswordsPdfFileSecurity, EncryptFile, DocumentPrivilegeShows how to encrypt every PDF in a directory using Aspose.Pdf.Facades.PdfFileSecurity with a com...
batch-update-pdf-user-passwordsBatch Update PDF User PasswordsPdfFileSecurity, TryChangePasswordShows how to iterate through a folder of PDF files and change each file's user password to a stan...
change-pdf-passwords-from-csvChange User and Owner Passwords for PDFs from CSVPdfFileSecurity, BindPdf, ChangePasswordShows how to read PDF file paths and passwords from a CSV file and use Aspose.Pdf.Facades.PdfFile...
change-user-and-owner-passwordsChange User and Owner Passwords in PDFPdfFileSecurity, ChangePasswordDemonstrates how to change both the user and owner passwords of an encrypted PDF in a single call...
change-user-password-of-encrypted-pdfChange User Password of Encrypted PDFPdfFileSecurity, ChangePassword, ctorDemonstrates how to update the user password of an already encrypted PDF while keeping the existi...
check-pdf-encryption-and-toggle-protectionCheck PDF Encryption and Apply or Remove ProtectionPdfFileInfo, Document, EncryptThe example shows how to inspect a PDF's IsEncrypted flag using PdfFileInfo, then either encrypt ...
check-pdf-extended-usage-rightsCheck PDF for Extended Usage RightsDocument, PdfFileSignature, BindPdfShows how to use Aspose.Pdf's PdfFileSignature facade to determine if a PDF contains extended usa...
conditional-decrypt-modify-pdfConditional Decrypt and Modify PDF with Aspose.PdfDocument, PdfFileSecurity, DecryptFileThe example loads a PDF, detects if it is encrypted, decrypts it using the owner password when ne...
conditional-pdf-encryption-based-on-filenameConditional PDF Encryption Based on File NamePdfFileSecurity, BindPdf, EncryptFileDemonstrates how to encrypt multiple PDF files using Aspose.Pdf, selecting the key size and encry...
decrypt-pdf-owner-passwordDecrypt PDF Using Owner PasswordPdfFileSecurity, DecryptFileDemonstrates how to remove encryption from a PDF file by providing the owner password using Aspos...
decrypt-pdf-using-owner-password-azure-key-vaultDecrypt PDF Using Owner Password from Azure Key VaultPdfFileSecurity, DecryptFileShows how to retrieve an owner password stored in Azure Key Vault and use Aspose.Pdf.Facades to d...
disable-copying-enable-printing-pdfDisable Copying While Enabling Printing for PDFPdfFileSecurity, SetPrivilege, DocumentPrivilegeDemonstrates using Aspose.Pdf.Facades.PdfFileSecurity to set document privileges so that copying ...
encrypt-decrypt-pdf-roundtripEncrypt and Decrypt PDF with Round‑Trip VerificationPdfFileSecurity, BindPdf, EncryptFileDemonstrates how to encrypt a PDF using a user and owner password, decrypt it back, and verify in...
encrypt-pdf-256-aesEncrypt PDF with 256‑bit AES using Aspose.PdfPdfFileSecurity, EncryptFile, DocumentPrivilegeShows how to encrypt a PDF with 256‑bit AES, set user and owner passwords, and apply a print priv...
encrypt-pdf-aes256-custom-privilegesEncrypt PDF with AES‑256 and Custom PrivilegesPdfFileSecurity, EncryptFile, DocumentPrivilegeDemonstrates encrypting a PDF using AES‑256 while applying custom document privileges such as all...
encrypt-pdf-aes256-uploadEncrypt PDF with AES‑256 and Upload to Cloud StoragePdfFileSecurity, BindPdf, EncryptFileShows how to encrypt a PDF using Aspose.Pdf.Facades with AES‑256 and then upload the encrypted st...
encrypt-pdf-from-byte-arrayEncrypt PDF from Byte Array using Aspose.PdfDocument, PdfFileSecurity, DocumentPrivilegeShows how to load a PDF from a byte array, apply 256‑bit AES encryption with user and owner passw...
encrypt-pdf-rc4-128-print-edit-privilegesEncrypt PDF with RC4‑128 and Enable Print/Edit PrivilegesDocument, DocumentPrivilege, PdfFileSecurityDemonstrates how to combine print and edit privileges, then encrypt a PDF using RC4‑128 with Aspo...
encrypt-pdf-rc4-40Encrypt PDF with RC4‑40 and PasswordPdfFileSecurity, EncryptFile, DocumentPrivilegeShows how to encrypt an existing PDF using the RC4‑40 algorithm with user and owner passwords and...
encrypt-pdf-stream-rc4-40Encrypt PDF Stream with RC4‑40 using Aspose.PdfPdfFileSecurity, BindPdf, EncryptFileShows how to encrypt a PDF supplied as a stream with 40‑bit RC4 encryption using Aspose.Pdf's Pdf...
encrypt-pdf-to-memory-streamEncrypt PDF and Save to MemoryStreamDocument, Encrypt, PermissionsDemonstrates loading a PDF with Aspose.Pdf, applying AES‑256 encryption with user/owner passwords...
encrypt-pdf-with-password-and-capture-exceptionsEncrypt PDF with Password and Capture ExceptionsPdfFileSecurity, AllowExceptions, BindPdfDemonstrates encrypting a PDF using PdfFileSecurity, enabling AllowExceptions to suppress throws,...
encrypt-pdf-with-user-passwordEncrypt PDF with User Password OnlyPdfFileSecurity, EncryptFile, DocumentPrivilegeShows how to encrypt a PDF using Aspose.Pdf.Facades by providing only a user password (owner pass...
encrypt-pdfs-with-performance-timingEncrypt PDFs with Performance TimingPdfFileSecurity, BindPdf, EncryptFileShows how to encrypt PDF files using Aspose.Pdf's PdfFileSecurity facade while measuring the time...
load-pdf-verify-page-count-facadeLoad PDF and Verify Page Count Using PdfFileInfo FacadePdfFileInfo, Document, PagesDemonstrates loading a PDF file via the PdfFileInfo facade class and confirming successful loadin...
pdf-decryption-failure-wrong-owner-password-testUnit Test for PDF Decryption Failure with Incorrect Owner Pa...Document, Page, TextFragmentDemonstrates encrypting a PDF with Aspose.Pdf and writing an NUnit test that asserts DecryptFile ...
pdf-encryption-summaryGenerate PDF Encryption Summary with PrivilegesPdfFileInfo, IsEncrypted, GetDocumentPrivilegeDemonstrates how to inspect PDF files for encryption status, algorithm (when detectable), and doc...
remove-extended-usage-rights-from-signed-pdfRemove Extended Usage Rights from Signed PDFPdfFileSignature, BindPdf, ContainsUsageRightsShows how to load a signed PDF, detect extended usage rights, remove them with PdfFileSignature, ...
...and 9 more files

Category Statistics

  • Total examples: 39

General Tips

  • See parent AGENTS.md for:
    • Boundaries -- Always / Ask First / Never rules for all examples
    • Common Mistakes -- verified anti-patterns that cause build failures
    • Domain Knowledge -- cross-cutting API-specific gotchas
    • Testing Guide -- build and run verification steps
  • Review code examples in this folder for facades-secure-documents patterns
<!-- AUTOGENERATED:START -->

Updated: 2026-08-20 | Run: 20260820_001147_12d7b3

<!-- AUTOGENERATED:END -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.