agentic-net-examples / facades-sign-documents
AGENTS.md2 starsChanged 4 months agoMITView on GitHub
C# examples for facades-sign-documents using Aspose.PDF for .NET
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository36 other files it gives its agents.
- accessibility-and-tagged-pdfsAGENTS.md
- aspose-pdf-examplesAGENTS.md
- basic-operationsAGENTS.md
- compare-pdfAGENTS.md
- conversionAGENTS.md
- documentAGENTS.md
- facades-acroformsAGENTS.md
- facades-annotationsAGENTS.md
- facades-bookmarksAGENTS.md
- facades-convert-documentsAGENTS.md
- facades-documentsAGENTS.md
- facades-edit-documentAGENTS.md
- facades-extract-images-and-textAGENTS.md
- facades-fill-formsAGENTS.md
- facades-formsAGENTS.md
- facades-metadataAGENTS.md
- facades-pagesAGENTS.md
- facades-secure-documentsAGENTS.md
- facades-stampsAGENTS.md
- facades-texts-and-imagesAGENTS.md
- facades-xmp-metadataAGENTS.md
- graphs-zugferd-operatorsAGENTS.md
- pagesAGENTS.md
- parse-pdfAGENTS.md
- securing-and-signing-pdfAGENTS.md
- stampingAGENTS.md
- uncategorizedAGENTS.md
- working-with-annotationsAGENTS.md
- working-with-attachmentsAGENTS.md
- working-with-formsAGENTS.md
- working-with-graphsAGENTS.md
- working-with-imagesAGENTS.md
- working-with-tablesAGENTS.md
- working-with-textAGENTS.md
- working-with-xmlAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 1 is common, 2 are distinctive, and 0 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 101
Create a PdfFileInfo for {input_pdf} and read its IsEncrypted property to obtain a {bool} indicating whether the PDF is encrypted …
- Distinctive: line 102
Use PdfFileInfo instead of loading a full Document when only document metadata such as encryption status is needed.
- Distinctive: line 104
After decryption, call Save({output_pdf}) on the PdfFileSecurity instance to write the unprotected PDF to disk.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS - facades-sign-documents
Facades sign documents in PDF using C# / .NET -- 34 verified, compile-tested examples for Aspose.PDF for .NET 26.8.0. Each
.csfile 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-sign-documents category. This folder contains standalone C# examples for facades-sign-documents operations. See the root agents.md for repository-wide conventions and boundaries.
Scope
- This folder contains examples for facades-sign-documents.
- Files are standalone
.csexamples stored directly in this folder.
Required Namespaces
using Aspose.Pdf.Facades;(34/34 files) ← category-specificusing Aspose.Pdf;(11/34 files)using Aspose.Pdf.Forms;(9/34 files)using Aspose.Pdf.Text;(1/34 files)using System;(34/34 files)using System.IO;(28/34 files)using System.Drawing;(10/34 files)using System.Collections.Generic;(5/34 files)using System.Security.Cryptography.X509Certificates;(4/34 files)using System.Globalization;(2/34 files)using System.Security.Cryptography;(2/34 files)using System.Drawing.Imaging;(1/34 files)using System.Text;(1/34 files)using System.Text.Json;(1/34 files)using System.Threading;(1/34 files)
Files in this folder
| File | Title | Key APIs | Description |
| add-digital-signature-to-pdf-page | Add Digital Signature to First PDF Page | PdfFileSignature, BindPdf, SetCertificate | Demonstrates how to bind a PDF, set a certificate, and apply a visible digital signature to page ... |
| add-second-digital-signature-to-pdf-page-3 | Add Second Digital Signature to PDF Page 3 | PdfFileSignature, BindPdf, SetCertificate | Demonstrates adding a second visible digital signature on page three of an existing PDF using Asp... |
| add-signature-field-and-sign-pdf | Create Signature Field and Sign PDF Document | Document, AddField, PdfFileSignature | Demonstrates how to add an empty digital signature field to a specific page of a PDF using Aspose... |
| configure-custom-signature-appearance | Configure Custom Signature Appearance with Background Color ... | PdfFileSignature, BindPdf, Sign | Demonstrates how to set a custom signature appearance by adding a foreground image and a backgrou... |
| custom-pdf-signature-appearance | Create Custom PDF Signature Appearance Without Caption | PdfFileSignature, BindPdf, Sign | Demonstrates signing a PDF with Aspose.Pdf using a PKCS#1 signature and a custom appearance that ... |
| extract-certificate-details-from-pdf-signatures | Extract Certificate Details from PDF Signatures | PdfFileSignature, BindPdf, GetSignatureNames | Demonstrates how to load a signed PDF, enumerate its digital signatures, and retrieve the X.509 c... |
| extract-certificate-serial-number-from-pdf-signatu... | Extract Certificate Serial Number from PDF Signatures | PdfFileSignature, BindPdf, ContainsSignature | Demonstrates how to open a signed PDF, enumerate its digital signatures, extract the associated X... |
| extract-signature-images-html-report | Extract Signature Images to HTML Report | PdfFileSignature, BindPdf, GetSignatureNames | Demonstrates how to retrieve signature images from a signed PDF using Aspose.Pdf.Facades and embe... |
| extract-signing-certificate-from-pdf | Extract Signing Certificate from PDF Signature Field | PdfFileSignature, BindPdf, ExtractCertificate | Shows how to bind a PDF, extract the X.509 signing certificate from a specific signature field, a... |
| extract-witness-signature-image | Extract Witness Signature Image from PDF | PdfFileSignature, BindPdf, ExtractImage | Demonstrates how to locate a signature field named 'WitnessSignature' in a PDF, extract its image... |
| generate-pdf-signature-report | Generate PDF Signature Verification Report | PdfFileSignature, BindPdf, GetSignatureNames | Creates a PDF document that enumerates all digital signatures in a source PDF, displaying signer,... |
| hide-pdf-signature-appearance | Hide PDF Signature Appearance While Keeping It Valid | PdfFileSignature, BindPdf, SetCertificate | Demonstrates signing a PDF with Aspose.Pdf and making the signature invisible by setting the visi... |
| list-signature-names-in-pdf | List Signature Names in a PDF Document | PdfFileSignature, BindPdf, GetSignatureNames | Demonstrates how to use Aspose.Pdf.Facades to open a PDF file and retrieve all non‑empty signatur... |
| list-signature-reasons-and-locations | List Signature Reasons and Locations in a PDF | PdfFileSignature, BindPdf, GetSignatureNames | Shows how to bind a PDF with Aspose.Pdf.Facades, enumerate its digital signatures, and retrieve e... |
| locale-specific-pdf-digital-signature | Locale‑Specific PDF Digital Signature with Custom Appearance | PdfFileSignature, PKCS7, SignatureCustomAppearance | Demonstrates how to digitally sign a PDF using Aspose.Pdf with appearance text localized for Germ... |
| log-pdf-signature-verification-to-json | Log PDF Signature Verification Results to JSON | PdfFileSignature, BindPdf, GetSignatureNames | Demonstrates how to verify each digital signature in a PDF using Aspose.Pdf.Facades and write the... |
| remove-all-signatures-from-pdf | Remove All Signatures from PDF | PdfFileSignature, BindPdf, RemoveSignatures | Shows how to load a PDF, remove every digital signature using Aspose.Pdf.Facades, and save a clea... |
| remove-all-signatures-from-pdfs | Remove All Signatures from PDFs Recursively | PdfFileSignature, BindPdf, RemoveSignatures | Demonstrates how to traverse a directory tree, load each PDF with Aspose.Pdf.Facades, remove all ... |
| remove-and-replace-pdf-signature | Remove Existing Signature and Apply New PDF Signature | PdfFileSignature, BindPdf, RemoveSignatures | Shows how to delete all existing signatures from a PDF and then sign the document with a new cert... |
| remove-pdf-signature-missing-handling | Remove PDF Signature with Missing Signature Handling | PdfFileSignature, BindPdf, GetSignatureNames | Demonstrates how to delete a specific digital signature from a PDF using Aspose.Pdf.Facades and g... |
| remove-signature-from-pdf | Remove Existing Signature from PDF | PdfFileSignature, BindPdf, RemoveSignature | Shows how to delete a digital signature named "ApprovalSignature" from a PDF file using Aspose.Pd... |
| sign-and-verify-pdf-using-pdffilesignature | Sign and Verify PDF Using PdfFileSignature | PdfFileSignature, BindPdf, SetCertificate | Demonstrates how to sign a PDF with a self‑signed certificate using Aspose.Pdf.Facades.PdfFileSig... |
| sign-pdf-french-caption | Sign PDF with French Caption Using SignatureCustomAppearance | PdfFileSignature, PKCS1, SignatureCustomAppearance | Demonstrates how to digitally sign a PDF with Aspose.Pdf and set the signature caption language t... |
| sign-pdf-visible-signature-last-page | Sign PDF with Visible Signature on Last Page | Document, Page, PdfFileSignature | Shows how to apply a digital signature that is visible in the bottom‑right corner of the last pag... |
| sign-pdf-with-pfx-certificate | Sign PDF with PFX Certificate using Aspose.Pdf | PdfFileSignature, BindPdf, SetCertificate | Demonstrates how to digitally sign a PDF file using a password‑protected PFX certificate with Asp... |
| sign-pdf-with-reason-and-location | Sign PDF with Reason and Location using Aspose.Pdf Facade | PdfFileSignature, BindPdf, SetCertificate | Demonstrates how to digitally sign a PDF, setting the signature reason to "Approved for release" ... |
| sign-pdf-with-retry-on-file-lock | Sign PDF with Retry on File Lock | PdfFileSignature, BindPdf, SetCertificate | Demonstrates how to sign a PDF using Aspose.Pdf.Facades with a retry mechanism that handles file‑... |
| sign-pdf-with-semi-transparent-appearance | Sign PDF with Semi‑Transparent Background Appearance | PdfFileSignature, Sign, Save | Demonstrates how to digitally sign a PDF using a PKCS7 certificate and apply a custom signature a... |
| sign-pdf-with-visible-image-signature | Sign PDF with Visible Image Signature | PdfFileSignature, BindPdf, Sign | Shows how to add a visible image signature to a PDF file using Aspose.Pdf.Facades.PdfFileSignatur... |
| suppress-reason-location-when-signing-pdf | Suppress Reason and Location When Signing a PDF | PdfFileSignature, BindPdf, SetCertificate | Demonstrates how to digitally sign a PDF with Aspose.Pdf while clearing the Reason, Location, and... |
| ... | and 4 more files |
Category Statistics
- Total examples: 34
Category-Specific Tips
Key API Surface
Aspose.Pdf.DocumentAspose.Pdf.Facades.AlgorithmAspose.Pdf.Facades.DocMDPAccessPermissionsAspose.Pdf.Facades.DocMDPSignatureAspose.Pdf.Facades.DocumentPrivilegeAspose.Pdf.Facades.KeySizeAspose.Pdf.Facades.PKCS7Aspose.Pdf.Facades.PdfFileInfoAspose.Pdf.Facades.PdfFileSecurityAspose.Pdf.Facades.PdfFileSecurity.BindPdfAspose.Pdf.Facades.PdfFileSecurity.EncryptFileAspose.Pdf.Facades.PdfFileSecurity.SaveAspose.Pdf.Facades.PdfFileSignatureAspose.Pdf.Facades.PdfFileSignature.BindPdfAspose.Pdf.Facades.PdfFileSignature.Certify
Rules
- Create a PdfFileInfo for {input_pdf} and read its IsEncrypted property to obtain a {bool} indicating whether the PDF is encrypted (password‑protected).
- Use PdfFileInfo instead of loading a full Document when only document metadata such as encryption status is needed.
- Instantiate PdfFileSecurity, call BindPdf({input_pdf}) to load the encrypted PDF, then invoke DecryptFile({string_literal}) with the owner password to decrypt it.
- After decryption, call Save({output_pdf}) on the PdfFileSecurity instance to write the unprotected PDF to disk.
- Instantiate {class} (PdfFileSecurity), call BindPdf({input_pdf}) to load the document, then invoke ChangePassword({owner_password}, {new_user_password}, {new_owner_password}) to set new passwords, and finally Save({output_pdf}) to write the protected file.
Warnings
- DecryptFile requires the owner password; decryption with only a user password is not covered by this example.
- The example assumes the PDF is protected with an owner password; if the PDF has no password, an empty string may be required for the current owner password.
- PdfFileSecurity belongs to the Aspose.Pdf.Facades namespace, which may be deprecated in future releases; consider using the newer Aspose.Pdf.Security namespace if available.
- A valid PKCS#7 certificate file and correct password are required; otherwise signing will fail.
- Custom appearance may not be rendered identically across all PDF viewers.
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-sign-documents patterns
<!-- AUTOGENERATED:START -->Updated: 2026-08-20 | Run: 20260820_001147_12d7b3
<!-- AUTOGENERATED:END -->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
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.

