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

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

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
  1. Common:

    Create a PdfFileInfo for {input_pdf} and read its IsEncrypted property to obtain a {bool} indicating whether the PDF is encrypted …

    line 101
  2. Distinctive:

    Use PdfFileInfo instead of loading a full Document when only document metadata such as encryption status is needed.

    line 102
  3. Distinctive:

    After decryption, call Save({output_pdf}) on the PdfFileSecurity instance to write the unprotected PDF to disk.

    line 104

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 .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-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 .cs examples stored directly in this folder.

Required Namespaces

  • using Aspose.Pdf.Facades; (34/34 files) ← category-specific
  • using 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

FileTitleKey APIsDescription
add-digital-signature-to-pdf-pageAdd Digital Signature to First PDF PagePdfFileSignature, BindPdf, SetCertificateDemonstrates how to bind a PDF, set a certificate, and apply a visible digital signature to page ...
add-second-digital-signature-to-pdf-page-3Add Second Digital Signature to PDF Page 3PdfFileSignature, BindPdf, SetCertificateDemonstrates adding a second visible digital signature on page three of an existing PDF using Asp...
add-signature-field-and-sign-pdfCreate Signature Field and Sign PDF DocumentDocument, AddField, PdfFileSignatureDemonstrates how to add an empty digital signature field to a specific page of a PDF using Aspose...
configure-custom-signature-appearanceConfigure Custom Signature Appearance with Background Color ...PdfFileSignature, BindPdf, SignDemonstrates how to set a custom signature appearance by adding a foreground image and a backgrou...
custom-pdf-signature-appearanceCreate Custom PDF Signature Appearance Without CaptionPdfFileSignature, BindPdf, SignDemonstrates signing a PDF with Aspose.Pdf using a PKCS#1 signature and a custom appearance that ...
extract-certificate-details-from-pdf-signaturesExtract Certificate Details from PDF SignaturesPdfFileSignature, BindPdf, GetSignatureNamesDemonstrates 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 SignaturesPdfFileSignature, BindPdf, ContainsSignatureDemonstrates how to open a signed PDF, enumerate its digital signatures, extract the associated X...
extract-signature-images-html-reportExtract Signature Images to HTML ReportPdfFileSignature, BindPdf, GetSignatureNamesDemonstrates how to retrieve signature images from a signed PDF using Aspose.Pdf.Facades and embe...
extract-signing-certificate-from-pdfExtract Signing Certificate from PDF Signature FieldPdfFileSignature, BindPdf, ExtractCertificateShows how to bind a PDF, extract the X.509 signing certificate from a specific signature field, a...
extract-witness-signature-imageExtract Witness Signature Image from PDFPdfFileSignature, BindPdf, ExtractImageDemonstrates how to locate a signature field named 'WitnessSignature' in a PDF, extract its image...
generate-pdf-signature-reportGenerate PDF Signature Verification ReportPdfFileSignature, BindPdf, GetSignatureNamesCreates a PDF document that enumerates all digital signatures in a source PDF, displaying signer,...
hide-pdf-signature-appearanceHide PDF Signature Appearance While Keeping It ValidPdfFileSignature, BindPdf, SetCertificateDemonstrates signing a PDF with Aspose.Pdf and making the signature invisible by setting the visi...
list-signature-names-in-pdfList Signature Names in a PDF DocumentPdfFileSignature, BindPdf, GetSignatureNamesDemonstrates how to use Aspose.Pdf.Facades to open a PDF file and retrieve all non‑empty signatur...
list-signature-reasons-and-locationsList Signature Reasons and Locations in a PDFPdfFileSignature, BindPdf, GetSignatureNamesShows how to bind a PDF with Aspose.Pdf.Facades, enumerate its digital signatures, and retrieve e...
locale-specific-pdf-digital-signatureLocale‑Specific PDF Digital Signature with Custom AppearancePdfFileSignature, PKCS7, SignatureCustomAppearanceDemonstrates how to digitally sign a PDF using Aspose.Pdf with appearance text localized for Germ...
log-pdf-signature-verification-to-jsonLog PDF Signature Verification Results to JSONPdfFileSignature, BindPdf, GetSignatureNamesDemonstrates how to verify each digital signature in a PDF using Aspose.Pdf.Facades and write the...
remove-all-signatures-from-pdfRemove All Signatures from PDFPdfFileSignature, BindPdf, RemoveSignaturesShows how to load a PDF, remove every digital signature using Aspose.Pdf.Facades, and save a clea...
remove-all-signatures-from-pdfsRemove All Signatures from PDFs RecursivelyPdfFileSignature, BindPdf, RemoveSignaturesDemonstrates how to traverse a directory tree, load each PDF with Aspose.Pdf.Facades, remove all ...
remove-and-replace-pdf-signatureRemove Existing Signature and Apply New PDF SignaturePdfFileSignature, BindPdf, RemoveSignaturesShows how to delete all existing signatures from a PDF and then sign the document with a new cert...
remove-pdf-signature-missing-handlingRemove PDF Signature with Missing Signature HandlingPdfFileSignature, BindPdf, GetSignatureNamesDemonstrates how to delete a specific digital signature from a PDF using Aspose.Pdf.Facades and g...
remove-signature-from-pdfRemove Existing Signature from PDFPdfFileSignature, BindPdf, RemoveSignatureShows how to delete a digital signature named "ApprovalSignature" from a PDF file using Aspose.Pd...
sign-and-verify-pdf-using-pdffilesignatureSign and Verify PDF Using PdfFileSignaturePdfFileSignature, BindPdf, SetCertificateDemonstrates how to sign a PDF with a self‑signed certificate using Aspose.Pdf.Facades.PdfFileSig...
sign-pdf-french-captionSign PDF with French Caption Using SignatureCustomAppearancePdfFileSignature, PKCS1, SignatureCustomAppearanceDemonstrates how to digitally sign a PDF with Aspose.Pdf and set the signature caption language t...
sign-pdf-visible-signature-last-pageSign PDF with Visible Signature on Last PageDocument, Page, PdfFileSignatureShows how to apply a digital signature that is visible in the bottom‑right corner of the last pag...
sign-pdf-with-pfx-certificateSign PDF with PFX Certificate using Aspose.PdfPdfFileSignature, BindPdf, SetCertificateDemonstrates how to digitally sign a PDF file using a password‑protected PFX certificate with Asp...
sign-pdf-with-reason-and-locationSign PDF with Reason and Location using Aspose.Pdf FacadePdfFileSignature, BindPdf, SetCertificateDemonstrates how to digitally sign a PDF, setting the signature reason to "Approved for release" ...
sign-pdf-with-retry-on-file-lockSign PDF with Retry on File LockPdfFileSignature, BindPdf, SetCertificateDemonstrates how to sign a PDF using Aspose.Pdf.Facades with a retry mechanism that handles file‑...
sign-pdf-with-semi-transparent-appearanceSign PDF with Semi‑Transparent Background AppearancePdfFileSignature, Sign, SaveDemonstrates how to digitally sign a PDF using a PKCS7 certificate and apply a custom signature a...
sign-pdf-with-visible-image-signatureSign PDF with Visible Image SignaturePdfFileSignature, BindPdf, SignShows how to add a visible image signature to a PDF file using Aspose.Pdf.Facades.PdfFileSignatur...
suppress-reason-location-when-signing-pdfSuppress Reason and Location When Signing a PDFPdfFileSignature, BindPdf, SetCertificateDemonstrates 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.Document
  • Aspose.Pdf.Facades.Algorithm
  • Aspose.Pdf.Facades.DocMDPAccessPermissions
  • Aspose.Pdf.Facades.DocMDPSignature
  • Aspose.Pdf.Facades.DocumentPrivilege
  • Aspose.Pdf.Facades.KeySize
  • Aspose.Pdf.Facades.PKCS7
  • Aspose.Pdf.Facades.PdfFileInfo
  • Aspose.Pdf.Facades.PdfFileSecurity
  • Aspose.Pdf.Facades.PdfFileSecurity.BindPdf
  • Aspose.Pdf.Facades.PdfFileSecurity.EncryptFile
  • Aspose.Pdf.Facades.PdfFileSecurity.Save
  • Aspose.Pdf.Facades.PdfFileSignature
  • Aspose.Pdf.Facades.PdfFileSignature.BindPdf
  • Aspose.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 -->

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.