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

agentic-net-examples / facades-forms

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

C# examples for facades-forms using Aspose.PDF for .NET

The file

We split this AGENTS.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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. Distinctive:

    Use Form.BindPdf({input_pdf}) to open a PDF document for form manipulation.

    line 114

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

Facades forms in PDF using C# / .NET -- 86 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-forms category. This folder contains standalone C# examples for facades-forms operations. See the root agents.md for repository-wide conventions and boundaries.

Scope

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

Required Namespaces

  • using Aspose.Pdf.Facades; (81/86 files) ← category-specific
  • using Aspose.Pdf; (52/86 files) ← category-specific
  • using Aspose.Pdf.Forms; (27/86 files)
  • using Aspose.Pdf.Annotations; (7/86 files)
  • using Aspose.Pdf.Text; (1/86 files)
  • using System; (86/86 files)
  • using System.IO; (79/86 files)
  • using System.Collections.Generic; (8/86 files)
  • using System.Drawing; (4/86 files)
  • using System.Text.Json; (3/86 files)
  • using System.Linq; (2/86 files)
  • using System.Security.Cryptography; (1/86 files)
  • using System.Text; (1/86 files)

Common Code Pattern

Most files follow this pattern:

using (Document doc = new Document("input.pdf"))
{
    // ... operations ...
    doc.Save("output.pdf");
}

Files in this folder

FileTitleKey APIsDescription
add-confirmation-dialog-to-pdf-submit-buttonAdd Confirmation Dialog to PDF Submit ButtonFormEditor, BindPdf, AddFieldScriptShows how to use Aspose.Pdf.Facades.FormEditor to attach JavaScript that displays a confirmation ...
add-digital-signature-field-and-sign-pdfAdd Digital Signature Field and Sign PDFDocument, FormEditor, PdfFileSignatureShows how to add a visible signature field to a PDF page and apply a digital signature using Aspo...
add-email-validation-javascript-to-pdf-form-fieldAdd Email Validation JavaScript to PDF Form FieldFormEditor, BindPdf, SaveDemonstrates how to attach a JavaScript action to the "Email" form field that validates the email...
add-email-validation-to-pdf-form-fieldAdd Email Validation to PDF Form FieldDocument, FormEditor, SetFieldScriptDemonstrates how to attach JavaScript to a PDF form field using Aspose.Pdf to validate email addr...
add-form-load-javascript-to-pdfAdd Form Load JavaScript to PDFPdfContentEditor, BindPdf, AddDocumentAdditionalActionDemonstrates how to attach a document‑level JavaScript action that populates a form field named "...
add-gender-radio-button-groupAdd Gender Radio Button Group to PDF FormFormEditor, BindPdf, AddFieldShows how to insert a radio button group named "Gender" with options Male, Female, and Other, and...
add-hidden-authtoken-field-to-pdfAdd Hidden AuthToken Field to PDFDocument, TextBoxField, RectangleGenerates a secure random token, creates a zero‑size hidden TextBoxField named AuthToken, adds it...
add-hidden-version-field-to-pdfAdd Hidden Version Field to PDFDocument, FormEditor, BindPdfShows how to insert a hidden numeric field named "Version" with a value of 2 into a PDF using Asp...
add-javascript-alert-to-push-buttonAdd JavaScript Alert to Push Button in PDFDocument, Page, RectangleShows how to create a PDF with a push‑button field and attach a JavaScript alert that displays wh...
add-list-box-field-to-pdf-formAdd List Box Field to PDF FormFormEditor, BindPdf, AddFieldDemonstrates how to create a ListBox form field in a PDF, populate it with items, set a default v...
add-list-item-to-pdf-dropdownAdd List Item to PDF Dropdown FieldFormEditor, AddListItem, SaveShows how to add a new option to a combo box (dropdown) form field in a PDF using Aspose.Pdf.Faca...
add-print-button-to-pdfAdd Print Button to PDF Using Aspose.PdfFormEditor, BindPdf, AddFieldShows how to insert a push‑button form field that triggers the PDF print dialog via JavaScript in...
add-radio-button-group-to-pdf-formAdd Radio Button Group to PDF FormFormEditor, AddField, SaveShows how to create a radio button group named "PaymentMethod" with options "Credit" and "PayPal"...
add-reset-form-button-to-pdfAdd Reset Form Button to PDFDocument, FormEditor, AddFieldDemonstrates how to insert a push button into a PDF that clears all form fields when clicked, usi...
add-state-combobox-to-pdfAdd State Combo Box to PDF FormFormEditor, FieldType, AddFieldShows how to insert a combo box field named "State" into an existing PDF and fill it with US stat...
add-submit-button-to-pdf-formAdd Submit Button to PDF FormFormEditor, AddSubmitBtn, SaveShows how to insert a submit button on page 1 of a PDF form that posts the form data to a specifi...
add-text-field-to-pdf-pageAdd Text Field to PDF PageFormEditor, BindPdf, AddFieldShows how to insert a text form field named "CustomerName" on page 1 of an existing PDF using Asp...
add-unchecked-checkbox-field-to-pdfAdd Unchecked Checkbox Field to PDF PageDocument, FormEditor, AddFieldDemonstrates how to insert a checkbox form field on a specific PDF page and set its default state...
apply-custom-font-to-pdf-form-text-fieldsApply Custom Font to All PDF Form Text FieldsFormEditor, FormFieldFacade, FieldTypeDemonstrates how to set a custom font (e.g., Arial Bold) for every text field in a PDF form using...
apply-default-decoration-to-text-fieldsApply Default Decoration to All Text Form FieldsFormEditor, FormFieldFacade, FieldTypeShows how to set default visual attributes via FormFieldFacade and apply them to every text field...
apply-phone-number-input-maskApply Phone Number Input Mask to PDF Form FieldFormEditor, SetFieldScript, SaveDemonstrates how to attach JavaScript to a PDF form field using Aspose.Pdf to enforce a phone num...
attach-javascript-clear-discountcode-fieldClear PDF Form Field on Focus with JavaScriptDocument, Field, JavascriptActionDemonstrates how to attach a JavaScript action to a PDF form field using Aspose.Pdf so that the f...
attach-javascript-to-pdf-form-fieldAttach JavaScript to PDF Form Field for Auto-Calculating Tot...Document, Form, FormFieldShows how to load a PDF, retrieve the Quantity and TotalPrice form fields, attach a JavaScript On...
attach-javascript-validation-to-pdf-form-fieldAttach JavaScript Validation to PDF Form FieldFormEditor, BindPdf, SetFieldScriptShows how to bind a PDF, add a JavaScript script to the "Age" form field that displays a warning ...
attach-js-resetform-clear-hidden-fieldsAttach JavaScript to ResetForm Button to Clear Hidden FieldsFormEditor, BindPdf, AddFieldScriptShows how to bind a PDF with Aspose.Pdf.Facades.FormEditor, add JavaScript to a ResetForm button ...
attach-js-validation-to-pdf-submit-buttonAttach JavaScript Validation to PDF Submit ButtonFormEditor, BindPdf, AddFieldScriptShows how to use Aspose.Pdf.Facades.FormEditor to add a JavaScript script to a PDF submit button ...
batch-add-selectall-checkbox-to-pdfBatch Add SelectAll Checkbox to First Page of PDFsFormEditor, BindPdf, AddFieldShows how to process multiple PDF files in a directory and use Aspose.Pdf.Facades.FormEditor to a...
batch-rename-pdf-form-fieldsBatch Rename PDF Form FieldsForm, FormEditor, RenameFieldDemonstrates how to rename all form fields in a PDF that start with a specific prefix using Aspos...
batch-update-submit-button-urlsBatch Update Submit Button URLs in PDFsForm, FormEditor, FormSubmitButtonNamesDemonstrates how to iterate through a folder of PDF files, detect submit buttons in each form, an...
clear-and-populate-list-box-fieldClear and Populate List Box Field in PDFDocument, ListBoxField, OptionsDemonstrates how to remove all existing options from a PDF list box (combo) field and then add ne...
...and 56 more files

Category Statistics

  • Total examples: 86

Category-Specific Tips

Key API Surface

  • Aspose.Pdf.Facades.FieldType
  • Aspose.Pdf.Facades.Form
  • Aspose.Pdf.Facades.Form.BindPdf
  • Aspose.Pdf.Facades.Form.BindPdf(string)
  • Aspose.Pdf.Facades.Form.ExportFdf
  • Aspose.Pdf.Facades.Form.FillField(string, string)
  • Aspose.Pdf.Facades.Form.GetField(string)
  • Aspose.Pdf.Facades.Form.ImportFdf
  • Aspose.Pdf.Facades.Form.Save
  • Aspose.Pdf.Facades.Form.Save(string)
  • Aspose.Pdf.Facades.FormEditor
  • Aspose.Pdf.Facades.FormEditor.BindPdf
  • Aspose.Pdf.Facades.FormEditor.CopyOuterField
  • Aspose.Pdf.Facades.FormEditor.Save
  • Aspose.Pdf.Facades.FormFieldFacade

Rules

  • Bind a PDF file to a Form facade with Form.BindPdf({input_pdf}).
  • Flatten every form field in the bound document by calling Form.FlattenAllFields().
  • Persist the flattened document using Form.Save({output_pdf}).
  • Use Form.BindPdf({input_pdf}) to open a PDF document for form manipulation.
  • Open an FDF file as a stream and call Form.ImportFdf({fdf_stream}) to populate the PDF form fields.

Warnings

  • The Form class belongs to the Aspose.Pdf.Facades namespace, which may be deprecated in future releases; consider using the newer Document/FormField APIs.
  • The example manually manages the FileStream; ensure the stream is closed or disposed to avoid resource leaks.
  • The example assumes the target PDF already contains an AcroForm; otherwise AddField may have no effect.
  • Coordinate values are in points; callers must convert from other units if needed.
  • FormFieldFacade.Alignment expects one of the FormFieldFacade alignment constants (e.g., AlignCenter).

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-forms 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.